BuildbotBuildEntry for buildbot 0.9 uses incorrect buildrequestid
authoraakash_jain@apple.com <aakash_jain@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Mar 2018 23:45:11 +0000 (23:45 +0000)
committeraakash_jain@apple.com <aakash_jain@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Mar 2018 23:45:11 +0000 (23:45 +0000)
https://bugs.webkit.org/show_bug.cgi?id=183194

Reviewed by Ryosuke Niwa.

* tools/js/buildbot-syncer.js:
(BuildbotBuildEntry.prototype.initialize): Updated _buildRequestId to use correct build-request-id, as set in syncer._buildRequestPropertyName.
(BuildbotSyncer.prototype.pathForPendingBuilds): Updated url to fetch properties for build-requests.
* unit-tests/buildbot-syncer-tests.js:
(sampleBuildData): Updated sampleBuildData with correct build-request-id in properties. Added
properties to samplePendingBuildRequestData.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229489 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 0cb9cd3..45d7248 100644 (file)
@@ -1,3 +1,17 @@
+2018-03-04  Aakash Jain  <aakash_jain@apple.com>
+
+        BuildbotBuildEntry for buildbot 0.9 uses incorrect buildrequestid
+        https://bugs.webkit.org/show_bug.cgi?id=183194
+
+        Reviewed by Ryosuke Niwa.
+
+        * tools/js/buildbot-syncer.js:
+        (BuildbotBuildEntry.prototype.initialize): Updated _buildRequestId to use correct build-request-id, as set in syncer._buildRequestPropertyName.
+        (BuildbotSyncer.prototype.pathForPendingBuilds): Updated url to fetch properties for build-requests.
+        * unit-tests/buildbot-syncer-tests.js:
+        (sampleBuildData): Updated sampleBuildData with correct build-request-id in properties. Added
+        properties to samplePendingBuildRequestData.
+
 2018-02-28  Aakash Jain  <aakash_jain@apple.com>
 
         Rename samplePendingBuild to samplePendingBuildRequest
index 840f0ac..beed3c0 100644 (file)
@@ -15,12 +15,13 @@ class BuildbotBuildEntry {
         assert.equal(syncer.builderID(), rawData['builderid']);
 
         this._syncer = syncer;
-        this._buildRequestId = rawData['buildrequestid'];
         this._hasFinished = rawData['complete'];
         this._isPending = 'claimed' in rawData && !rawData['claimed'];
         this._isInProgress = !this._isPending && !this._hasFinished;
         this._buildNumber = rawData['number'];
-        this._workerName = rawData['properties'] && rawData['properties']['workername'] ? rawData['properties']['workername'][0] : null
+        this._workerName = rawData['properties'] && rawData['properties']['workername'] ? rawData['properties']['workername'][0] : null;
+        this._buildRequestId = rawData['properties'] && rawData['properties'][syncer._buildRequestPropertyName]
+            ? rawData['properties'][syncer._buildRequestPropertyName][0] : null;
     }
 
     syncer() { return this._syncer; }
@@ -265,7 +266,7 @@ class BuildbotSyncer {
     }
 
     pathForPendingBuildsJSONDeprecated() { return `/json/builders/${escape(this._builderName)}/pendingBuilds`; }
-    pathForPendingBuilds() { return `/api/v2/builders/${this._builderID}/buildrequests?complete=false&claimed=false`; }
+    pathForPendingBuilds() { return `/api/v2/builders/${this._builderID}/buildrequests?complete=false&claimed=false&property=*`; }
     pathForBuildJSONDeprecated(selectedBuilds)
     {
         return `/json/builders/${escape(this._builderName)}/builds/?` + selectedBuilds.map((number) => 'select=' + number).join('&');
index dd3a6fc..425fa7c 100644 (file)
@@ -297,11 +297,11 @@ function createSampleBuildRequestWithOwnedCommitAndPatch(platform, test, order)
         'commitSet': commitSet, 'status': 'pending', 'platform': platform, 'test': test, 'order': order});
 }
 
-function samplePendingBuildRequestData(buildRequestId, buildTime, builderId)
+function samplePendingBuildRequestData(buildRequestId, buildTime, workerName, builderId)
 {
     return {
         "builderid": builderId || 102,
-        "buildrequestid": buildRequestId || 16733,
+        "buildrequestid": 17,
         "buildsetid": 894720,
         "claimed": false,
         "claimed_at": null,
@@ -311,14 +311,20 @@ function samplePendingBuildRequestData(buildRequestId, buildTime, builderId)
         "priority": 0,
         "results": -1,
         "submitted_at": buildTime || 1458704983,
-        "waited_for": false
+        "waited_for": false,
+        "properties": {
+            "build_request_id": [buildRequestId || 16733, "Force Build Form"],
+            "scheduler": ["ABTest-iPad-RunBenchmark-Tests-ForceScheduler", "Scheduler"],
+            "slavename": [workerName, "Worker (deprecated)"],
+            "workername": [workerName, "Worker"]
+        }
     };
 }
 
-function samplePendingBuildRequests(buildRequestId, buildTime, builderName)
+function samplePendingBuildRequests(buildRequestId, buildTime, workerName, builderName)
 {
     return {
-        "buildrequests" : [samplePendingBuildRequestData(buildRequestId, buildTime, builderNameToIDMap()[builderName])]
+        "buildrequests" : [samplePendingBuildRequestData(buildRequestId, buildTime, workerName, builderNameToIDMap()[builderName])]
     };
 }
 
@@ -327,7 +333,7 @@ function sampleBuildData(workerName, isComplete, buildRequestId, buildNumber, bu
     return {
         "builderid": builderId || 102,
         "number": buildNumber || 614,
-        "buildrequestid": buildRequestId || 16733,
+        "buildrequestid": 17,
         "complete": isComplete,
         "complete_at": null,
         "buildid": 418744,
@@ -337,11 +343,11 @@ function sampleBuildData(workerName, isComplete, buildRequestId, buildNumber, bu
         "state_string": "building",
         "workerid": 41,
         "properties": {
+            "build_request_id": [buildRequestId || 16733, "Force Build Form"],
             "platform": ["mac", "Unknown"],
             "scheduler": ["ABTest-iPad-RunBenchmark-Tests-ForceScheduler", "Scheduler"],
             "slavename": [workerName || "ABTest-iPad-0", "Worker (deprecated)"],
-            "workername": [workerName || "ABTest-iPad-0", "Worker"
-            ]
+            "workername": [workerName || "ABTest-iPad-0", "Worker"]
         }
     };
 }