Changeset 161120 in webkit
- Timestamp:
- Dec 29, 2013, 9:24:57 AM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 4 added
- 9 edited
-
BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotBuilderQueueView.js (modified) (1 diff)
-
BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotQueueView.js (modified) (2 diffs)
-
BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Geometry.js (added)
-
BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Popover.js (added)
-
BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/PopoverTracker.js (added)
-
BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/StatusLineView.js (modified) (1 diff)
-
BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Trac.js (modified) (1 diff)
-
BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Utilities.js (modified) (2 diffs)
-
BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Styles/Popover.css (added)
-
BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Styles/QueueView.css (modified) (1 diff)
-
BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Styles/StatusLineView.css (modified) (1 diff)
-
BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/index.html (modified) (2 diffs)
-
ChangeLog (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotBuilderQueueView.js
r161090 r161120 61 61 function appendBuilderQueueStatus(queue) 62 62 { 63 this._appendPendingRevisionCount(queue) 63 this._appendPendingRevisionCount(queue); 64 64 65 65 var firstRecentFailedIteration = queue.firstRecentFailedIteration; -
trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotQueueView.js
r161099 r161120 61 61 __proto__: QueueView.prototype, 62 62 63 _ appendPendingRevisionCount: function(queue)63 _latestFinishedIteration: function(queue) 64 64 { 65 65 for (var i = 0; i < queue.iterations.length; ++i) { … … 67 67 if (!iteration.loaded || !iteration.finished) 68 68 continue; 69 70 var latestRecordedOpenSourceRevisionNumber = webkitTrac.latestRecordedRevisionNumber; 71 if (!latestRecordedOpenSourceRevisionNumber) 69 return iteration; 70 } 71 return null; 72 }, 73 74 _appendPendingRevisionCount: function(queue) 75 { 76 var latestFinishedIteration = this._latestFinishedIteration(queue); 77 if (!latestFinishedIteration) 78 return; 79 80 var latestRecordedOpenSourceRevisionNumber = webkitTrac.latestRecordedRevisionNumber; 81 if (!latestRecordedOpenSourceRevisionNumber) 82 return; 83 84 var openSourceRevisionsBehind = latestRecordedOpenSourceRevisionNumber - latestFinishedIteration.openSourceRevision; 85 if (openSourceRevisionsBehind < 0) 86 openSourceRevisionsBehind = 0; 87 88 if (latestFinishedIteration.internalRevision) { 89 var latestRecordedInternalRevisionNumber = internalTrac.latestRecordedRevisionNumber; 90 if (!latestRecordedInternalRevisionNumber) 72 91 return; 73 92 74 var openSourceRevisionsBehind = latestRecordedOpenSourceRevisionNumber - iteration.openSourceRevision; 75 if (openSourceRevisionsBehind < 0) 76 openSourceRevisionsBehind = 0; 77 78 if (iteration.internalRevision) { 79 var latestRecordedInternalRevisionNumber = internalTrac.latestRecordedRevisionNumber; 80 if (!latestRecordedInternalRevisionNumber) 81 return; 82 83 var internalRevisionsBehind = latestRecordedInternalRevisionNumber - iteration.internalRevision; 84 if (internalRevisionsBehind < 0) 85 internalRevisionsBehind = 0; 86 if (openSourceRevisionsBehind || internalRevisionsBehind) { 87 var message = openSourceRevisionsBehind + " \uff0b " + internalRevisionsBehind + " revisions behind"; 88 var status = new StatusLineView(message, StatusLineView.Status.NoBubble); 89 this.element.appendChild(status.element); 90 } 91 } else if (openSourceRevisionsBehind) { 92 var message = openSourceRevisionsBehind + " " + (openSourceRevisionsBehind === 1 ? "revision behind" : "revisions behind"); 93 var internalRevisionsBehind = latestRecordedInternalRevisionNumber - latestFinishedIteration.internalRevision; 94 if (internalRevisionsBehind < 0) 95 internalRevisionsBehind = 0; 96 if (openSourceRevisionsBehind || internalRevisionsBehind) { 97 var message = openSourceRevisionsBehind + " \uff0b " + internalRevisionsBehind + " revisions behind"; 93 98 var status = new StatusLineView(message, StatusLineView.Status.NoBubble); 94 99 this.element.appendChild(status.element); 95 100 } 96 97 return; 98 } 101 } else if (openSourceRevisionsBehind) { 102 var message = openSourceRevisionsBehind + " " + (openSourceRevisionsBehind === 1 ? "revision behind" : "revisions behind"); 103 var status = new StatusLineView(message, StatusLineView.Status.NoBubble); 104 this.element.appendChild(status.element); 105 } 106 107 if (status) 108 new PopoverTracker(status.messageElement, this, queue); 109 }, 110 111 presentPopoverForElement: function(element, popover, queue) 112 { 113 var latestFinishedIteration = this._latestFinishedIteration(queue); 114 if (!latestFinishedIteration) 115 return false; 116 117 function lineForCommit(trac, commit) 118 { 119 var result = document.createElement("div"); 120 result.className = "pending-commit"; 121 122 var linkElement = document.createElement("a"); 123 linkElement.className = "revision"; 124 linkElement.href = trac.revisionURL(commit.revisionNumber); 125 linkElement.target = "_blank"; 126 linkElement.textContent = "r" + commit.revisionNumber; 127 result.appendChild(linkElement); 128 129 var authorElement = document.createElement("span"); 130 authorElement.className = "author"; 131 authorElement.textContent = commit.author; 132 result.appendChild(authorElement); 133 134 var titleElement = document.createElement("span"); 135 titleElement.className = "title"; 136 titleElement.innerHTML = commit.title.innerHTML; 137 result.appendChild(titleElement); 138 139 return result; 140 } 141 142 var content = document.createElement("div"); 143 content.className = "pending-commits-popover"; 144 145 for (var i = webkitTrac.recordedCommits.length - 1; i >= 0; --i) { 146 var commit = webkitTrac.recordedCommits[i]; 147 if (commit.revisionNumber <= latestFinishedIteration.openSourceRevision) 148 break; 149 150 content.appendChild(lineForCommit(webkitTrac, commit)); 151 } 152 153 if (latestFinishedIteration.internalRevision && internalTrac.latestRecordedRevisionNumber) { 154 if (latestFinishedIteration.internalRevision < internalTrac.latestRecordedRevisionNumber && content.hasChildNodes()) { 155 var divider = document.createElement("div"); 156 divider.className = "divider"; 157 content.appendChild(divider); 158 } 159 160 for (var i = internalTrac.recordedCommits.length - 1; i >= 0; --i) { 161 var commit = internalTrac.recordedCommits[i]; 162 if (commit.revisionNumber <= latestFinishedIteration.internalRevision) 163 break; 164 165 content.appendChild(lineForCommit(internalTrac, commit)); 166 } 167 } 168 169 var rect = Dashboard.Rect.rectFromClientRect(element.getBoundingClientRect()); 170 popover.present(rect, content, [Dashboard.RectEdge.MIN_Y, Dashboard.RectEdge.MAX_Y, Dashboard.RectEdge.MAX_X, Dashboard.RectEdge.MIN_X]); 171 172 return true; 99 173 }, 100 174 -
trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/StatusLineView.js
r161092 r161120 161 161 this._messageElement.textContent = x; 162 162 } 163 }, 164 165 get messageElement() 166 { 167 return this._messageElement; 163 168 } 164 169 }; -
trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Trac.js
r161090 r161120 71 71 var revisionNumber = parseInt(/\d+$/.exec(link)) 72 72 73 var title = doc.evaluate("./title", commitElement, null, XPathResult.STRING_TYPE).stringValue; 74 title = title.replace(/^Changeset \[\d+\]: /, ""); 75 var author = doc.evaluate("./author", commitElement, null, XPathResult.STRING_TYPE).stringValue; 73 function tracNSResolver(prefix) 74 { 75 if (prefix == "dc") 76 return "http://purl.org/dc/elements/1.1/"; 77 return null; 78 } 79 80 var author = doc.evaluate("./author|dc:creator", commitElement, tracNSResolver, XPathResult.STRING_TYPE).stringValue; 76 81 var date = doc.evaluate("./pubDate", commitElement, null, XPathResult.STRING_TYPE).stringValue; 77 82 date = new Date(Date.parse(date)); 78 83 var description = doc.evaluate("./description", commitElement, null, XPathResult.STRING_TYPE).stringValue; 84 85 // The feed contains a <title>, but it's not parsed as well as what we are getting from description. 86 var parsedDescription = document.createElement("div"); 87 parsedDescription.innerHTML = description; 88 var title = document.createElement("div"); 89 var node = parsedDescription.firstChild.firstChild; 90 while (node && node.tagName != "BR") { 91 title.appendChild(node.cloneNode(true)); 92 node = node.nextSibling; 93 } 94 95 // For some reason, trac titles start with a newline. Delete it. 96 if (title.firstChild && title.firstChild.nodeType == Node.TEXT_NODE && title.firstChild.textContent.length > 0 && title.firstChild.textContent[0] == "\n") 97 title.firstChild.textContent = title.firstChild.textContent.substring(1); 79 98 80 99 return { -
trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Utilities.js
r161090 r161120 71 71 }; 72 72 73 Node.prototype.isAncestor = function(node) 74 { 75 if (!node) 76 return false; 77 78 var currentNode = node.parentNode; 79 while (currentNode) { 80 if (this === currentNode) 81 return true; 82 currentNode = currentNode.parentNode; 83 } 84 85 return false; 86 } 87 88 Node.prototype.isDescendant = function(descendant) 89 { 90 return !!descendant && descendant.isAncestor(this); 91 } 92 93 Node.prototype.isSelfOrAncestor = function(node) 94 { 95 return !!node && (node === this || this.isAncestor(node)); 96 } 97 98 Node.prototype.isSelfOrDescendant = function(node) 99 { 100 return !!node && (node === this || this.isDescendant(node)); 101 } 102 73 103 Element.prototype.removeChildren = function() 74 104 { … … 77 107 this.textContent = ""; 78 108 }; 109 110 DOMTokenList.prototype.contains = function(string) 111 { 112 for (var i = 0, end = this.length; i < end; ++i) { 113 if (this.item(i) === string) 114 return true; 115 } 116 return false; 117 } 79 118 80 119 Array.prototype.contains = function(value) -
trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Styles/QueueView.css
r161099 r161120 40 40 margin-top: 10px; 41 41 } 42 43 .pending-commits-popover > .pending-commit { 44 font-family: "HelveticaNeue-Light", "Helvetica Neue", sans-serif; 45 color: rgb(145, 135, 95); 46 font-size: 12px; 47 text-align: left; 48 padding: 1px 6px 1px 6px; 49 user-select: auto; 50 } 51 52 .pending-commits-popover > .pending-commit > .author { 53 padding-left: 5px; 54 padding-right: 5px; 55 } 56 57 .pending-commits-popover > .pending-commit > .title { 58 color: black; 59 } 60 61 .pending-commits-popover > .divider { 62 height: 7px; 63 } -
trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Styles/StatusLineView.css
r161092 r161120 110 110 } 111 111 112 .status-line.no-bubble .message { 113 display: inline-block; /* Fit block to content, so that popovers are positioned correctly. */ 114 } 115 112 116 .status-line.neutral .label, 113 117 .status-line.neutral .message, -
trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/index.html
r161099 r161120 29 29 30 30 <link rel="stylesheet" href="Styles/Main.css"></link> 31 <link rel="stylesheet" href="Styles/Popover.css"></link> 31 32 <link rel="stylesheet" href="Styles/QueueView.css"></link> 32 33 <link rel="stylesheet" href="Styles/StatusLineView.css"></link> … … 42 43 <script src="Scripts/BuildbotIteration.js"></script> 43 44 <script src="Scripts/BuildbotTestResults.js"></script> 45 <script src="Scripts/Geometry.js"></script> 46 <script src="Scripts/Popover.js"></script> 47 <script src="Scripts/PopoverTracker.js"></script> 44 48 <script src="Scripts/QueueView.js"></script> 45 49 <script src="Scripts/BuildbotQueueView.js"></script> -
trunk/Tools/ChangeLog
r161116 r161120 1 2013-12-29 Alexey Proskuryakov <ap@apple.com> 2 3 Please display information about pending runs in build.webkit.org/dashboard 4 https://bugs.webkit.org/show_bug.cgi?id=122180 5 6 Reviewed by Timothy Hatcher. 7 8 * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotBuilderQueueView.js: 9 (BuildbotBuilderQueueView.prototype.update.appendBuilderQueueStatus): Added a semicolon at the end of a line. 10 11 * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotQueueView.js: 12 (BuildbotQueueView.prototype._latestFinishedIteration): Factored out of _appendPendingRevisionCount. 13 (BuildbotQueueView.prototype._appendPendingRevisionCount): Install a popover tracker over the element. 14 (BuildbotQueueView.prototype.lineForCommit): Build an element for a particular commit ot be shown in popover. 15 (BuildbotQueueView.prototype.presentPopoverForElement): Build and show popover content when PopoverTracker 16 asks us to. 17 18 * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Geometry.js: Added. 19 Taken from WebInspector with minimal changes: 20 - Changed root name from WebInspector to Dashboard. 21 - Removed some unused functionality. 22 - Added Rect.containsPoint. 23 24 * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Popover.js: Added. 25 Popover has extensive changes compared to WebInspector version, only drawing code is the same: 26 - Fixed to work in scrollable pages - WebInspector version assumes that window 27 and document coordinates are the same, and also erroneously dismisses a scrollable 28 popover if scrolling cascades out of it after reaching a bound. 29 - Simplified API and implementation to Dashboard needs, it is no longer possible to 30 change content of an existing popover. 31 - Rewrote visibility tracking to be more complete, and not rely on external tracker 32 object so much. 33 - Added code to flash scroll bars when showing a scrollable popover. 34 35 * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/PopoverTracker.js: Added. 36 Objects of this class show and hide popovers as appropriate for registered active elements. 37 38 * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/StatusLineView.js: 39 (StatusLineView.prototype.get messageElement): Added an accessor, so that we could 40 install a popover on message element. It's the only visible element in pending commit 41 line, but the line has different bounds, so we can't install a popover on it (it 42 would be incorrectly positioned if we did). 43 44 * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Trac.js: 45 (Trac.prototype._convertCommitInfoElementToObject): 46 - Some trac installations report author in a different element, updated to support that. 47 - Changed to parse title out of description, because trac titles are ugly. Also, 48 we get a nice HTML with links from the description. 49 50 * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Utilities.js: 51 (Node.prototype.isAncestor): Copied from Web Inspector, only changing the form for 52 consistency with the rest of this file (add a property on prototype with assignment 53 instead of using Object.defineProperty). 54 (Node.prototype.isDescendant): Ditto. 55 (Node.prototype.isSelfOrAncestor): Ditto. 56 (Node.prototype.isSelfOrDescendant): Ditto. 57 (DOMTokenList.prototype.contains): Ditto. 58 59 * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Styles/Popover.css: Added. 60 Like JS counterpart, mostly lifted from Web Inspector. 61 62 * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Styles/QueueView.css: 63 Added style rules for pending commits popover. 64 65 * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Styles/StatusLineView.css: 66 (.status-line.no-bubble .message): Changed to display:inline-block, so that it fits 67 to content, and we can show the popover in a correct place. 68 69 * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/index.html: Added new files. 70 1 71 2013-12-27 Gavin Barraclough <barraclough@apple.com> 2 72
Note:
See TracChangeset
for help on using the changeset viewer.