Title: [89571] trunk/Tools
Revision
89571
Author
aro...@apple.com
Date
2011-06-23 08:19:59 -0700 (Thu, 23 Jun 2011)

Log Message

Show closed bugs on the TestFailures page in addition to open ones

Fixes <http://webkit.org/b/63194> TestFailures page should show closed bugs, too

Reviewed by David Kilzer.

* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Bugzilla.js:
(Bugzilla.prototype.quickSearch): Added code to extract the bug's status and store it in the
returned data.
(Bugzilla.isOpenStatus): New function, returns true if the passed-in status indicates that
the associated bug is still open.

* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Utilities.js:
(addQueryParametersToURL): Add a missing semicolon.
(Node.prototype.appendChildren): New function, like appendChild but takes an array-like
object and appends each of the values stored within.

* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/ViewController.js:
(ViewController.prototype._domForNewAndExistingBugs): Prepend 'ALL' to the query so closed
bugs will be included in the results. Split the returned bugs into two sets: those which are
open, and those which are closed. Put the open bugs at the top level of the list, and the
closed bugs in a second level.

Modified Paths

Diff

Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Bugzilla.js (89570 => 89571)


--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Bugzilla.js	2011-06-23 14:58:56 UTC (rev 89570)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Bugzilla.js	2011-06-23 15:19:59 UTC (rev 89571)
@@ -54,9 +54,13 @@
         getResource(addQueryParametersToURL(this.baseURL + 'buglist.cgi', queryParameters), function(xhr) {
             var entries = xhr.responseXML.getElementsByTagName('entry');
             var results = Array.prototype.map.call(entries, function(entry) {
+                var container = document.createElement('div');
+                container.innerHTML = entry.getElementsByTagName('summary')[0].textContent;
+                var statusRow = container.querySelector('tr.bz_feed_bug_status');
                 return {
                     title: entry.getElementsByTagName('title')[0].textContent,
                     url: entry.getElementsByTagName('id')[0].textContent,
+                    status: statusRow.cells[1].textContent,
                 };
             });
 
@@ -71,3 +75,14 @@
         });
     },
 };
+
+Bugzilla.isOpenStatus = function(status) {
+    const openStatuses = {
+        UNCONFIRMED: true,
+        NEW: true,
+        ASSIGNED: true,
+        REOPENED: true,
+
+    };
+    return status in openStatuses;
+};

Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Utilities.js (89570 => 89571)


--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Utilities.js	2011-06-23 14:58:56 UTC (rev 89570)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Utilities.js	2011-06-23 15:19:59 UTC (rev 89571)
@@ -53,7 +53,7 @@
 
 function addQueryParametersToURL(url, queryParameters) {
     var encodedParameters = Object.keys(queryParameters).map(function(key) {
-        return key + '=' + encodeURIComponent(queryParameters[key])
+        return key + '=' + encodeURIComponent(queryParameters[key]);
     });
 
     if (url.indexOf('?') < 0)
@@ -77,3 +77,8 @@
         return undefined;
     return this[this.length - 1];
 }
+
+Node.prototype.appendChildren = function(children) {
+    for (var i = 0; i < children.length; ++i)
+        this.appendChild(children[i]);
+}

Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/ViewController.js (89570 => 89571)


--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/ViewController.js	2011-06-23 14:58:56 UTC (rev 89570)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/ViewController.js	2011-06-23 15:19:59 UTC (rev 89571)
@@ -205,7 +205,7 @@
 
         bugsContainer.appendChild(document.createTextNode('Searching for bugs related to ' + (failingTests.length > 1 ? 'these tests' : 'this test') + '\u2026'));
 
-        this._bugzilla.quickSearch(failingTests.join('|'), function(bugs) {
+        this._bugzilla.quickSearch('ALL ' + failingTests.join('|'), function(bugs) {
             if (!bugs.length) {
                 bugsContainer.parentNode.removeChild(bugsContainer);
                 return;
@@ -221,7 +221,7 @@
 
             list.className = 'existing-bugs-list';
 
-            bugs.forEach(function(bug) {
+            function bugToListItem(bug) {
                 var link = document.createElement('a');
                 link.href = ""
                 link.appendChild(document.createTextNode(bug.title));
@@ -229,8 +229,26 @@
                 var item = document.createElement('li');
                 item.appendChild(link);
 
-                list.appendChild(item);
-            });
+                return item;
+            }
+
+            var openBugs = bugs.filter(function(bug) { return Bugzilla.isOpenStatus(bug.status) });
+            var closedBugs = bugs.filter(function(bug) { return !Bugzilla.isOpenStatus(bug.status) });
+
+            list.appendChildren(openBugs.map(bugToListItem));
+
+            if (!closedBugs.length)
+                return;
+
+            var item = document.createElement('li');
+            list.appendChild(item);
+
+            item.appendChild(document.createTextNode('Closed bugs:'));
+
+            var closedList = document.createElement('ul');
+            item.appendChild(closedList);
+
+            closedList.appendChildren(closedBugs.map(bugToListItem));
         });
 
         var parsedFailingBuildName = this._buildbot.parseBuildName(failingBuildName);

Modified: trunk/Tools/ChangeLog (89570 => 89571)


--- trunk/Tools/ChangeLog	2011-06-23 14:58:56 UTC (rev 89570)
+++ trunk/Tools/ChangeLog	2011-06-23 15:19:59 UTC (rev 89571)
@@ -1,5 +1,30 @@
 2011-06-23  Adam Roben  <aro...@apple.com>
 
+        Show closed bugs on the TestFailures page in addition to open ones
+
+        Fixes <http://webkit.org/b/63194> TestFailures page should show closed bugs, too
+
+        Reviewed by David Kilzer.
+
+        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Bugzilla.js:
+        (Bugzilla.prototype.quickSearch): Added code to extract the bug's status and store it in the
+        returned data.
+        (Bugzilla.isOpenStatus): New function, returns true if the passed-in status indicates that
+        the associated bug is still open.
+
+        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Utilities.js:
+        (addQueryParametersToURL): Add a missing semicolon.
+        (Node.prototype.appendChildren): New function, like appendChild but takes an array-like
+        object and appends each of the values stored within.
+
+        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/ViewController.js:
+        (ViewController.prototype._domForNewAndExistingBugs): Prepend 'ALL' to the query so closed
+        bugs will be included in the results. Split the returned bugs into two sets: those which are
+        open, and those which are closed. Put the open bugs at the top level of the list, and the
+        closed bugs in a second level.
+
+2011-06-23  Adam Roben  <aro...@apple.com>
+
         Don't count new tests as failures on the TestFailures page
 
         Fixes <http://webkit.org/b/63254> TestFailures page calls new tests "failures", even though
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to