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

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: Even better change! 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 | Tools/GardeningServer/scripts/ui_unittests.js » ('j') | 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 7907b37d682c271365fc66f49d025c065807528f..1cdb4a1ff2916cc174035602291caa91d735a8d6 100644
--- a/Tools/GardeningServer/scripts/ui.js
+++ b/Tools/GardeningServer/scripts/ui.js
@@ -351,10 +351,26 @@ ui.StatusArea = base.extends('div', {
});
ui.revisionDetails = base.extends('span', {
- updateUI: function() {
+ // We only support 2 levels of visual escalation levels: warning and critical.
+ warnRollRevisionSpanThreshold: 45,
+ criticalRollRevisionSpanThreshold: 80,
+ classNameForUrgencyLevel: function(rollRevisionSpan) {
+ if (rollRevisionSpan < this.criticalRollRevisionSpanThreshold)
+ return "warning";
+ return "critical";
+ },
+ updateUI: function(totRevision) {
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("span");
+ wrapper.className = this.classNameForUrgencyLevel(rollRevisionSpan);
+ 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;
@@ -424,7 +440,7 @@ ui.revisionDetails = base.extends('span', {
Promise.all([checkout.lastBlinkRollRevision(), rollbot.fetchCurrentRoll()]).then(function(results) {
theSpan.lastRolledRevision = results[0];
theSpan.roll = results[1];
- theSpan.updateUI();
+ theSpan.updateUI(totRevision);
});
}
});
« no previous file with comments | « no previous file | Tools/GardeningServer/scripts/ui_unittests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698