Title: [120648] trunk/Tools
Revision
120648
Author
[email protected]
Date
2012-06-18 18:03:11 -0700 (Mon, 18 Jun 2012)

Log Message

Show TOT revision in garden-o-matic, and make the revisions into links
https://bugs.webkit.org/show_bug.cgi?id=89396

Reviewed by Adam Barth.

The "latest revision" notification now reads "Latest revision processed by every bot: NN (trunk is at NN)"
where the revisions are links to trac.

To avoid setting innerHTML, I made base.createLinkNode() and used it in a bunch of places, which had
the knock-on effect of flipping the target and href attributes for anchors in some test output.

* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ViewController.js:
(ViewController.prototype._displayTesters.updateList.list):
(ViewController.prototype._displayTesters.updateList):
(ViewController.prototype._domForRegressionRange.trac.commitDataForRevisionRange):
(ViewController.prototype._domForRegressionRange):
(ViewController.prototype._domForAuxiliaryUIElements):
(ViewController.prototype._domForBuildName):
(ViewController.prototype):
(ViewController.prototype.):
* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/base.js:
* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/garden-o-matic.js:
* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/model.js:
* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/notifications.js:
* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/notifications_unittests.js:

Modified Paths

Diff

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


--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ViewController.js	2012-06-19 01:02:21 UTC (rev 120647)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ViewController.js	2012-06-19 01:03:11 UTC (rev 120648)
@@ -132,10 +132,7 @@
             latestBuildInfos.sort(function(a, b) { return a.tester.name.localeCompare(b.tester.name) });
             list.removeAllChildren();
             latestBuildInfos.forEach(function(buildInfo) {
-                var link = document.createElement('a');
-                link.href = '' + buildInfo.tester.name;
-                link.appendChild(document.createTextNode(buildInfo.tester.name));
-
+                var link = base.createLinkNode('#/' + buildInfo.tester.name, buildInfo.tester.name)
                 var item = document.createElement('li');
                 item.appendChild(link);
                 if (buildInfo.tooManyFailures)
@@ -193,12 +190,9 @@
         var suspectsContainer = document.createElement('div');
         result.appendChild(suspectsContainer);
 
-        var link = document.createElement('a');
+        var link = base.createLinkNode(trac.logURL('trunk', firstSuspectRevision, lastSuspectRevision, true), 'View regression range in Trac');
         result.appendChild(link);
 
-        link.href = "" firstSuspectRevision, lastSuspectRevision, true);
-        link.appendChild(document.createTextNode('View regression range in Trac'));
-
         suspectsContainer.appendChild(document.createTextNode('Searching for suspect revisions\u2026'));
 
         // FIXME: Maybe some of this code should go in LayoutTestHistoryAnalyzer, or some other class?
@@ -229,12 +223,7 @@
 
             list.appendChildren(sorted(suspectCommits, compareCommits).map(function(commit) {
                 var item = document.createElement('li');
-                var link = document.createElement('a');
-                item.appendChild(link);
-
-                link.href = ""
-                link.appendChild(document.createTextNode(commit.title))
-
+                item.appendChild(base.createLinkNode(trac.changesetURL(commit.revision), commit.title));
                 return item;
             }));
         });
@@ -245,10 +234,6 @@
     _domForAuxiliaryUIElements: function() {
         var aside = document.createElement('aside');
         aside.appendChild(document.createTextNode('Something not working? Have an idea to improve this page? '));
-        var link = document.createElement('a');
-        aside.appendChild(link);
-
-        link.appendChild(document.createTextNode('File a bug!'));
         var queryParameters = {
             product: 'WebKit',
             component: 'Tools / Tests',
@@ -257,27 +242,17 @@
             cc: '[email protected]',
             short_desc: 'TestFailures page needs more unicorns!',
         };
-        link.href = "" + '/enter_bug.cgi', queryParameters);
-        link.target = '_blank';
-
+        aside.appendChild(base.createLinkNode(addQueryParametersToURL(config.kBugzillaURL + '/enter_bug.cgi', queryParameters), 'File a bug!', '_blank'));
         return aside;
     },
 
     _domForBuildName: function(builder, buildName) {
         var parsed = this._buildbot.parseBuildName(buildName);
 
-        var sourceLink = document.createElement('a');
-        sourceLink.href = '' + parsed.revision;
-        sourceLink.appendChild(document.createTextNode('r' + parsed.revision));
+        var sourceLink = base.createLinkNode('http://trac.webkit.org/changeset/' + parsed.revision, 'r' + parsed.revision);
+        var buildLink = base.createLinkNode(builder.buildURL(parsed.buildNumber), parsed.buildNumber);
+        var resultsLink = base.createLinkNode(builder.resultsPageURL(buildName, 'results.html');
 
-        var buildLink = document.createElement('a');
-        buildLink.href = ""
-        buildLink.appendChild(document.createTextNode(parsed.buildNumber));
-
-        var resultsLink = document.createElement('a');
-        resultsLink.href = ""
-        resultsLink.appendChild(document.createTextNode('results.html'));
-
         var result = document.createDocumentFragment();
         result.appendChild(sourceLink);
         result.appendChild(document.createTextNode(' ('));
@@ -314,10 +289,7 @@
         if (!('url' in diagnosticInfo))
             return textAndCrashingSymbol;
 
-        var link = document.createElement('a');
-        link.href = ""
-        link.appendChild(textAndCrashingSymbol);
-        return link;
+        return base.createLinkNode(diagnosticInfo.url, textAndCrashingSymbol);
     },
 
     _domForNewAndExistingBugs: function(tester, failingTests, bugForm) {
@@ -350,10 +322,7 @@
             list.className = 'existing-bugs-list';
 
             function bugToListItem(bug) {
-                var link = document.createElement('a');
-                link.href = ""
-                link.appendChild(document.createTextNode(bug.title));
-
+                var link = base.createLinkNode(bug.url, bug.title);
                 var item = document.createElement('li');
                 item.appendChild(link);
 
@@ -382,13 +351,11 @@
         var form = bugForm.domElement();
         result.appendChild(form);
 
-        var link = document.createElement('a');
-        container.appendChild(link);
-
+        var linkText = 'File bug for ' + (failingTests.length > 1 ? 'these failures' : 'this failure');
+        var link = base.createLinkNode('#', linkText);
         link.addEventListener('click', function(event) { form.submit(); event.preventDefault(); });
-        link.href = '';
-        link.appendChild(document.createTextNode('File bug for ' + (failingTests.length > 1 ? 'these failures' : 'this failure')));
 
+        container.appendChild(link);
         return result;
     },
 

Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/base.js (120647 => 120648)


--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/base.js	2012-06-19 01:02:21 UTC (rev 120647)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/base.js	2012-06-19 01:03:11 UTC (rev 120648)
@@ -436,14 +436,27 @@
     return result;
 }
 
-base.getURLParameter = function(name) {
+base.getURLParameter = function(name)
+{
     return decodeURI(
         (RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1]
     );
 }
 
-base.underscoredBuilderName = function(builderName) {
+
+base.underscoredBuilderName = function(builderName)
+{
     return builderName.replace(/[ .()]/g, '_');
 }
 
+base.createLinkNode = function(url, textContent, opt_target)
+{
+    var link = document.createElement('a');
+    link.href = ""
+    if (opt_target)
+        link.target = opt_target;
+    link.appendChild(document.createTextNode(textContent));
+    return link;
+}
+
 })();

Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/garden-o-matic.js (120647 => 120648)


--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/garden-o-matic.js	2012-06-19 01:02:21 UTC (rev 120647)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/garden-o-matic.js	2012-06-19 01:03:11 UTC (rev 120648)
@@ -79,7 +79,21 @@
 
             updating.dismiss();
 
-            g_revisionHint = new ui.notifications.Info('Latest revision processed by every bot: ' + model.latestRevisionWithNoBuildersInFlight());
+            g_revisionHint = new ui.notifications.Info('');
+            
+            var latestRevisionSpan = document.createElement('span');
+            latestRevisionSpan.appendChild(document.createTextNode('Latest revision processed by every bot: '));
+            
+            var latestRevision = model.latestRevisionWithNoBuildersInFlight();
+            latestRevisionSpan.appendChild(base.createLinkNode(trac.changesetURL(latestRevision), latestRevision));
+            
+            var totRevision = model.latestRevision();
+            latestRevisionSpan.appendChild(document.createTextNode(' (trunk is at '));
+            latestRevisionSpan.appendChild(base.createLinkNode(trac.changesetURL(totRevision), totRevision));
+            latestRevisionSpan.appendChild(document.createTextNode(')'));
+            
+            g_revisionHint.updateWithNode(latestRevisionSpan);
+            
             g_info.add(g_revisionHint);
         });
     });

Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/model.js (120647 => 120648)


--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/model.js	2012-06-19 01:02:21 UTC (rev 120647)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/model.js	2012-06-19 01:03:11 UTC (rev 120648)
@@ -138,6 +138,11 @@
     return builders;
 };
 
+model.latestRevision = function()
+{
+    return model.state.recentCommits[0].revision;
+}
+
 model.latestRevisionWithNoBuildersInFlight = function()
 {
     var revision = 0;

Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/notifications.js (120647 => 120648)


--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/notifications.js	2012-06-19 01:02:21 UTC (rev 120647)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/notifications.js	2012-06-19 01:03:11 UTC (rev 120648)
@@ -74,7 +74,7 @@
         {
             this.parentNode && this.parentNode.removeChild(this);
         });
-    }
+    },
 });
 
 ui.notifications.Info = base.extends(ui.notifications.Notification, {
@@ -85,16 +85,19 @@
     update: function(message)
     {
         this._what.textContent = message;
+    },
+    updateWithNode: function(node)
+    {
+        while (this._what.firstChild)
+            this._what.removeChild(this._what.firstChild);
+        this._what.appendChild(node);
     }
 });
 
 ui.notifications.FailingTestGroup = base.extends('li', {
     init: function(groupName, testNameList)
     {
-        var link = this.appendChild(document.createElement('a'));
-        link.target = '_blank';
-        link.href = ""
-        link.textContent = groupName;
+        this.appendChild(base.createLinkNode(ui.urlForFlakinessDashboard(testNameList), groupName, '_blank'));
     }
 });
 
@@ -110,11 +113,8 @@
     init: function(commitData)
     {
         this._revision = commitData.revision;
-        var linkToRevision = this._description.appendChild(document.createElement('a'));
+        this._description.appendChild(base.createLinkNode(trac.changesetURL(commitData.revision), commitData.revision, '_blank'));
         this._details = this._description.appendChild(document.createElement('span'));
-        linkToRevision.href = ""
-        linkToRevision.target = '_blank';
-        linkToRevision.textContent = commitData.revision;
         this._addDetail('summary', commitData);
         this._addDetail('author', commitData);
         this._addDetail('reviewer', commitData);

Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/notifications_unittests.js (120647 => 120648)


--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/notifications_unittests.js	2012-06-19 01:02:21 UTC (rev 120647)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/notifications_unittests.js	2012-06-19 01:03:11 UTC (rev 120648)
@@ -79,7 +79,7 @@
 test('FailingTestGroup', 2, function() {
     var failingTest = new ui.notifications.FailingTestGroup('test', ['test.html']);
     equal(failingTest.tagName, 'LI');
-    equal(failingTest.innerHTML, '<a target="_blank" href=""
+    equal(failingTest.innerHTML, '<a href="" target="_blank">test</a>');
 });
 
 test('SuspiciousCommit', 2, function() {
@@ -130,7 +130,7 @@
         '<div class="what">' +
             '<div class="problem">' +
                 '<ul class="effects">' +
-                    '<li><a target="_blank" href="" +
+                    '<li><a href="" target="_blank">test</a></li>' +
                 '</ul>' +
                 '<ul class="actions">' +
                     '<li><button class="action default" title="Examine these failures in detail.">Examine</button></li>' +
@@ -153,7 +153,7 @@
         '<div class="what">' +
             '<div class="problem">' +
                 '<ul class="effects">' +
-                    '<li><a target="_blank" href="" +
+                    '<li><a href="" target="_blank">test</a></li>' +
                 '</ul>' +
                 '<ul class="actions">' +
                     '<li><button class="action default" title="Examine these failures in detail.">Examine</button></li>' +
@@ -178,7 +178,7 @@
         '<div class="what">' +
             '<div class="problem">' +
                 '<ul class="effects">' +
-                    '<li><a target="_blank" href="" +
+                    '<li><a href="" target="_blank">test</a></li>' +
                 '</ul>' +
                 '<ul class="actions">' +
                     '<li><button class="action default" title="Examine these failures in detail.">Examine</button></li>' +
@@ -218,8 +218,8 @@
         '<div class="what">' +
             '<div class="problem">' +
                 '<ul class="effects">' +
-                    '<li><a target="_blank" href="" +
-                    '<li><a target="_blank" href="" +
+                    '<li><a href="" target="_blank">foo</a></li>' +
+                    '<li><a href="" target="_blank">test</a></li>' +
                 '</ul>' +
                 '<ul class="actions">' +
                     '<li><button class="action default" title="Examine these failures in detail.">Examine</button></li>' +
@@ -263,8 +263,8 @@
         '<div class="what">' +
             '<div class="problem">' +
                 '<ul class="effects">' +
-                    '<li><a target="_blank" href="" +
-                    '<li><a target="_blank" href="" +
+                    '<li><a href="" target="_blank">foo</a></li>' +
+                    '<li><a href="" target="_blank">test</a></li>' +
                 '</ul>' +
                 '<ul class="actions">' +
                     '<li><button class="action default" title="Examine these failures in detail.">Examine</button></li>' +
@@ -304,8 +304,8 @@
         '<div class="what">' +
             '<div class="problem">' +
                 '<ul class="effects">' +
-                    '<li><a target="_blank" href="" (4 tests)</a></li>' +
-                    '<li><a target="_blank" href="" +
+                    '<li><a href="" target="_blank">path/to (4 tests)</a></li>' +
+                    '<li><a href="" target="_blank">path/another/test.html</a></li>' +
                 '</ul>' +
                 '<ul class="actions">' +
                     '<li><button class="action default" title="Examine these failures in detail.">Examine</button></li>' +

Modified: trunk/Tools/ChangeLog (120647 => 120648)


--- trunk/Tools/ChangeLog	2012-06-19 01:02:21 UTC (rev 120647)
+++ trunk/Tools/ChangeLog	2012-06-19 01:03:11 UTC (rev 120648)
@@ -1,3 +1,31 @@
+2012-06-18  Simon Fraser  <[email protected]>
+
+        Show TOT revision in garden-o-matic, and make the revisions into links
+        https://bugs.webkit.org/show_bug.cgi?id=89396
+
+        Reviewed by Adam Barth.
+
+        The "latest revision" notification now reads "Latest revision processed by every bot: NN (trunk is at NN)"
+        where the revisions are links to trac.
+        
+        To avoid setting innerHTML, I made base.createLinkNode() and used it in a bunch of places, which had
+        the knock-on effect of flipping the target and href attributes for anchors in some test output.
+
+        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ViewController.js:
+        (ViewController.prototype._displayTesters.updateList.list):
+        (ViewController.prototype._displayTesters.updateList):
+        (ViewController.prototype._domForRegressionRange.trac.commitDataForRevisionRange):
+        (ViewController.prototype._domForRegressionRange):
+        (ViewController.prototype._domForAuxiliaryUIElements):
+        (ViewController.prototype._domForBuildName):
+        (ViewController.prototype):
+        (ViewController.prototype.):
+        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/base.js:
+        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/garden-o-matic.js:
+        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/model.js:
+        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/notifications.js:
+        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/notifications_unittests.js:
+
 2012-06-18  Csaba Osztrogonác  <[email protected]>
 
         REGRESSION(r100558): NRWT should work without SVN or GIT
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to