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

Unified Diff: Tools/GardeningServer/scripts/ui.js

Issue 316033002: [GOM] Warn when the roll is running behind (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Tools/GardeningServer/scripts/ui.js
diff --git a/Tools/GardeningServer/scripts/ui.js b/Tools/GardeningServer/scripts/ui.js
index a10e422f1fea9b5bc5923511417954bd57459819..70b056349f68f20046b30b193af0aecc5e6ffbb6 100644
--- a/Tools/GardeningServer/scripts/ui.js
+++ b/Tools/GardeningServer/scripts/ui.js
@@ -351,13 +351,32 @@ ui.StatusArea = base.extends('div', {
});
ui.revisionDetails = base.extends('span', {
- updateUIIfDone: function() {
+ // We only support 2 levels of visual escalation levels: warning and critical.
+ warnRollRevisionSpanThreshold: 45,
+ criticalRollRevisionSpanThreshold: 70,
+ styleForUrgencyLevel: function(rollRevisionSpan) {
+ if (rollRevisionSpan < this.criticalRollRevisionSpanThreshold)
+ return { backgroundColor: "orange", fontSize: "2em" };
+ return { backgroundColor: "red", fontSize: "3em" };
ojan 2014/06/04 19:58:40 Nit: can we use the buildbot colors for consistenc
Julien - ping for review 2014/06/05 23:20:53 Good idea!
+ },
+ updateUIIfDone: function(totRevision) {
if (this.roll === undefined || this.lastRolledRevision === undefined)
return;
this.appendChild(document.createElement("br"));
this.appendChild(document.createTextNode('Last roll is to '));
this.appendChild(ui.createLinkNode(trac.changesetURL(this.lastRolledRevision), this.lastRolledRevision));
+ var rollRevisionSpan = totRevision - this.lastRolledRevision;
+ // Don't clutter the UI if we haven't run behind.
+ if (rollRevisionSpan > this.warnRollRevisionSpanThreshold) {
+ var wrapper = document.createElement("b");
+ wrapper.style.color = "white";
+ var wrapperStyle = this.styleForUrgencyLevel(rollRevisionSpan);
+ wrapper.style.backgroundColor = wrapperStyle.backgroundColor;
+ wrapper.style.fontSize = wrapperStyle.fontSize;
ojan 2014/06/04 19:58:40 Ditto on the using stylesheets thing.
Julien - ping for review 2014/06/05 23:20:53 Done.
+ wrapper.appendChild(document.createTextNode("(" + rollRevisionSpan + " revisions behind)"));
+ this.appendChild(wrapper);
+ }
this.appendChild(document.createTextNode(', current autoroll '));
if (this.roll) {
var linkText = "" + this.roll.fromRevision + ":" + this.roll.toRevision;
@@ -426,12 +445,12 @@ ui.revisionDetails = base.extends('span', {
checkout.lastBlinkRollRevision().then(function(revision) {
theSpan.lastRolledRevision = revision;
- theSpan.updateUIIfDone();
+ theSpan.updateUIIfDone(totRevision);
}, function() {});
rollbot.fetchCurrentRoll().then(function(roll) {
theSpan.roll = roll;
- theSpan.updateUIIfDone();
+ theSpan.updateUIIfDone(totRevision);
});
}
});
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698