Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(354)

Side by Side Diff: appengine/swarming/ui/res/imp/taskpage/task-page.html

Issue 2929413003: Use service_account_token for task retry (Closed)
Patch Set: rebase Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « appengine/swarming/ui/build/js/js.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!-- 1 <!--
2 Copyright 2016 The LUCI Authors. All rights reserved. 2 Copyright 2016 The LUCI Authors. All rights reserved.
3 Use of this source code is governed under the Apache License, Version 2.0 3 Use of this source code is governed under the Apache License, Version 2.0
4 that can be found in the LICENSE file. 4 that can be found in the LICENSE file.
5 5
6 This in an HTML Import-able file that contains the definition 6 This in an HTML Import-able file that contains the definition
7 of the following elements: 7 of the following elements:
8 8
9 <task-page> 9 <task-page>
10 10
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 <td> 486 <td>
487 <font color="#0072b2">[[_result.human_duration]]</font> 487 <font color="#0072b2">[[_result.human_duration]]</font>
488 </td> 488 </td>
489 </tr> 489 </tr>
490 </tbody> 490 </tbody>
491 </table> 491 </table>
492 </div> 492 </div>
493 <div class="right flex"> 493 <div class="right flex">
494 <template is="dom-if" if="[[_result.human_completed_ts]]"> 494 <template is="dom-if" if="[[_result.human_completed_ts]]">
495 <div class="left flex" style="padding-left: 50px; padding-righ t: 50px"> 495 <div class="left flex" style="padding-left: 50px; padding-righ t: 50px">
496 <svg-piechart 496 <svg-piechart
497 data="[[_computePiechartData(_result)]]" 497 data="[[_computePiechartData(_result)]]"
498 colors="[&quot;rgb(204,121,167)&quot;, &quot;rgb(0,114,178 )&quot;]"> 498 colors="[&quot;rgb(204,121,167)&quot;, &quot;rgb(0,114,178 )&quot;]">
499 </svg-piechart> 499 </svg-piechart>
500 </div> 500 </div>
501 </template> 501 </template>
502 </div> 502 </div>
503 </div> 503 </div>
504 504
505 <div class="title" hidden$="[[_not(_task_exists)]]">Task Execution</ div> 505 <div class="title" hidden$="[[_not(_task_exists)]]">Task Execution</ div>
506 <template is="dom-if" if="[[_wasPickedUp(_result)]]"> 506 <template is="dom-if" if="[[_wasPickedUp(_result)]]">
507 <table hidden$="[[_not(_task_exists)]]"> 507 <table hidden$="[[_not(_task_exists)]]">
508 <tr> 508 <tr>
509 <td>Bot assigned to task</td> 509 <td>Bot assigned to task</td>
510 <td><a href$="[[_botLink(_result.bot_id)]]">[[_result.bot_id]] </td> 510 <td><a href$="[[_botLink(_result.bot_id)]]">[[_result.bot_id]] </td>
511 </tr> 511 </tr>
512 <tr> 512 <tr>
513 <td rowspan$="[[_rowspan(_result.bot_dimensions)]]"> 513 <td rowspan$="[[_rowspan(_result.bot_dimensions)]]">
514 <a>Bot Dimensions</a> 514 <a>Bot Dimensions</a>
515 </td> 515 </td>
516 </tr> 516 </tr>
517 <template is="dom-repeat" items="[[_result.bot_dimensions]]" as= "dimension"> 517 <template is="dom-repeat" items="[[_result.bot_dimensions]]" as= "dimension">
518 <tr> 518 <tr>
519 <td bgcolor$="[[_highlight(_request.properties.dimensions, d imension.key)]]"> 519 <td bgcolor$="[[_highlight(_request.properties.dimensions, d imension.key)]]">
520 <b>[[dimension.key]]:</b> 520 <b>[[dimension.key]]:</b>
521 <template 521 <template
522 is="dom-repeat" 522 is="dom-repeat"
523 items="[[_aliasResult(_request.properties.dimensions, di mension)]]" 523 items="[[_aliasResult(_request.properties.dimensions, di mension)]]"
524 as="value"> 524 as="value">
525 <span class$="[[value.class]] dim">[[value.name]]</span> 525 <span class$="[[value.class]] dim">[[value.name]]</span>
526 </template> 526 </template>
527 </td> 527 </td>
528 </tr> 528 </tr>
529 </template> 529 </template>
530 530
531 <tr> 531 <tr>
532 <td>Exit code</td> 532 <td>Exit code</td>
533 <td>[[_result.exit_code]]</td> 533 <td>[[_result.exit_code]]</td>
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 values[i] = swarming.alias.apply(v, request.key); 788 values[i] = swarming.alias.apply(v, request.key);
789 }); 789 });
790 } 790 }
791 return values.join(" | "); 791 return values.join(" | ");
792 }, 792 },
793 793
794 _aliasResult: function(requested_dims, bot_dim) { 794 _aliasResult: function(requested_dims, bot_dim) {
795 // requested_dims is the entire _request.properties.dimensions array, bu t we 795 // requested_dims is the entire _request.properties.dimensions array, bu t we
796 // are only passed in one key at a time from _result.bot_dimensions as t he 796 // are only passed in one key at a time from _result.bot_dimensions as t he
797 // bot_dim variable. Therefore we need to loop through the key-value pai rs 797 // bot_dim variable. Therefore we need to loop through the key-value pai rs
798 // of requested_dims to determine whether the current bot dimension was 798 // of requested_dims to determine whether the current bot dimension was
799 // requested. 799 // requested.
800 var boldMap = []; 800 var boldMap = [];
801 var target = null; 801 var target = null;
802 requested_dims.forEach(function(dim, i) { 802 requested_dims.forEach(function(dim, i) {
803 if (dim.key === bot_dim.key) { 803 if (dim.key === bot_dim.key) {
804 target = i; 804 target = i;
805 } 805 }
806 }); 806 });
807 var values = bot_dim.value; 807 var values = bot_dim.value;
808 if (!Array.isArray(values)) { 808 if (!Array.isArray(values)) {
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
1052 return; 1052 return;
1053 } 1053 }
1054 var newTask = { 1054 var newTask = {
1055 expiration_secs: this._request.expiration_secs, 1055 expiration_secs: this._request.expiration_secs,
1056 name: this._request.name +" (retry)", 1056 name: this._request.name +" (retry)",
1057 parent_task_id: this._request.parent_task_id, 1057 parent_task_id: this._request.parent_task_id,
1058 priority: this._request.priority, 1058 priority: this._request.priority,
1059 properties:this._request.properties, 1059 properties:this._request.properties,
1060 tags: this._request.tags, 1060 tags: this._request.tags,
1061 user: this._profile.email, 1061 user: this._profile.email,
1062 service_account: this._request.service_account, 1062 service_account_token: this._request.service_account,
1063 } 1063 }
1064 newTask.properties.dimensions = this._retry_dimensions.filter(function(d ){ 1064 newTask.properties.dimensions = this._retry_dimensions.filter(function(d ){
1065 return d && d.key && d.value; 1065 return d && d.key && d.value;
1066 }); 1066 });
1067 if (!newTask.properties.dimensions || !newTask.properties.dimensions.len gth) { 1067 if (!newTask.properties.dimensions || !newTask.properties.dimensions.len gth) {
1068 sk.errorMessage("Your retried task must specify dimensions", 5000); 1068 sk.errorMessage("Your retried task must specify dimensions", 5000);
1069 return; 1069 return;
1070 } 1070 }
1071 console.log("Retrying with dimensions", newTask.properties.dimensions); 1071 console.log("Retrying with dimensions", newTask.properties.dimensions);
1072 newTask.properties.idempotent = false; 1072 newTask.properties.idempotent = false;
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
1176 1176
1177 this._getJsonAsync("_other_running", "/api/swarming/v1/tasks/count", "_b usyRunningCount", this._auth_headers, taskCountParams); 1177 this._getJsonAsync("_other_running", "/api/swarming/v1/tasks/count", "_b usyRunningCount", this._auth_headers, taskCountParams);
1178 // change running to pending 1178 // change running to pending
1179 taskCountParams.state = ["PENDING"]; 1179 taskCountParams.state = ["PENDING"];
1180 this._getJsonAsync("_other_pending", "/api/swarming/v1/tasks/count", "_b usyPendingCount", this._auth_headers, taskCountParams); 1180 this._getJsonAsync("_other_pending", "/api/swarming/v1/tasks/count", "_b usyPendingCount", this._auth_headers, taskCountParams);
1181 } 1181 }
1182 }); 1182 });
1183 })(); 1183 })();
1184 </script> 1184 </script>
1185 </dom-module> 1185 </dom-module>
OLDNEW
« no previous file with comments | « appengine/swarming/ui/build/js/js.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698