BuildbotBuildEntry creates an incorrect url for pending builds
authoraakash_jain@apple.com <aakash_jain@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Mar 2018 23:48:37 +0000 (23:48 +0000)
committeraakash_jain@apple.com <aakash_jain@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Mar 2018 23:48:37 +0000 (23:48 +0000)
https://bugs.webkit.org/show_bug.cgi?id=183670

Reviewed by Ryosuke Niwa.

* tools/js/buildbot-syncer.js:
(BuildbotBuildEntry.prototype.initialize): Fetch buildrequestid from Buildbot.
(BuildbotBuildEntry.prototype.url): Construct url for pending build using buildrequestid from Buildbot.
* unit-tests/buildbot-syncer-tests.js: Updated unit-test.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229687 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Websites/perf.webkit.org/ChangeLog
Websites/perf.webkit.org/tools/js/buildbot-syncer.js
Websites/perf.webkit.org/unit-tests/buildbot-syncer-tests.js

index 454aec0..b5ac1fd 100644 (file)
@@ -1,3 +1,15 @@
+2018-03-15  Aakash Jain  <aakash_jain@apple.com>
+
+        BuildbotBuildEntry creates an incorrect url for pending builds
+        https://bugs.webkit.org/show_bug.cgi?id=183670
+
+        Reviewed by Ryosuke Niwa.
+
+        * tools/js/buildbot-syncer.js:
+        (BuildbotBuildEntry.prototype.initialize): Fetch buildrequestid from Buildbot.
+        (BuildbotBuildEntry.prototype.url): Construct url for pending build using buildrequestid from Buildbot.
+        * unit-tests/buildbot-syncer-tests.js: Updated unit-test.
+
 2018-03-14  Aakash Jain  <aakash_jain@apple.com>
 
         Add support for boolean properties in BuildbotSyncer while submitting build request to Buildbot 0.9 server
index 38039c2..81afaf1 100644 (file)
@@ -15,6 +15,7 @@ class BuildbotBuildEntry {
         assert.equal(syncer.builderID(), rawData['builderid']);
 
         this._syncer = syncer;
+        this._buildbotBuildRequestId = rawData['buildrequestid']
         this._hasFinished = rawData['complete'];
         this._isPending = 'claimed' in rawData && !rawData['claimed'];
         this._isInProgress = !this._isPending && !this._hasFinished;
@@ -32,7 +33,7 @@ class BuildbotBuildEntry {
     isPending() { return this._isPending; }
     isInProgress() { return this._isInProgress; }
     hasFinished() { return this._hasFinished; }
-    url() { return this.isPending() ? this._syncer.urlForPendingBuild(this._buildRequestId) : this._syncer.urlForBuildNumber(this._buildNumber); }
+    url() { return this.isPending() ? this._syncer.urlForPendingBuild(this._buildbotBuildRequestId) : this._syncer.urlForBuildNumber(this._buildNumber); }
 
     buildRequestStatusIfUpdateIsNeeded(request)
     {
index 41367d8..216cf9f 100644 (file)
@@ -1305,7 +1305,7 @@ describe('BuildbotSyncer', () => {
             assert.ok(entry.isPending());
             assert.ok(!entry.isInProgress());
             assert.ok(!entry.hasFinished());
-            assert.equal(entry.url(), 'http://build.webkit.org/#/buildrequests/16733');
+            assert.equal(entry.url(), 'http://build.webkit.org/#/buildrequests/17');
         });
 
         it('should create BuildbotBuildEntry for in-progress build', () => {