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

Side by Side Diff: appengine/findit/templates/build_failure.html

Issue 2361583002: [Findit] UI change and triage change for cl level trige. (Closed)
Patch Set: fixes on result page. Created 4 years, 3 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <head> 2 <head>
3 <title>{% block title %}{% endblock %} Failure</title> 3 <title>{% block title %}{% endblock %} Failure</title>
4 <meta charset="utf-8"> 4 <meta charset="utf-8">
5 <link rel="stylesheet" href="/common.css"> 5 <link rel="stylesheet" href="/common.css">
6 <style> 6 <style>
7 .running { 7 .running {
8 color: #666666; 8 color: #666666;
9 background-color: #fffc6c; 9 background-color: #fffc6c;
10 border-color: #c5c56d; 10 border-color: #c5c56d;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 var findit = {}; 66 var findit = {};
67 findit.analysisCompleted = '{{analysis_completed}}' == 'True'; 67 findit.analysisCompleted = '{{analysis_completed}}' == 'True';
68 findit.analysisFailed = '{{analysis_failed}}' == 'True'; 68 findit.analysisFailed = '{{analysis_failed}}' == 'True';
69 findit.builderUrl = 'https://build.chromium.org/p/{{master_name}}/builders/{ {builder_name}}'; 69 findit.builderUrl = 'https://build.chromium.org/p/{{master_name}}/builders/{ {builder_name}}';
70 findit.buildUrl = findit.builderUrl + '/builds/{{build_number}}'; 70 findit.buildUrl = findit.builderUrl + '/builds/{{build_number}}';
71 findit.triageReferenceAnalysisUrl = '/waterfall/build-failure?url=https://bu ild.chromium.org/p/{{triage_reference_analysis_master_name}}/builders/{{triage_r eference_analysis_builder_name}}/builds/{{triage_reference_analysis_build_number }}'; 71 findit.triageReferenceAnalysisUrl = '/waterfall/build-failure?url=https://bu ild.chromium.org/p/{{triage_reference_analysis_master_name}}/builders/{{triage_r eference_analysis_builder_name}}/builds/{{triage_reference_analysis_build_number }}';
72 findit.analysisCorrect = '{{analysis_correct}}'; // Possible values: 'None' , 'True', or 'False'. 72 findit.analysisCorrect = '{{analysis_correct}}'; // Possible values: 'None' , 'True', or 'False'.
73 findit.analysisIsDuplicate = '{{analysis_is_duplicate}}' == 'True'; 73 findit.analysisIsDuplicate = '{{analysis_is_duplicate}}' == 'True';
74 findit.showTriageHelpButton = '{{show_triage_help_button}}' == 'True'; 74 findit.showTriageHelpButton = '{{show_triage_help_button}}' == 'True';
75 findit.showDebugInfo = '{{show_debug_info}}' == 'True'; 75 findit.showDebugInfo = '{{show_debug_info}}' == 'True';
76 findit.suspectedCLs = {{suspected_cls | tojson | safe}};
76 77
77 {% block constant %}{% endblock constant %} 78 {% block constant %}{% endblock constant %}
78 79
80 function displaySuspectedCls() {
81 if (! jQuery.isEmptyObject(findit.suspectedCLs)) {
82 var tableString = '<table>';
83 for (var i=0; i<findit.suspectedCLs.length; i++) {
stgao 2016/09/23 19:35:41 nit: space " < ".
chanli 2016/09/24 01:09:40 Done.
84 var suspectedCL = findit.suspectedCLs[i];
85 var revision = suspectedCL.revision;
86 var commit_position = suspectedCL.commit_position || revision;
87 var cl_info = suspectedCL.repo_name + '/' + revision;
88 var status = suspectedCL.status;
89 tableString += '<tr><td>';
90 tableString += suspectedCL.repo_name + ' <a href="' + suspectedCL.url + '">' + commit_position + '</a></td>';
91 tableString += '<td>';
92
93 var str_radio_correct = '<input type="radio" name="' + cl_info + '" va lue="0" onclick="triageSuspectedCL(this)"';
94 var str_radio_incorrect = '<input type="radio" name="' + cl_info + '" value="1" onclick="triageSuspectedCL(this)"';
95 if (status == "0") {
stgao 2016/09/23 19:35:41 use single quote for consistency?
chanli 2016/09/24 01:09:40 Done.
96 str_radio_correct += ' checked="checked"';
97 } else if (status == "1") {
98 str_radio_incorrect += ' checked="checked"';
99 }
100 tableString += str_radio_correct + '>Correct &nbsp;&nbsp;';
101 tableString += str_radio_incorrect + '>Incorrect';
102 tableString += '</td></tr>';
103 }
104 tableString += '</table>';
105 $('#suspected_cls').html('<b>Feedback on Findit result:</b><br>' + table String);
106 }
107 }
108
109 function triageSuspectedCL(e) {
110 $.getJSON('/waterfall/triage-suspected-cl?cl_info=' + e.name +'&status=' + e.value + '&url=' + findit.buildUrl, function(data) {
111 if (! data[success]) {
112 alert('Failed to update datastore. Please refresh and try again.');
113 }
114 }).error(function(xhr) {
115 // Replace the whole page with errors from server side.
116 document.body.outerHTML = xhr.responseText;
117 });
118
119 e.preventDefault();
120 }
121
79 function triageAnalysisResult(e) { 122 function triageAnalysisResult(e) {
80 var target = $(this); 123 var target = $(this);
81 if (target.hasClass('triaged')) 124 if (target.hasClass('triaged'))
82 return; 125 return;
83 126
84 var correct = target.hasClass('thumb-up'); 127 var correct = target.hasClass('thumb-up');
85 $.getJSON('/waterfall/triage-analysis?correct=' + correct + '&url=' + find it.buildUrl, function(data) { 128 $.getJSON('/waterfall/triage-analysis?correct=' + correct + '&url=' + find it.buildUrl, function(data) {
86 if (data['success']) { 129 if (data['success']) {
87 $('.triaged').addClass('triage').removeClass('triaged'); 130 $('.triaged').addClass('triage').removeClass('triaged');
88 target.addClass('triaged').removeClass('triage'); 131 target.addClass('triaged').removeClass('triage');
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 $('#status_message').attr('class', 'error'); 193 $('#status_message').attr('class', 'error');
151 } else { 194 } else {
152 // TODO: use another style when no culprit CL is found. 195 // TODO: use another style when no culprit CL is found.
153 $('#status_message').text('completed'); 196 $('#status_message').text('completed');
154 $('#status_message').attr('class', 'completed'); 197 $('#status_message').attr('class', 'completed');
155 198
156 $('.triage').click(triageAnalysisResult); 199 $('.triage').click(triageAnalysisResult);
157 200
158 {% block failure_classification %}{% endblock failure_classification % } 201 {% block failure_classification %}{% endblock failure_classification % }
159 202
160 if (findit.analysisCorrect == 'True') { 203 displaySuspectedCls();
161 $('.thumb-up').addClass('triaged').removeClass('triage');
162 } else if (findit.analysisCorrect == 'False') {
163 $('.thumb-down').addClass('triaged').removeClass('triage');
164 }
165 204
166 {% if show_debug_info %} 205 {% if show_debug_info %}
167 if (findit.analysisIsDuplicate) { 206 if (findit.analysisIsDuplicate) {
168 $('#duplicate_reference').html('This analysis was automatically tr iaged as a duplicate because of another build analysis: ' + 207 $('#duplicate_reference').html('This analysis was automatically tr iaged as a duplicate because of another build analysis: ' +
169 '<a href="' + findit.triageReferenc eAnalysisUrl + '">{{triage_reference_analysis_master_name}}/' + 208 '<a href="' + findit.triageReferenc eAnalysisUrl + '">{{triage_reference_analysis_master_name}}/' +
170 '{{triage_reference_analysis_builde r_name}}/{{triage_reference_analysis_build_number}}</a>'); 209 '{{triage_reference_analysis_builde r_name}}/{{triage_reference_analysis_build_number}}</a>');
171 } 210 }
172 {% endif %} 211 {% endif %}
173 212
174 if (findit.showTriageHelpButton) { 213 if (findit.showTriageHelpButton) {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 <b>Findit result:</b> 264 <b>Findit result:</b>
226 265
227 {% block try_job_result %}{% endblock try_job_result %} 266 {% block try_job_result %}{% endblock try_job_result %}
228 {% if analysis_completed %} 267 {% if analysis_completed %}
229 {% block result_tables %}{% endblock result_tables %} 268 {% block result_tables %}{% endblock result_tables %}
230 {% endif %} 269 {% endif %}
231 270
232 {% if analysis_completed %} 271 {% if analysis_completed %}
233 <br> 272 <br>
234 <div> 273 <div>
235 <b>Feedback on Findit result:</b><br> 274 <div id="suspected_cls">
236 <div class="thumbs-up-down">
237 <div class="triage thumb-up">Correct <img src="https://www.gstatic.com/ima ges/icons/material/system/1x/thumb_up_black_24dp.png"/></div>
238 <div class="triage thumb-down"><img src="https://www.gstatic.com/images/ic ons/material/system/1x/thumb_down_black_24dp.png"/> Incorrect</div>
239 </div> 275 </div>
240 {% if show_debug_info %} 276 {% if show_debug_info %}
241 <div id="duplicates_marked"></div> 277 <div id="duplicates_marked"></div>
242 <div id="duplicate_reference"></div> 278 <div id="duplicate_reference"></div>
243 {% endif %} 279 {% endif %}
244 </div> 280 </div>
245 {% endif %} 281 {% endif %}
246 282
247 {% if show_triage_help_button %} 283 {% if show_triage_help_button %}
248 <br><br> 284 <br><br>
249 <div id="triage_help"> 285 <div id="triage_help">
250 <button id="triage_help_button">Triage help</button> 286 <button id="triage_help_button">Triage help</button>
251 <br> 287 <br>
252 <div id="triage_help_result"> 288 <div id="triage_help_result">
253 </div> 289 </div>
254 </div> 290 </div>
255 {% endif %} 291 {% endif %}
256 292
257 {% if triage_history %} 293 {% if triage_history %}
258 <br> 294 <br>
259 <b>Triage history:</b> 295 <b>Triage history:</b>
260 <div> 296 <div>
261 <table> 297 <table>
262 <tr><th>When</th><th>Who</th><th>Result</th><th>Version</th></tr> 298 <tr><th>When</th><th>Who</th><th>CL</th><th>Result</th><th>Version</th>< /tr>
263 <tbody> 299 <tbody>
264 {% for triage_record in triage_history %} 300 {% for triage_record in triage_history %}
265 <tr> 301 <tr>
266 <td>{{triage_record.triage_time}}</td> 302 <td>{{triage_record.triage_time}}</td>
267 <td>{{triage_record.user_name}}</td> 303 <td>{{triage_record.user_name}}</td>
304 <td>{{triage_record.triaged_cl.repo_name}} <a href="{{triage_recor d.triaged_cl.url}}">{{triage_record.triaged_cl.commit_position or triage_record. triaged_cl.revision}}</a></td>
268 <td>{{triage_record.result_status}}</td> 305 <td>{{triage_record.result_status}}</td>
269 <td>{{triage_record.version | default('N/A', true)}}</td> 306 <td>{{triage_record.version | default('N/A', true)}}</td>
270 </tr> 307 </tr>
271 {% endfor %} 308 {% endfor %}
272 </tbody> 309 </tbody>
273 </table> 310 </table>
274 </div> 311 </div>
275 {% endif %} 312 {% endif %}
276 313
277 <div id="score-explanation-dialog" title="Score Explanation"> 314 <div id="score-explanation-dialog" title="Score Explanation">
278 The total score is a sum of scores for all hints.<br> 315 The total score is a sum of scores for all hints.<br>
279 Rules to set a score to an hint: 316 Rules to set a score to an hint:
280 <ul> 317 <ul>
281 <li>5: The CL added or deleted a file that appears in the failure log.</li > 318 <li>5: The CL added or deleted a file that appears in the failure log.</li >
282 <li>2: The CL modified a file that appears in the failure log.</li> 319 <li>2: The CL modified a file that appears in the failure log.</li>
283 <li>1: The CL modified a file that is related to another file 320 <li>1: The CL modified a file that is related to another file
284 appearing in the failure log. (eg: file.h was changed and 321 appearing in the failure log. (eg: file.h was changed and
285 file_unittest.cc or file_impl.cc appeared in the log.)</li> 322 file_unittest.cc or file_impl.cc appeared in the log.)</li>
286 <li>1: The CL rolled a dependency within src/DEPS and a file of that 323 <li>1: The CL rolled a dependency within src/DEPS and a file of that
287 dependency appears in the failure log. (eg: third_party/dep 324 dependency appears in the failure log. (eg: third_party/dep
288 was changed in src/DEPS and third_party/dep/f.cpp appeared 325 was changed in src/DEPS and third_party/dep/f.cpp appeared
289 in the log.)</li> 326 in the log.)</li>
290 </ul> 327 </ul>
291 (More rules will be added when implemented.) 328 (More rules will be added when implemented.)
292 </div> 329 </div>
293 </body> 330 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698