WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
147961
Refactor BuildbotQueueView._presentPopoverForPendingCommits to work more generically with repositories other than "openSource" and "internal".
https://bugs.webkit.org/show_bug.cgi?id=147961
Summary
Refactor BuildbotQueueView._presentPopoverForPendingCommits to work more gene...
Jason Marcell
Reported
2015-08-12 17:30:56 PDT
Refactor BuildbotQueueView._presentPopoverForPendingCommits to work more generically with repositories other than "openSource" and "internal".
Attachments
Patch
(3.85 KB, patch)
2015-08-12 17:34 PDT
,
Jason Marcell
no flags
Details
Formatted Diff
Diff
Patch
(3.88 KB, patch)
2015-08-13 16:01 PDT
,
Jason Marcell
no flags
Details
Formatted Diff
Diff
Patch
(3.82 KB, patch)
2015-08-14 14:47 PDT
,
Jason Marcell
no flags
Details
Formatted Diff
Diff
Patch
(3.73 KB, patch)
2015-08-17 10:33 PDT
,
Jason Marcell
no flags
Details
Formatted Diff
Diff
Show Obsolete
(3)
View All
Add attachment
proposed patch, testcase, etc.
Jason Marcell
Comment 1
2015-08-12 17:34:26 PDT
Created
attachment 258859
[details]
Patch
Daniel Bates
Comment 2
2015-08-13 14:24:19 PDT
Comment on
attachment 258859
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=258859&action=review
> Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotQueueView.js:172 > + if (shouldAddDivider) > + this._addDividerToPopover(content); > > - if (linesForOpenSource.length && linesForInternal.length) > - this._addDividerToPopover(content); > + for (var i = 0; i != lines.length; ++i) > + content.appendChild(lines[i]); >
This is not correct because we always add a divider regardless of whether there were popover lines.
Daniel Bates
Comment 3
2015-08-13 14:26:08 PDT
(In reply to
comment #2
)
> This is not correct because we always add a divider regardless of whether > there were popover lines.
I meant to write: This is not correct because we always add a divider regardless of whether there were popover lines when shouldAddDivider is true.
Jason Marcell
Comment 4
2015-08-13 14:36:58 PDT
I see. I think we want that to say: if (lines.length) shouldAddDivider = true; Right?
Jason Marcell
Comment 5
2015-08-13 16:01:46 PDT
Created
attachment 258946
[details]
Patch
Jason Marcell
Comment 6
2015-08-13 16:02:35 PDT
Comment on
attachment 258946
[details]
Patch Now checking lines.length before adding the divider.
Daniel Bates
Comment 7
2015-08-14 14:15:30 PDT
Comment on
attachment 258946
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=258946&action=review
> Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotQueueView.js:174 > + if (lines.length) > + shouldAddDivider = true;
This is not correct. Suppose there three repositories A, B, C and when processing these repositories (in this order) lines.length = 1, 0, 1, respectively. Then the output content will look like A_1, "divider", "divider", C_1.
Daniel Bates
Comment 8
2015-08-14 14:17:09 PDT
(In reply to
comment #7
)
> [...] > Then the output content will look like A_1, "divider", "divider", C_1.
I should add that we want the output content to look like: A_1, "divider", C_1
Jason Marcell
Comment 9
2015-08-14 14:47:43 PDT
Created
attachment 259046
[details]
Patch
Jason Marcell
Comment 10
2015-08-14 14:49:14 PDT
I reset the shouldAddDivider variable after adding a divider. I also moved the lines variable assignment closer to it's usage.
Daniel Bates
Comment 11
2015-08-14 18:03:36 PDT
Comment on
attachment 259046
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=259046&action=review
> Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotQueueView.js:177 > + var shouldAddDivider = false; > + var sortedRepositories = Dashboard.sortedRepositories; > + for (var i = 0; i < sortedRepositories.length; i++) { > + var repository = sortedRepositories[i]; > + var trac = repository.trac; > + var repositoryName = repository.name; > + var latestProductiveRevisionNumber = latestProductiveIteration.revision[repositoryName]; > + var lines = []; > + if (latestProductiveRevisionNumber && trac.latestRecordedRevisionNumber) { > + if (shouldAddDivider) { > + this._addDividerToPopover(content); > + shouldAddDivider = false; > + } > + > + lines = this._popoverLinesForCommitRange(trac, queue.branch[repositoryName], latestProductiveRevisionNumber + 1, trac.latestRecordedRevisionNumber); > + for (var i = 0; i != lines.length; ++i) > + content.appendChild(lines[i]); > + > + if (lines.length) > + shouldAddDivider = true; > + } > + }
This is not correct. Suppose there are three repositories A, B and when processing these repositories (in this order) lines.length = 1, 0, respectively. Then the output content will look like A_1, "divider". But it should be A_1. Maybe something like this will work: var shouldAddDivider = false; var sortedRepositories = Dashboard.sortedRepositories; for (var i = 0; i < sortedRepositories.length; ++i) { var repository = sortedRepositories[i]; var trac = repository.trac; var repositoryName = repository.name; var latestProductiveRevisionNumber = latestProductiveIteration.revision[repositoryName]; if (!latestProductiveRevisionNumber || !trac.latestRecordedRevisionNumber) continue; var lines = this._popoverLinesForCommitRange(trac, queue.branch[repositoryName], latestProductiveRevisionNumber + 1, trac.latestRecordedRevisionNumber); var length = lines.length; if (length && shouldAddDivider) this._addDividerToPopover(content); for (var i = 0; i < length; ++i) content.appendChild(lines[i]); shouldAddDivider = shouldAddDivider || length > 0; }
Jason Marcell
Comment 12
2015-08-17 10:33:25 PDT
Created
attachment 259161
[details]
Patch
Jason Marcell
Comment 13
2015-08-17 10:35:34 PDT
Comment on
attachment 259161
[details]
Patch Thanks, Dan. I looked over your suggested change over the weekend. It looks correct and also very concise.
WebKit Commit Bot
Comment 14
2015-08-17 12:45:18 PDT
Comment on
attachment 259161
[details]
Patch Clearing flags on attachment: 259161 Committed
r188533
: <
http://trac.webkit.org/changeset/188533
>
WebKit Commit Bot
Comment 15
2015-08-17 12:45:23 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug