Changeset 180504 in webkit
- Timestamp:
- Feb 23, 2015, 9:42:36 AM (10 years ago)
- 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 34 34 this.id = id; 35 35 36 this.branch = info.branch || null;36 this.branch = info.branch || { openSource: "trunk", internal: "trunk" }; 37 37 this.platform = info.platform.name || "unknown"; 38 38 this.debug = info.debug || false; -
trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotQueueView.js
r179650 r180504 88 88 89 89 var latestRecordedOpenSourceRevisionNumber = webkitTrac.latestRecordedRevisionNumber; 90 if (!latestRecordedOpenSourceRevisionNumber) 90 if (!latestRecordedOpenSourceRevisionNumber || webkitTrac.oldestRecordedRevisionNumber > latestProductiveIteration.openSourceRevision) { 91 webkitTrac.loadMoreHistoricalData(); 91 92 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; 96 98 97 99 if (latestProductiveIteration.internalRevision) { 98 100 var latestRecordedInternalRevisionNumber = internalTrac.latestRecordedRevisionNumber; 99 if (!latestRecordedInternalRevisionNumber) 101 if (!latestRecordedInternalRevisionNumber || internalTrac.oldestRecordedRevisionNumber > latestProductiveIteration.internalRevision) { 102 internalTrac.loadMoreHistoricalData(); 100 103 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; 105 107 } 106 108 … … 116 118 }, 117 119 118 _popoverLinesForCommitRange: function(trac, firstRevisionNumber, lastRevisionNumber)120 _popoverLinesForCommitRange: function(trac, branch, firstRevisionNumber, lastRevisionNumber) 119 121 { 120 122 function lineForCommit(trac, commit) … … 143 145 } 144 146 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(); 161 155 }, 162 156 … … 170 164 content.className = "commit-history-popover"; 171 165 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); 173 167 for (var i = 0; i != linesForOpenSource.length; ++i) 174 168 content.appendChild(linesForOpenSource[i]); … … 176 170 var linesForInternal = []; 177 171 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); 179 173 180 174 if (linesForOpenSource.length && linesForInternal.length) … … 196 190 content.className = "commit-history-popover"; 197 191 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); 199 194 if (!linesForCommits.length) 200 195 return false; … … 216 211 }, 217 212 218 _revision PopoverContentForIteration: function(iteration, previousIteration, internal)213 _revisionContentWithPopoverForIteration: function(iteration, previousIteration, internal) 219 214 { 220 215 var content = document.createElement("span"); … … 225 220 var context = { 226 221 trac: internal ? internalTrac : webkitTrac, 222 branch: internal ? iteration.queue.branch.internal : iteration.queue.branch.openSource, 227 223 firstRevision: (internal ? previousIteration.internalRevision : previousIteration.openSourceRevision) + 1, 228 224 lastRevision: internal ? iteration.internalRevision : iteration.openSourceRevision … … 273 269 console.assert(iteration.openSourceRevision); 274 270 275 var openSourceContent = this._revision PopoverContentForIteration(iteration, previousDisplayedIteration);271 var openSourceContent = this._revisionContentWithPopoverForIteration(iteration, previousDisplayedIteration); 276 272 277 273 if (!iteration.internalRevision) 278 274 return openSourceContent; 279 275 280 var internalContent = this._revision PopoverContentForIteration(iteration, previousDisplayedIteration, true);276 var internalContent = this._revisionContentWithPopoverForIteration(iteration, previousDisplayedIteration, true); 281 277 282 278 var fragment = document.createDocumentFragment(); -
trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Trac.js
r179235 r180504 50 50 __proto__: BaseObject.prototype, 51 51 52 get oldestRecordedRevisionNumber() 53 { 54 if (!this.recordedCommits.length) 55 return undefined; 56 return this.recordedCommits[0].revisionNumber; 57 }, 58 52 59 get latestRecordedRevisionNumber() 53 60 { … … 57 64 }, 58 65 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 59 73 revisionURL: function(revision) 60 74 { … … 64 78 _xmlTimelineURL: function(fromDate, toDate) 65 79 { 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 74 80 console.assert(fromDate <= toDate); 75 81 … … 145 151 ; // These changes are never relevant to the dashboard. 146 152 else { 153 // result.containsBranchLocation remains true, because this commit does 154 // not match any explicitly specified branches. 147 155 console.assert(false); 148 result.containsBranchLocation = false;149 156 } 150 157 } … … 196 203 }, 197 204 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 } : {}); 201 213 }, 202 214 203 215 startPeriodicUpdates: function() 204 216 { 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 }, 208 253 }; -
trunk/Tools/ChangeLog
r180480 r180504 1 2015-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 1 28 2015-02-21 Youenn Fablet <youenn.fablet@crf.canon.fr> 2 29
Note:
See TracChangeset
for help on using the changeset viewer.