Title: [188359] trunk/Tools
Revision
188359
Author
[email protected]
Date
2015-08-12 14:10:25 -0700 (Wed, 12 Aug 2015)

Log Message

Refactor BuildbotQueueView.revisionContentForIteration to work more generically with repositories
other than "openSource" and "internal".
https://bugs.webkit.org/show_bug.cgi?id=147796

Patch by Jason Marcell <[email protected]> on 2015-08-12
Reviewed by Daniel Bates.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotQueueView.js:
(BuildbotQueueView.prototype._revisionContentWithPopoverForIteration): The "repository" parameter
is now a repository object instead of the repository name, thus we don't have to pass the "trac"
object in separately. Also added an assertion to see if the given repository is in iteration.revision,
and another assertion that, if the previousIteration is non-null, the given repository is in
previousIteration.revision.
(BuildbotQueueView.prototype.revisionContentForIteration): Refactored to work more generically
with repositories other than "openSource" and "internal". Also added an assertion that the returned
fragment has at least one child node.

Modified Paths

Diff

Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotQueueView.js (188358 => 188359)


--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotQueueView.js	2015-08-12 21:07:49 UTC (rev 188358)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotQueueView.js	2015-08-12 21:10:25 UTC (rev 188359)
@@ -208,18 +208,21 @@
         return true;
     },
 
-    _revisionContentWithPopoverForIteration: function(iteration, previousIteration, repository, trac)
+    _revisionContentWithPopoverForIteration: function(iteration, previousIteration, repository)
     {
+        var repositoryName = repository.name;
+        console.assert(iteration.revision[repositoryName]);
         var content = document.createElement("span");
-        content.textContent = "r" + iteration.revision[repository];
+        content.textContent = "r" + iteration.revision[repositoryName];
         content.classList.add("revision-number");
 
         if (previousIteration) {
+            console.assert(previousIteration.revision[repositoryName]);
             var context = {
-                trac: trac,
-                branch: iteration.queue.branch[repository],
-                firstRevision: previousIteration.revision[repository] + 1,
-                lastRevision: iteration.revision[repository]
+                trac: repository.trac,
+                branch: iteration.queue.branch[repositoryName],
+                firstRevision: previousIteration.revision[repositoryName] + 1,
+                lastRevision: iteration.revision[repositoryName]
             };
             if (context.firstRevision <= context.lastRevision)
                 new PopoverTracker(content, this._presentPopoverForRevisionRange.bind(this), context);
@@ -264,21 +267,20 @@
 
     revisionContentForIteration: function(iteration, previousDisplayedIteration)
     {
-        console.assert(iteration.revision[Dashboard.Repository.OpenSource.name]);
-
-        var openSourceContent = this._revisionContentWithPopoverForIteration(iteration, previousDisplayedIteration,
-            Dashboard.Repository.OpenSource.name, Dashboard.Repository.OpenSource.trac);
-
-        if (!iteration.revision[Dashboard.Repository.Internal.name])
-            return openSourceContent;
-
-        var internalContent = this._revisionContentWithPopoverForIteration(iteration, previousDisplayedIteration,
-            Dashboard.Repository.Internal.name, Dashboard.Repository.Internal.trac);
-
         var fragment = document.createDocumentFragment();
-        fragment.appendChild(openSourceContent);
-        fragment.appendChild(document.createTextNode(" \uff0b "));
-        fragment.appendChild(internalContent);
+        var shouldAddPlusSign = false;
+        var sortedRepositories = Dashboard.sortedRepositories;
+        for (var i = 0; i < sortedRepositories.length; ++i) {
+            var repository = sortedRepositories[i];
+            if (!iteration.revision[repository.name])
+                continue;
+            var content = this._revisionContentWithPopoverForIteration(iteration, previousDisplayedIteration, repository);
+            if (shouldAddPlusSign)
+                fragment.appendChild(document.createTextNode(" \uff0b "));
+            fragment.appendChild(content);
+            shouldAddPlusSign = true;
+        }
+        console.assert(fragment.childNodes.length);
         return fragment;
     },
 

Modified: trunk/Tools/ChangeLog (188358 => 188359)


--- trunk/Tools/ChangeLog	2015-08-12 21:07:49 UTC (rev 188358)
+++ trunk/Tools/ChangeLog	2015-08-12 21:10:25 UTC (rev 188359)
@@ -1,3 +1,21 @@
+2015-08-12  Jason Marcell  <[email protected]>
+
+        Refactor BuildbotQueueView.revisionContentForIteration to work more generically with repositories
+        other than "openSource" and "internal".
+        https://bugs.webkit.org/show_bug.cgi?id=147796
+
+        Reviewed by Daniel Bates.
+
+        * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotQueueView.js:
+        (BuildbotQueueView.prototype._revisionContentWithPopoverForIteration): The "repository" parameter
+        is now a repository object instead of the repository name, thus we don't have to pass the "trac"
+        object in separately. Also added an assertion to see if the given repository is in iteration.revision,
+        and another assertion that, if the previousIteration is non-null, the given repository is in
+        previousIteration.revision.
+        (BuildbotQueueView.prototype.revisionContentForIteration): Refactored to work more generically
+        with repositories other than "openSource" and "internal". Also added an assertion that the returned
+        fragment has at least one child node.
+
 2015-08-12  Simon Fraser  <[email protected]>
 
         Add a tool that dumps class and struct member layout, showing padding
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to