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

Side by Side Diff: Tools/GardeningServer/scripts/model.js

Issue 410483002: Add the revision details widget to sheriff-o-matic (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 { 104 {
105 var builders = {}; 105 var builders = {};
106 Object.keys(model.state.resultsByBuilder).forEach(function(builderName) { 106 Object.keys(model.state.resultsByBuilder).forEach(function(builderName) {
107 var results = model.state.resultsByBuilder[builderName]; 107 var results = model.state.resultsByBuilder[builderName];
108 if (parseInt(results.blink_revision) < revision) 108 if (parseInt(results.blink_revision) < revision)
109 builders[builderName] = { actual: 'BUILDING' }; 109 builders[builderName] = { actual: 'BUILDING' };
110 }); 110 });
111 return builders; 111 return builders;
112 }; 112 };
113 113
114 model.latestRevision = function()
115 {
116 return model.state.recentCommits[0].revision;
117 };
118
119 model.latestRevisionWithNoBuildersInFlight = function()
ojan 2014/07/21 23:22:37 This all needs to be updated for the new code. I s
120 {
121 var revision = 0;
122 Object.keys(model.state.resultsByBuilder).forEach(function(builderName) {
123 var results = model.state.resultsByBuilder[builderName];
124 if (!results.blink_revision)
125 return;
126 var testedRevision = parseInt(results.blink_revision);
127 revision = revision ? Math.min(revision, testedRevision) : testedRevisio n;
128 });
129 return revision;
130 }
131
132 model.latestRevisionByBuilder = function()
133 {
134 var revision = {};
135 Object.keys(model.state.resultsByBuilder).forEach(function(builderName) {
136 revision[builderName] = model.state.resultsByBuilder[builderName].blink_ revision;
137 });
138 return revision;
139 }
140
114 model.updateResultsByBuilder = function() 141 model.updateResultsByBuilder = function()
115 { 142 {
116 return results.fetchResultsByBuilder(Object.keys(config.builders)).then(func tion(resultsByBuilder) { 143 return results.fetchResultsByBuilder(Object.keys(config.builders)).then(func tion(resultsByBuilder) {
117 model.state.resultsByBuilder = resultsByBuilder; 144 model.state.resultsByBuilder = resultsByBuilder;
118 }); 145 });
119 }; 146 };
120 147
121 // failureCallback is called multiple times: once for each failure 148 // failureCallback is called multiple times: once for each failure
122 model.analyzeUnexpectedFailures = function(failureCallback) 149 model.analyzeUnexpectedFailures = function(failureCallback)
123 { 150 {
(...skipping 29 matching lines...) Expand all
153 180
154 model.state.failureAnalysisByTest[testName] = failureAnalysis; 181 model.state.failureAnalysisByTest[testName] = failureAnalysis;
155 182
156 failureCallback(failureAnalysis, failurePromises.length); 183 failureCallback(failureAnalysis, failurePromises.length);
157 })); 184 }));
158 }); 185 });
159 return Promise.all(failurePromises); 186 return Promise.all(failurePromises);
160 }; 187 };
161 188
162 })(); 189 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698