return;
var latestRecordedOpenSourceRevisionNumber = webkitTrac.latestRecordedRevisionNumber;
- if (!latestRecordedOpenSourceRevisionNumber)
+ if (!latestRecordedOpenSourceRevisionNumber || webkitTrac.oldestRecordedRevisionNumber > latestProductiveIteration.openSourceRevision) {
+ webkitTrac.loadMoreHistoricalData();
return;
+ }
- var totalRevisionsBehind = latestRecordedOpenSourceRevisionNumber - latestProductiveIteration.openSourceRevision;
- if (totalRevisionsBehind < 0)
- totalRevisionsBehind = 0;
+ // FIXME: To be 100% correct, we should also filter out changes that are ignored by
+ // the queue, see _should_file_trigger_build in wkbuild.py.
+ var totalRevisionsBehind = webkitTrac.commitsOnBranch(queue.branch.openSource, function(commit) { return commit.revisionNumber > latestProductiveIteration.openSourceRevision; }).length;
if (latestProductiveIteration.internalRevision) {
var latestRecordedInternalRevisionNumber = internalTrac.latestRecordedRevisionNumber;
- if (!latestRecordedInternalRevisionNumber)
+ if (!latestRecordedInternalRevisionNumber || internalTrac.oldestRecordedRevisionNumber > latestProductiveIteration.internalRevision) {
+ internalTrac.loadMoreHistoricalData();
return;
+ }
- var internalRevisionsBehind = latestRecordedInternalRevisionNumber - latestProductiveIteration.internalRevision;
- if (internalRevisionsBehind > 0)
- totalRevisionsBehind += internalRevisionsBehind;
+ totalRevisionsBehind += internalTrac.commitsOnBranch(queue.branch.internal, function(commit) { return commit.revisionNumber > latestProductiveIteration.internalRevision; }).length;
}
if (!totalRevisionsBehind)
new PopoverTracker(messageElement, this._presentPopoverForPendingCommits.bind(this), queue);
},
- _popoverLinesForCommitRange: function(trac, firstRevisionNumber, lastRevisionNumber)
+ _popoverLinesForCommitRange: function(trac, branch, firstRevisionNumber, lastRevisionNumber)
{
function lineForCommit(trac, commit)
{
return result;
}
- // This function only adds lines about commits that the trac object knows about.
- // Alternatively, it could add links without info and/or trigger loading additional
- // data, but this probably doesn't matter for Dashboard use.
- var result = [];
- for (var i = trac.recordedCommits.length - 1; i >= 0; --i) {
- var commit = trac.recordedCommits[i];
- if (commit.revisionNumber > lastRevisionNumber)
- continue;
-
- if (commit.revisionNumber < firstRevisionNumber)
- break;
-
- result.push(lineForCommit(trac, commit));
- }
+ console.assert(trac.oldestRecordedRevisionNumber >= firstRevisionNumber);
- return result;
+ // FIXME: To be 100% correct, we should also filter out changes that are ignored by
+ // the queue, see _should_file_trigger_build in wkbuild.py.
+ var commits = trac.commitsOnBranch(branch, function(commit) { return commit.revisionNumber >= firstRevisionNumber && commit.revisionNumber <= lastRevisionNumber; });
+ return commits.map(function(commit) {
+ return lineForCommit(trac, commit);
+ }, this).reverse();
},
_presentPopoverForPendingCommits: function(element, popover, queue)
var content = document.createElement("div");
content.className = "commit-history-popover";
- var linesForOpenSource = this._popoverLinesForCommitRange(webkitTrac, latestProductiveIteration.openSourceRevision + 1, webkitTrac.latestRecordedRevisionNumber);
+ var linesForOpenSource = this._popoverLinesForCommitRange(webkitTrac, queue.branch.openSource, latestProductiveIteration.openSourceRevision + 1, webkitTrac.latestRecordedRevisionNumber);
for (var i = 0; i != linesForOpenSource.length; ++i)
content.appendChild(linesForOpenSource[i]);
var linesForInternal = [];
if (latestProductiveIteration.internalRevision && internalTrac.latestRecordedRevisionNumber)
- var linesForInternal = this._popoverLinesForCommitRange(internalTrac, latestProductiveIteration.internalRevision + 1, internalTrac.latestRecordedRevisionNumber);
+ var linesForInternal = this._popoverLinesForCommitRange(internalTrac, queue.branch.internal, latestProductiveIteration.internalRevision + 1, internalTrac.latestRecordedRevisionNumber);
if (linesForOpenSource.length && linesForInternal.length)
this._addDividerToPopover(content);
var content = document.createElement("div");
content.className = "commit-history-popover";
- var linesForCommits = this._popoverLinesForCommitRange(context.trac, context.firstRevision, context.lastRevision);
+ // FIXME: Nothing guarantees that Trac has historical data for these revisions.
+ var linesForCommits = this._popoverLinesForCommitRange(context.trac, context.branch, context.firstRevision, context.lastRevision);
if (!linesForCommits.length)
return false;
return true;
},
- _revisionPopoverContentForIteration: function(iteration, previousIteration, internal)
+ _revisionContentWithPopoverForIteration: function(iteration, previousIteration, internal)
{
var content = document.createElement("span");
content.textContent = "r" + (internal ? iteration.internalRevision : iteration.openSourceRevision);
if (previousIteration) {
var context = {
trac: internal ? internalTrac : webkitTrac,
+ branch: internal ? iteration.queue.branch.internal : iteration.queue.branch.openSource,
firstRevision: (internal ? previousIteration.internalRevision : previousIteration.openSourceRevision) + 1,
lastRevision: internal ? iteration.internalRevision : iteration.openSourceRevision
};
{
console.assert(iteration.openSourceRevision);
- var openSourceContent = this._revisionPopoverContentForIteration(iteration, previousDisplayedIteration);
+ var openSourceContent = this._revisionContentWithPopoverForIteration(iteration, previousDisplayedIteration);
if (!iteration.internalRevision)
return openSourceContent;
- var internalContent = this._revisionPopoverContentForIteration(iteration, previousDisplayedIteration, true);
+ var internalContent = this._revisionContentWithPopoverForIteration(iteration, previousDisplayedIteration, true);
var fragment = document.createDocumentFragment();
fragment.appendChild(openSourceContent);
constructor: Trac,
__proto__: BaseObject.prototype,
+ get oldestRecordedRevisionNumber()
+ {
+ if (!this.recordedCommits.length)
+ return undefined;
+ return this.recordedCommits[0].revisionNumber;
+ },
+
get latestRecordedRevisionNumber()
{
if (!this.recordedCommits.length)
return this.recordedCommits[this.recordedCommits.length - 1].revisionNumber;
},
+ commitsOnBranch: function(branch, filter)
+ {
+ return this.recordedCommits.filter(function(commit) {
+ return (!commit.containsBranchLocation || commit.branch === branch) && filter(commit);
+ });
+ },
+
revisionURL: function(revision)
{
return this.baseURL + "changeset/" + encodeURIComponent(revision);
_xmlTimelineURL: function(fromDate, toDate)
{
- if (typeof fromDate === "undefined") {
- fromDate = new Date();
- toDate = new Date(fromDate);
- // By default, get at least one full day of changesets, as the current day may have only begun.
- fromDate.setDate(fromDate.getDate() - 1);
- } else if (typeof toDate === "undefined")
- toDate = fromDate;
-
console.assert(fromDate <= toDate);
var fromDay = new Date(fromDate.getFullYear(), fromDate.getMonth(), fromDate.getDate());
else if (location.startsWith("submissions/"))
; // These changes are never relevant to the dashboard.
else {
+ // result.containsBranchLocation remains true, because this commit does
+ // not match any explicitly specified branches.
console.assert(false);
- result.containsBranchLocation = false;
}
}
}.bind(this), this._needsAuthentication ? { withCredentials: true } : {});
},
- update: function()
+ _update: function()
{
- loadXML(this._xmlTimelineURL(), this._loaded.bind(this), this._needsAuthentication ? { withCredentials: true } : {});
+ var fromDate = new Date(this._latestLoadedDate);
+ var toDate = new Date();
+
+ this._latestLoadedDate = toDate;
+
+ loadXML(this._xmlTimelineURL(fromDate, toDate), this._loaded.bind(this), this._needsAuthentication ? { withCredentials: true } : {});
},
startPeriodicUpdates: function()
{
- this.update();
- this.updateTimer = setInterval(this.update.bind(this), Trac.UpdateInterval);
- }
+ console.assert(!this._oldestHistoricalDate);
+
+ var today = new Date();
+
+ this._oldestHistoricalDate = today;
+ this._latestLoadedDate = today;
+
+ this._loadingHistoricalData = true;
+ loadXML(this._xmlTimelineURL(today, today), function(dataDocument) {
+ this._loadingHistoricalData = false;
+ this._loaded(dataDocument);
+ }.bind(this), this._needsAuthentication ? { withCredentials: true } : {});
+
+ this.updateTimer = setInterval(this._update.bind(this), Trac.UpdateInterval);
+ },
+
+ loadMoreHistoricalData: function()
+ {
+ console.assert(this._oldestHistoricalDate);
+
+ if (this._loadingHistoricalData)
+ return;
+
+ // Load one more day of historical data.
+ var fromDate = new Date(this._oldestHistoricalDate);
+ fromDate.setDate(fromDate.getDate() - 1);
+ var toDate = new Date(fromDate);
+
+ this._oldestHistoricalDate = fromDate;
+
+ this._loadingHistoricalData = true;
+ loadXML(this._xmlTimelineURL(fromDate, toDate), function(dataDocument) {
+ this._loadingHistoricalData = false;
+ this._loaded(dataDocument);
+ }.bind(this), this._needsAuthentication ? { withCredentials: true } : {});
+ },
};
+2015-02-23 Alexey Proskuryakov <ap@apple.com>
+
+ build.webkit.org/dashboard should filter out commits to other branches
+ https://bugs.webkit.org/show_bug.cgi?id=140362
+
+ Reviewed by Tim Horton.
+
+ * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotQueue.js:
+ (BuildbotQueue):
+ * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotQueueView.js:
+ (BuildbotQueueView.prototype._presentPopoverForPendingCommits):
+ (BuildbotQueueView.prototype._presentPopoverForRevisionRange):
+ (BuildbotQueueView.prototype._revisionContentWithPopoverForIteration):
+ (BuildbotQueueView.prototype.revisionContentForIteration):
+ (BuildbotQueueView.prototype._appendPendingRevisionCount): Deleted.
+ (BuildbotQueueView.prototype._popoverLinesForCommitRange): Deleted.
+ (BuildbotQueueView.prototype._revisionPopoverContentForIteration): Deleted.
+ * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Trac.js:
+ (Trac.prototype.get oldestRecordedRevisionNumber):
+ (Trac.prototype.commitsOnBranch):
+ (Trac.prototype._xmlTimelineURL):
+ (Trac.prototype._convertCommitInfoElementToObject):
+ (Trac.prototype._update):
+ (Trac.prototype.startPeriodicUpdates):
+ (Trac.prototype.loadMoreHistoricalData):
+ (Trac.prototype.update): Deleted.
+
2015-02-21 Youenn Fablet <youenn.fablet@crf.canon.fr>
Tests don't work on some bots: Failed to stop wptwk