Changeset 180504 in webkit


Ignore:
Timestamp:
Feb 23, 2015, 9:42:36 AM (10 years ago)
Author:
ap@apple.com
Message:

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.

Location:
trunk/Tools
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotQueue.js

    r179650 r180504  
    3434    this.id = id;
    3535
    36     this.branch = info.branch || null;
     36    this.branch = info.branch || { openSource: "trunk", internal: "trunk" };
    3737    this.platform = info.platform.name || "unknown";
    3838    this.debug = info.debug || false;
  • trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotQueueView.js

    r179650 r180504  
    8888
    8989        var latestRecordedOpenSourceRevisionNumber = webkitTrac.latestRecordedRevisionNumber;
    90         if (!latestRecordedOpenSourceRevisionNumber)
     90        if (!latestRecordedOpenSourceRevisionNumber || webkitTrac.oldestRecordedRevisionNumber > latestProductiveIteration.openSourceRevision) {
     91            webkitTrac.loadMoreHistoricalData();
    9192            return;
    92 
    93         var totalRevisionsBehind = latestRecordedOpenSourceRevisionNumber - latestProductiveIteration.openSourceRevision;
    94         if (totalRevisionsBehind < 0)
    95             totalRevisionsBehind = 0;
     93        }
     94
     95        // FIXME: To be 100% correct, we should also filter out changes that are ignored by
     96        // the queue, see _should_file_trigger_build in wkbuild.py.
     97        var totalRevisionsBehind = webkitTrac.commitsOnBranch(queue.branch.openSource, function(commit) { return commit.revisionNumber > latestProductiveIteration.openSourceRevision; }).length;
    9698
    9799        if (latestProductiveIteration.internalRevision) {
    98100            var latestRecordedInternalRevisionNumber = internalTrac.latestRecordedRevisionNumber;
    99             if (!latestRecordedInternalRevisionNumber)
     101            if (!latestRecordedInternalRevisionNumber || internalTrac.oldestRecordedRevisionNumber > latestProductiveIteration.internalRevision) {
     102                internalTrac.loadMoreHistoricalData();
    100103                return;
    101 
    102             var internalRevisionsBehind = latestRecordedInternalRevisionNumber - latestProductiveIteration.internalRevision;
    103             if (internalRevisionsBehind > 0)
    104                 totalRevisionsBehind += internalRevisionsBehind;
     104            }
     105
     106            totalRevisionsBehind += internalTrac.commitsOnBranch(queue.branch.internal, function(commit) { return commit.revisionNumber > latestProductiveIteration.internalRevision; }).length;
    105107        }
    106108
     
    116118    },
    117119
    118     _popoverLinesForCommitRange: function(trac, firstRevisionNumber, lastRevisionNumber)
     120    _popoverLinesForCommitRange: function(trac, branch, firstRevisionNumber, lastRevisionNumber)
    119121    {
    120122        function lineForCommit(trac, commit)
     
    143145        }
    144146
    145         // This function only adds lines about commits that the trac object knows about.
    146         // Alternatively, it could add links without info and/or trigger loading additional
    147         // data, but this probably doesn't matter for Dashboard use.
    148         var result = [];
    149         for (var i = trac.recordedCommits.length - 1; i >= 0; --i) {
    150             var commit = trac.recordedCommits[i];
    151             if (commit.revisionNumber > lastRevisionNumber)
    152                 continue;
    153 
    154             if (commit.revisionNumber < firstRevisionNumber)
    155                 break;
    156 
    157             result.push(lineForCommit(trac, commit));
    158         }
    159 
    160         return result;
     147        console.assert(trac.oldestRecordedRevisionNumber >= firstRevisionNumber);
     148
     149        // FIXME: To be 100% correct, we should also filter out changes that are ignored by
     150        // the queue, see _should_file_trigger_build in wkbuild.py.
     151        var commits = trac.commitsOnBranch(branch, function(commit) { return commit.revisionNumber >= firstRevisionNumber && commit.revisionNumber <= lastRevisionNumber; });
     152        return commits.map(function(commit) {
     153            return lineForCommit(trac, commit);
     154        }, this).reverse();
    161155    },
    162156
     
    170164        content.className = "commit-history-popover";
    171165
    172         var linesForOpenSource = this._popoverLinesForCommitRange(webkitTrac, latestProductiveIteration.openSourceRevision + 1, webkitTrac.latestRecordedRevisionNumber);
     166        var linesForOpenSource = this._popoverLinesForCommitRange(webkitTrac, queue.branch.openSource, latestProductiveIteration.openSourceRevision + 1, webkitTrac.latestRecordedRevisionNumber);
    173167        for (var i = 0; i != linesForOpenSource.length; ++i)
    174168            content.appendChild(linesForOpenSource[i]);
     
    176170        var linesForInternal = [];
    177171        if (latestProductiveIteration.internalRevision && internalTrac.latestRecordedRevisionNumber)
    178             var linesForInternal = this._popoverLinesForCommitRange(internalTrac, latestProductiveIteration.internalRevision + 1, internalTrac.latestRecordedRevisionNumber);
     172            var linesForInternal = this._popoverLinesForCommitRange(internalTrac, queue.branch.internal, latestProductiveIteration.internalRevision + 1, internalTrac.latestRecordedRevisionNumber);
    179173
    180174        if (linesForOpenSource.length && linesForInternal.length)
     
    196190        content.className = "commit-history-popover";
    197191
    198         var linesForCommits = this._popoverLinesForCommitRange(context.trac, context.firstRevision, context.lastRevision);
     192        // FIXME: Nothing guarantees that Trac has historical data for these revisions.
     193        var linesForCommits = this._popoverLinesForCommitRange(context.trac, context.branch, context.firstRevision, context.lastRevision);
    199194        if (!linesForCommits.length)
    200195            return false;
     
    216211    },
    217212
    218     _revisionPopoverContentForIteration: function(iteration, previousIteration, internal)
     213    _revisionContentWithPopoverForIteration: function(iteration, previousIteration, internal)
    219214    {
    220215        var content = document.createElement("span");
     
    225220            var context = {
    226221                trac: internal ? internalTrac : webkitTrac,
     222                branch: internal ? iteration.queue.branch.internal : iteration.queue.branch.openSource,
    227223                firstRevision: (internal ? previousIteration.internalRevision : previousIteration.openSourceRevision) + 1,
    228224                lastRevision: internal ? iteration.internalRevision : iteration.openSourceRevision
     
    273269        console.assert(iteration.openSourceRevision);
    274270
    275         var openSourceContent = this._revisionPopoverContentForIteration(iteration, previousDisplayedIteration);
     271        var openSourceContent = this._revisionContentWithPopoverForIteration(iteration, previousDisplayedIteration);
    276272
    277273        if (!iteration.internalRevision)
    278274            return openSourceContent;
    279275
    280         var internalContent = this._revisionPopoverContentForIteration(iteration, previousDisplayedIteration, true);
     276        var internalContent = this._revisionContentWithPopoverForIteration(iteration, previousDisplayedIteration, true);
    281277
    282278        var fragment = document.createDocumentFragment();
  • trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Trac.js

    r179235 r180504  
    5050    __proto__: BaseObject.prototype,
    5151
     52    get oldestRecordedRevisionNumber()
     53    {
     54        if (!this.recordedCommits.length)
     55            return undefined;
     56        return this.recordedCommits[0].revisionNumber;
     57    },
     58
    5259    get latestRecordedRevisionNumber()
    5360    {
     
    5764    },
    5865
     66    commitsOnBranch: function(branch, filter)
     67    {
     68        return this.recordedCommits.filter(function(commit) {
     69            return (!commit.containsBranchLocation || commit.branch === branch) && filter(commit);
     70        });
     71    },
     72
    5973    revisionURL: function(revision)
    6074    {
     
    6478    _xmlTimelineURL: function(fromDate, toDate)
    6579    {
    66         if (typeof fromDate === "undefined") {
    67             fromDate = new Date();
    68             toDate = new Date(fromDate);
    69             // By default, get at least one full day of changesets, as the current day may have only begun.
    70             fromDate.setDate(fromDate.getDate() - 1);
    71         } else if (typeof toDate === "undefined")
    72             toDate = fromDate;
    73 
    7480        console.assert(fromDate <= toDate);
    7581
     
    145151                ; // These changes are never relevant to the dashboard.
    146152            else {
     153                // result.containsBranchLocation remains true, because this commit does
     154                // not match any explicitly specified branches.
    147155                console.assert(false);
    148                 result.containsBranchLocation = false;
    149156            }
    150157        }
     
    196203    },
    197204
    198     update: function()
    199     {
    200         loadXML(this._xmlTimelineURL(), this._loaded.bind(this), this._needsAuthentication ? { withCredentials: true } : {});
     205    _update: function()
     206    {
     207        var fromDate = new Date(this._latestLoadedDate);
     208        var toDate = new Date();
     209
     210        this._latestLoadedDate = toDate;
     211
     212        loadXML(this._xmlTimelineURL(fromDate, toDate), this._loaded.bind(this), this._needsAuthentication ? { withCredentials: true } : {});
    201213    },
    202214
    203215    startPeriodicUpdates: function()
    204216    {
    205         this.update();
    206         this.updateTimer = setInterval(this.update.bind(this), Trac.UpdateInterval);
    207     }
     217        console.assert(!this._oldestHistoricalDate);
     218
     219        var today = new Date();
     220
     221        this._oldestHistoricalDate = today;
     222        this._latestLoadedDate = today;
     223
     224        this._loadingHistoricalData = true;
     225        loadXML(this._xmlTimelineURL(today, today), function(dataDocument) {
     226            this._loadingHistoricalData = false;
     227            this._loaded(dataDocument);
     228        }.bind(this), this._needsAuthentication ? { withCredentials: true } : {});
     229
     230        this.updateTimer = setInterval(this._update.bind(this), Trac.UpdateInterval);
     231    },
     232
     233    loadMoreHistoricalData: function()
     234    {
     235        console.assert(this._oldestHistoricalDate);
     236
     237        if (this._loadingHistoricalData)
     238            return;
     239
     240        // Load one more day of historical data.
     241        var fromDate = new Date(this._oldestHistoricalDate);
     242        fromDate.setDate(fromDate.getDate() - 1);
     243        var toDate = new Date(fromDate);
     244
     245        this._oldestHistoricalDate = fromDate;
     246
     247        this._loadingHistoricalData = true;
     248        loadXML(this._xmlTimelineURL(fromDate, toDate), function(dataDocument) {
     249            this._loadingHistoricalData = false;
     250            this._loaded(dataDocument);
     251        }.bind(this), this._needsAuthentication ? { withCredentials: true } : {});
     252    },
    208253};
  • trunk/Tools/ChangeLog

    r180480 r180504  
     12015-02-23  Alexey Proskuryakov  <ap@apple.com>
     2
     3        build.webkit.org/dashboard should filter out commits to other branches
     4        https://bugs.webkit.org/show_bug.cgi?id=140362
     5
     6        Reviewed by Tim Horton.
     7
     8        * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotQueue.js:
     9        (BuildbotQueue):
     10        * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotQueueView.js:
     11        (BuildbotQueueView.prototype._presentPopoverForPendingCommits):
     12        (BuildbotQueueView.prototype._presentPopoverForRevisionRange):
     13        (BuildbotQueueView.prototype._revisionContentWithPopoverForIteration):
     14        (BuildbotQueueView.prototype.revisionContentForIteration):
     15        (BuildbotQueueView.prototype._appendPendingRevisionCount): Deleted.
     16        (BuildbotQueueView.prototype._popoverLinesForCommitRange): Deleted.
     17        (BuildbotQueueView.prototype._revisionPopoverContentForIteration): Deleted.
     18        * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Trac.js:
     19        (Trac.prototype.get oldestRecordedRevisionNumber):
     20        (Trac.prototype.commitsOnBranch):
     21        (Trac.prototype._xmlTimelineURL):
     22        (Trac.prototype._convertCommitInfoElementToObject):
     23        (Trac.prototype._update):
     24        (Trac.prototype.startPeriodicUpdates):
     25        (Trac.prototype.loadMoreHistoricalData):
     26        (Trac.prototype.update): Deleted.
     27
    1282015-02-21  Youenn Fablet  <youenn.fablet@crf.canon.fr>
    229
Note: See TracChangeset for help on using the changeset viewer.