[GOM] Improve the display of the roll information

The current UI was racy and would output the last roll
and current roll in random order. This change fixes this
and puts the roll information to a new line, so that it
stands out from the bot information.

Review URL: https://codereview.chromium.org/314913002

git-svn-id: svn://svn.chromium.org/blink/trunk@175525 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 122f1562
...@@ -351,6 +351,20 @@ ui.StatusArea = base.extends('div', { ...@@ -351,6 +351,20 @@ ui.StatusArea = base.extends('div', {
}); });
ui.revisionDetails = base.extends('span', { ui.revisionDetails = base.extends('span', {
updateUI: function() {
this.appendChild(document.createElement("br"));
this.appendChild(document.createTextNode('Last roll is to '));
this.appendChild(ui.createLinkNode(trac.changesetURL(this.lastRolledRevision), this.lastRolledRevision));
this.appendChild(document.createTextNode(', current autoroll '));
if (this.roll) {
var linkText = "" + this.roll.fromRevision + ":" + this.roll.toRevision;
this.appendChild(ui.createLinkNode(this.roll.url, linkText));
if (this.roll.isStopped)
this.appendChild(document.createTextNode(' (STOPPED) '));
} else {
this.appendChild(document.createTextNode(' None'));
}
},
init: function() { init: function() {
var theSpan = this; var theSpan = this;
theSpan.appendChild(document.createTextNode('Latest revision processed by every bot: ')); theSpan.appendChild(document.createTextNode('Latest revision processed by every bot: '));
...@@ -407,21 +421,10 @@ ui.revisionDetails = base.extends('span', { ...@@ -407,21 +421,10 @@ ui.revisionDetails = base.extends('span', {
theSpan.appendChild(document.createTextNode(', trunk is at ')); theSpan.appendChild(document.createTextNode(', trunk is at '));
theSpan.appendChild(ui.createLinkNode(trac.changesetURL(totRevision), totRevision)); theSpan.appendChild(ui.createLinkNode(trac.changesetURL(totRevision), totRevision));
checkout.lastBlinkRollRevision().then(function(revision) { Promise.all([checkout.lastBlinkRollRevision(), rollbot.fetchCurrentRoll()]).then(function(results) {
theSpan.appendChild(document.createTextNode(', last roll is to ')); theSpan.lastRolledRevision = results[0];
theSpan.appendChild(ui.createLinkNode(trac.changesetURL(revision), revision)); theSpan.roll = results[1];
}, function() {}); theSpan.updateUI();
rollbot.fetchCurrentRoll().then(function(roll) {
theSpan.appendChild(document.createTextNode(', current autoroll '));
if (roll) {
var linkText = "" + roll.fromRevision + ":" + roll.toRevision;
theSpan.appendChild(ui.createLinkNode(roll.url, linkText));
if (roll.isStopped)
theSpan.appendChild(document.createTextNode(' (STOPPED) '));
} else {
theSpan.appendChild(document.createTextNode(' None'));
}
}); });
} }
}); });
......
...@@ -223,5 +223,64 @@ asyncTest("TreeStatus", 2, function() { ...@@ -223,5 +223,64 @@ asyncTest("TreeStatus", 2, function() {
}); });
}); });
var currentRoll = {
"results": [
{"messages":[], "base_url":"svn://svn.chromium.org/chrome/trunk/src", "subject":"Blink roll 540:550", "closed":false, "issue":1000}
]
};
asyncTest("RevisionDetails", 2, function() {
var simulator = new NetworkSimulator();
simulator.json = function(url)
{
return Promise.resolve(currentRoll);
}
simulator.get = function (url)
{
return Promise.resolve("540");
}
model.state.resultsByBuilder = {
"Linux": {
"blink_revision": "554",
}
};
model.state.recentCommits = [
{
"revision": "555",
}];
var revisionDetails;
simulator.runTest(function() {
revisionDetails = ui.revisionDetails();
}).then(function() {
equal(revisionDetails.innerHTML,
'Latest revision processed by every bot: ' +
'<details>' +
'<summary>' +
'<a href="http://src.chromium.org/viewvc/blink?view=rev&amp;revision=554">554' +
'<span id="revisionPopUp">' +
'<table>' +
'<tr>' +
'<td><a href="http://build.chromium.org/p/chromium.webkit/waterfall?builder=Linux">Linux</a></td>' +
'<td>554</td>' +
'</tr>' +
'</table>' +
'</span>' +
'</a>' +
'</summary>' +
'<table>' +
'<tr>' +
'<td><a href="http://build.chromium.org/p/chromium.webkit/waterfall?builder=Linux">Linux</a></td>' +
'<td>554</td>' +
'</tr>' +
'</table>' +
'</details>' +
', trunk is at <a href="http://src.chromium.org/viewvc/blink?view=rev&amp;revision=555">555</a>' +
'<br>' +
'Last roll is to <a href="http://src.chromium.org/viewvc/blink?view=rev&amp;revision=540">540</a>, current autoroll <a href="https://codereview.chromium.org/1000">540:550</a>');
start();
});
});
})(); })();
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment