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

Unified Diff: Tools/GardeningServer/model/ct-failures.html

Issue 476903004: [sheriff-o-matic]: Basic trooper display for sheriff-o-matic. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: Tools/GardeningServer/model/ct-failures.html
diff --git a/Tools/GardeningServer/model/ct-failures.html b/Tools/GardeningServer/model/ct-failures.html
index bccc35b83127308123be4e05bca40575e2488c1f..1ec0e1b4bc77ab1f16e2d4c0aedbaba9f3d058e4 100644
--- a/Tools/GardeningServer/model/ct-failures.html
+++ b/Tools/GardeningServer/model/ct-failures.html
@@ -14,7 +14,7 @@ found in the LICENSE file.
function CTFailures(commitLog) {
this.commitLog = commitLog;
this.builderLatestRevisions = null;
- this.failures = null;
+ this.failures = {}
ojan 2014/09/02 02:35:11 This won't update right until https://codereview.c
shans 2014/09/04 01:59:42 Acknowledged.
this.lastUpdateDate = null;
// FIXME: Get this from
@@ -79,19 +79,21 @@ CTFailures.prototype.update = function() {
var annotationPromise = CTFailureGroup.fetchAnnotations();
net.json('http://sheriff-o-matic.appspot.com/alerts').then(function(data) {
annotationPromise.then(function(annotations) {
- // FIXME: Don't special-case the blink master.
- this.builderLatestRevisions = new CTBuilderRevisions(data.latest_builder_info['chromium.webkit']);
- this.failures = {};
- this.lastUpdateDate = new Date(data.date * 1000);
- // Update |failures| with the appropriate CTFailureGroup's for each
- // tree.
- data.range_groups.forEach(function(rangeGroup) {
- this._processFailuresForRangeGroup(rangeGroup, data.alerts, annotations);
- }.bind(this));
- // Sort failure groups so that newer failures are shown at the top
- // of the UI.
- Object.keys(this.failures, function (tree, failuresByTree) {
- this.failures[tree].sort(this._failureByTreeListComparator.bind(this, tree));
+ net.json('http://trooper-o-matic.appspot.com/alerts').then(function(trooper_data) {
ojan 2014/09/02 02:35:11 These two requests should be done in parallel. You
shans 2014/09/04 01:59:42 Done.
+ // FIXME: Don't special-case the blink master.
+ this.builderLatestRevisions = new CTBuilderRevisions(data.latest_builder_info['chromium.webkit']);
+ this.lastUpdateDate = new Date(data.date * 1000);
+ // Update |failures| with the appropriate CTFailureGroup's for each
+ // tree.
+ data.range_groups.forEach(function(rangeGroup) {
+ this._processFailuresForRangeGroup(rangeGroup, data.alerts, annotations);
+ }.bind(this));
+ // Sort failure groups so that newer failures are shown at the top
+ // of the UI.
+ Object.keys(this.failures, function (tree, failuresByTree) {
+ this.failures[tree].sort(this._failureByTreeListComparator.bind(this, tree));
+ }.bind(this));
+ this._processTrooperFailures(trooper_data);
}.bind(this));
}.bind(this));
}.bind(this));
@@ -109,6 +111,18 @@ CTFailures.prototype._failureComparator = function(a, b) {
return 0;
};
+
+CTFailures.prototype._processTrooperFailures = function(data) {
+ var trooper_failures = [];
+ for (var key in data) {
ojan 2014/09/02 02:35:11 Use Object.keys http://sugarjs.com/api/Object/keys
shans 2014/09/04 01:59:42 Done.
+ for (var tree in data[key]) {
+ if (data[key][tree].should_alert)
+ trooper_failures.push(new CTTrooperFailureGroup(data[key][tree], key, tree));
ojan 2014/09/02 02:35:11 Don't store the raw data object we get from the se
shans 2014/09/04 01:59:42 Done.
+ }
+ }
+ this.failures['trooper'] = trooper_failures;
+};
+
CTFailures.prototype._processFailuresForRangeGroup = function(rangeGroup, alerts, annotations) {
var masterToTree = {};
Object.keys(this._trees, function(tree, masters) {

Powered by Google App Engine
This is Rietveld 408576698