Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!-- | 1 <!-- |
| 2 Copyright 2014 The Chromium Authors. All rights reserved. | 2 Copyright 2014 The Chromium Authors. All rights reserved. |
| 3 Use of this source code is governed by a BSD-style license that can be | 3 Use of this source code is governed by a BSD-style license that can be |
| 4 found in the LICENSE file. | 4 found in the LICENSE file. |
| 5 --> | 5 --> |
| 6 | 6 |
| 7 <link rel="import" href="../model/ct-failure.html"> | 7 <link rel="import" href="../model/ct-failure.html"> |
| 8 <link rel="import" href="../model/ct-failure-group.html"> | |
| 8 | 9 |
| 9 <polymer-element name="ct-failure-analyzer" attributes="failures builderLatestRe visions"> | 10 <polymer-element name="ct-failure-analyzer" attributes="failures builderLatestRe visions"> |
| 10 <script> | 11 <script> |
| 11 // FIXME: Don't use a polymer component for this. Instead use a Failures mod el | 12 // FIXME: Don't use a polymer component for this. Instead use a Failures mod el |
| 12 // object that knows how to do the XHR and process the data appropriately. | 13 // object that knows how to do the XHR and process the data appropriately. |
| 13 Polymer({ | 14 Polymer({ |
| 14 builderLatestRevisions: null, | 15 builderLatestRevisions: null, |
| 15 failures: null, | 16 failures: null, |
| 16 | 17 |
| 17 // FIXME: Get this from https://chromium.googlesource.com/chromium/tools/b uild/+/master/scripts/slave/gatekeeper_trees.json?format=text. | 18 // FIXME: Get this from https://chromium.googlesource.com/chromium/tools/b uild/+/master/scripts/slave/gatekeeper_trees.json?format=text. |
| 18 _trees: { | 19 _trees: { |
| 19 blink: [ | 20 blink: [ |
| 20 "https://build.chromium.org/p/chromium.webkit", | 21 "https://build.chromium.org/p/chromium.webkit", |
| 21 ], | 22 ], |
| 22 chromium: [ | 23 chromium: [ |
| 23 "https://build.chromium.org/p/chromium", | 24 "https://build.chromium.org/p/chromium", |
| 24 "https://build.chromium.org/p/chromium.chrome", | 25 "https://build.chromium.org/p/chromium.chrome", |
| 25 "https://build.chromium.org/p/chromium.chromiumos", | 26 "https://build.chromium.org/p/chromium.chromiumos", |
| 26 "https://build.chromium.org/p/chromium.gpu", | 27 "https://build.chromium.org/p/chromium.gpu", |
| 27 "https://build.chromium.org/p/chromium.linux", | 28 "https://build.chromium.org/p/chromium.linux", |
| 28 "https://build.chromium.org/p/chromium.mac", | 29 "https://build.chromium.org/p/chromium.mac", |
| 29 "https://build.chromium.org/p/chromium.memory", | 30 "https://build.chromium.org/p/chromium.memory", |
| 30 "https://build.chromium.org/p/chromium.win" | 31 "https://build.chromium.org/p/chromium.win" |
| 31 ], | 32 ], |
| 32 }, | 33 }, |
| 33 | 34 |
| 34 update: function() { | 35 update: function() { |
| 36 var annotationPromise = CTFailureGroup.fetchAnnotations(); | |
| 35 net.json('http://auto-sheriff.appspot.com/data').then(function(data) { | 37 net.json('http://auto-sheriff.appspot.com/data').then(function(data) { |
|
ojan
2014/08/07 00:09:58
This is good for now. FYI, I'm starting to think t
dstockwell
2014/08/11 01:20:42
Why does sheriff-o-matic need its own backend? Can
ojan
2014/08/11 01:44:43
Very shortly, in the next day or two, we'll be get
| |
| 36 // FIXME: Don't special-case the blink master. | 38 annotationPromise.then(function(annotations) { |
| 37 this.builderLatestRevisions = data.latest_revisions['chromium.webkit'] ; | 39 // FIXME: Don't special-case the blink master. |
| 38 // FIXME: Make this a model class intead of a dumb object. | 40 this.builderLatestRevisions = data.latest_revisions['chromium.webkit ']; |
| 39 this.failures = {}; | 41 // FIXME: Make this a model class intead of a dumb object. |
| 40 data.range_groups.forEach(function(group) { | 42 this.failures = {}; |
| 41 this._processFailuresForGroup(group, data.alerts); | 43 data.range_groups.forEach(function(group) { |
| 44 this._processFailuresForGroup(group, data.alerts, annotations); | |
| 45 }.bind(this)); | |
| 46 // FIXME: Sort this.failures by severity of regression, then by olde stFailingRevision. | |
| 42 }.bind(this)); | 47 }.bind(this)); |
| 43 // FIXME: Sort this.failures by severity of regression, then by oldest FailingRevision. | |
| 44 }.bind(this)); | 48 }.bind(this)); |
| 45 }, | 49 }, |
| 46 | 50 |
| 47 _failureComparator: function(a, b) { | 51 _failureComparator: function(a, b) { |
| 48 if (a.step > b.step) | 52 if (a.step > b.step) |
| 49 return 1; | 53 return 1; |
| 50 if (a.step < b.step) | 54 if (a.step < b.step) |
| 51 return -1 | 55 return -1 |
| 52 if (a.testName > b.testName) | 56 if (a.testName > b.testName) |
| 53 return 1; | 57 return 1; |
| 54 if (a.testName < b.testName) | 58 if (a.testName < b.testName) |
| 55 return -1 | 59 return -1 |
| 56 return 0; | 60 return 0; |
| 57 }, | 61 }, |
| 58 | 62 |
| 59 _processFailuresForGroup: function(group, failures) { | 63 _processFailuresForGroup: function(group, failures, annotations) { |
| 60 var failuresByReason = {}; | 64 var failuresByReason = {}; |
| 61 | 65 |
| 62 var masterToTree = {}; | 66 var masterToTree = {}; |
| 63 Object.keys(this._trees, function(tree, masters) { | 67 Object.keys(this._trees, function(tree, masters) { |
| 64 masters.forEach(function(master) { | 68 masters.forEach(function(master) { |
| 65 masterToTree[master] = tree; | 69 masterToTree[master] = tree; |
| 66 }); | 70 }); |
| 67 }); | 71 }); |
| 68 | 72 |
| 69 group.failure_keys.forEach(function(failure_key) { | 73 group.failure_keys.forEach(function(failure_key) { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 110 groupedFailures[tree] = []; | 114 groupedFailures[tree] = []; |
| 111 groupedFailures[tree].push(new CTFailure(failure.step, failure.reaso n, resultsByBuilder, group.merged_first_failing, group.merged_last_passing)); | 115 groupedFailures[tree].push(new CTFailure(failure.step, failure.reaso n, resultsByBuilder, group.merged_first_failing, group.merged_last_passing)); |
| 112 }) | 116 }) |
| 113 }); | 117 }); |
| 114 | 118 |
| 115 Object.keys(groupedFailures, function(tree, failures) { | 119 Object.keys(groupedFailures, function(tree, failures) { |
| 116 failures.sort(this._failureComparator); | 120 failures.sort(this._failureComparator); |
| 117 | 121 |
| 118 if (!this.failures[tree]) | 122 if (!this.failures[tree]) |
| 119 this.failures[tree] = []; | 123 this.failures[tree] = []; |
| 120 this.failures[tree].push(failures); | 124 // FIXME: Need a better identifier for a failure group; |
| 125 var key = group.sort_key; | |
| 126 this.failures[tree].push(new CTFailureGroup(key, failures, annotations [key])); | |
| 121 }.bind(this)); | 127 }.bind(this)); |
| 122 }, | 128 }, |
| 123 }); | 129 }); |
| 124 </script> | 130 </script> |
| 125 </polymer-element> | 131 </polymer-element> |
| OLD | NEW |