Update Perf buildbot syncing scripts for Buildbot 0.9
authoraakash_jain@apple.com <aakash_jain@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Mar 2018 00:20:46 +0000 (00:20 +0000)
committeraakash_jain@apple.com <aakash_jain@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Mar 2018 00:20:46 +0000 (00:20 +0000)
https://bugs.webkit.org/show_bug.cgi?id=175969

Reviewed by Ryosuke Niwa.

* tools/js/buildbot-triggerable.js:
(BuildbotTriggerable.prototype.initSyncers): Switch from Deprecated version to new version of getBuilderNameToIDMap.
* tools/js/buildbot-syncer.js:
(BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Switch from Deprecated version to new version of scheduleRequest.
(BuildbotSyncer.prototype.pullBuildbot): Switch from Deprecated version to new version of pathForPendingBuilds, _pullRecentBuilds
and BuildbotBuildEntry. Parse the pending build-requests data in Buildbot 0.9 format.
* unit-tests/buildbot-syncer-tests.js: Updated as per Buildbot 0.9 code.
* server-tests/tools-sync-buildbot-integration-tests.js: Ditto.
* server-tests/tools-buildbot-triggerable-tests.js: Ditto.
* server-tests/resources/mock-data.js: Ditto.
(MockData.pendingBuildsUrl): Method to construct pendingBuildsUrl in Buildbot 0.9 format.
(MockData.recentBuildsUrl): Ditto for recent builds url.
(MockData.statusUrl): Ditto for status url.
(MockData.builderIDForName): Method to get builder ID from builder name.

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

Websites/perf.webkit.org/ChangeLog
Websites/perf.webkit.org/server-tests/resources/mock-data.js
Websites/perf.webkit.org/server-tests/tools-buildbot-triggerable-tests.js
Websites/perf.webkit.org/server-tests/tools-sync-buildbot-integration-tests.js
Websites/perf.webkit.org/tools/js/buildbot-syncer.js
Websites/perf.webkit.org/tools/js/buildbot-triggerable.js
Websites/perf.webkit.org/unit-tests/buildbot-syncer-tests.js

index b5ac1fd..e10319d 100644 (file)
@@ -1,3 +1,25 @@
+2018-03-19  Aakash Jain  <aakash_jain@apple.com>
+
+        Update Perf buildbot syncing scripts for Buildbot 0.9
+        https://bugs.webkit.org/show_bug.cgi?id=175969
+
+        Reviewed by Ryosuke Niwa.
+
+        * tools/js/buildbot-triggerable.js:
+        (BuildbotTriggerable.prototype.initSyncers): Switch from Deprecated version to new version of getBuilderNameToIDMap.
+        * tools/js/buildbot-syncer.js:
+        (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Switch from Deprecated version to new version of scheduleRequest.
+        (BuildbotSyncer.prototype.pullBuildbot): Switch from Deprecated version to new version of pathForPendingBuilds, _pullRecentBuilds 
+        and BuildbotBuildEntry. Parse the pending build-requests data in Buildbot 0.9 format.
+        * unit-tests/buildbot-syncer-tests.js: Updated as per Buildbot 0.9 code.
+        * server-tests/tools-sync-buildbot-integration-tests.js: Ditto.
+        * server-tests/tools-buildbot-triggerable-tests.js: Ditto.
+        * server-tests/resources/mock-data.js: Ditto.
+        (MockData.pendingBuildsUrl): Method to construct pendingBuildsUrl in Buildbot 0.9 format.
+        (MockData.recentBuildsUrl): Ditto for recent builds url.
+        (MockData.statusUrl): Ditto for status url.
+        (MockData.builderIDForName): Method to get builder ID from builder name.
+
 2018-03-15  Aakash Jain  <aakash_jain@apple.com>
 
         BuildbotBuildEntry creates an incorrect url for pending builds
index d9950a2..9a71425 100644 (file)
@@ -19,6 +19,18 @@ MockData = {
     sharedRepositoryId() { return 14; },
     buildbotBuildersURLDeprecated() {return '/json/builders'},
     buildbotBuildersURL() {return '/api/v2/builders'},
+    pendingBuildsUrl: function (builderName) {
+        const builderId = this.builderIDForName(builderName);
+        return `/api/v2/builders/${builderId}/buildrequests?complete=false&claimed=false&property=*`;
+    },
+    recentBuildsUrl: function (builderName, count) {
+        const builderId = this.builderIDForName(builderName);
+        return `/api/v2/builders/${builderId}/builds?limit=${count}&order=-number&property=*`; 
+    },
+    statusUrl: function (builderName, buildId) {
+        const builderId = this.builderIDForName(builderName);
+        return `http://build.webkit.org/#/builders/${builderId}/builds/${buildId}`; 
+    },
     addMockConfiguration: function (db)
     {
         return Promise.all([
@@ -197,7 +209,7 @@ MockData = {
             },
             'builders': {
                 'builder-1': {'builder': 'some-builder-1',
-                     properties: {forcescheduler: 'force-some-builder-1'}} 
+                     properties: {forcescheduler: 'force-some-builder-1'}}
             },
             'testConfigurations': [
                 {
@@ -293,10 +305,50 @@ MockData = {
             ]
         }
     },
+    builderIDForName: function(builderName)
+    {
+        for (let builder of this.mockBuildbotBuilders().builders) {
+            if (builder.name == builderName)
+                return builder.builderid;
+        }
+        return -1;
+    },
+    pendingBuildData(options)
+    {
+        return {
+            "builderid": options.builderId || 2,
+            "buildrequestid": options.buildbotBuildRequestId || 18,
+            "buildsetid": 894720,
+            "claimed": false,
+            "claimed_at": null,
+            "claimed_by_masterid": null,
+            "complete": false,
+            "complete_at": null,
+            "priority": 0,
+            "results": -1,
+            "submitted_at": options.buildTime || (new Date('2016-03-23T03:49:43Z') / 1000),
+            "waited_for": false,
+            "properties": {
+                "build-request-id": [(options.buildRequestId || 702).toString(), "Force Build Form"],
+                "scheduler": ["ABTest-iPad-RunBenchmark-Tests-ForceScheduler", "Scheduler"],
+                "wk": [options.webkitRevision || '191622', "Unknown"],
+                "os": [options.osxRevision || '10.11 15A284', "Unknown"],
+                "slavename": [options.workerName || "bot202", "Worker (deprecated)"],
+                "workername": [options.workerName || "bot202", "Worker"]
+            }
+        };
+    },
     pendingBuild(options)
     {
         options = options || {};
         return {
+            "buildrequests": [this.pendingBuildData(options)]
+        };
+    },
+    pendingBuildDeprecated(options)
+    {
+        options = options || {};
+        return {
             'builderName': options.builder || 'some-builder-1',
             'builds': [],
             'properties': [
@@ -315,8 +367,46 @@ MockData = {
             },
         };
     },
+    sampleBuildData(options, overrides)
+    {
+        options = options || {};
+        overrides = overrides || {};
+        return {
+            "builderid": options.builderId || 2,
+            "number":  options.buildNumber || 124, 
+            "buildrequestid": options.buildbotBuildRequestId || 19,
+            "complete": 'isComplete' in overrides ? overrides.isComplete : (options.isComplete || false),
+            "complete_at": null,
+            "buildid": options.buildid || 418744,
+            "masterid": 1,
+            "results": null,
+            "started_at": new Date('2017-12-19T23:11:49Z') / 1000,
+            "state_string": "building",
+            "workerid": 41,
+            "properties": {
+                "build-request-id": [(options.buildRequestId || 701).toString(), "Force Build Form"],
+                "os": [options.osxRevision || '10.11 15A284', "Unknown"],
+                "wk": [options.webkitRevision || '192736', "Unknown"],
+                "project": ['', "Unknown"],
+                "repository": ['', "Unknown"],
+                "revision": ['', "Unknown"],
+                "slavename": [options.workerName || "bot202", "Worker (deprecated)"],
+                "workername": [options.workerName || "bot202", "Worker"]
+            }
+        };   
+    },
+    runningBuildData(options)
+    {
+        return this.sampleBuildData(options);
+    },
     runningBuild(options)
     {
+        return {
+            "builds": [this.runningBuildData(options)]
+        };
+    },
+    runningBuildDeprecated(options)
+    {
         options = options || {};
         return {
             'builderName': options.builder || 'some-builder-1',
@@ -340,8 +430,25 @@ MockData = {
             },
         };
     },
+    finishedBuildData(options)
+    {
+        options = options || {};
+        if (!options.buildRequestId)
+            options.buildRequestId = 700;
+        if (!options.buildNumber)
+            options.buildNumber = 123;
+        if (!options.webkitRevision)
+            options.webkitRevision = '191622';
+        return this.sampleBuildData(options, {isComplete: true});
+    },
     finishedBuild(options)
     {
+        return {
+            "builds": [this.finishedBuildData(options)]
+        };
+    },
+    finishedBuildDeprecated(options)
+    {
         options = options || {};
         return {
             'builderName': options.builder || 'some-builder-1',
index 79a3bc1..355ee3c 100644 (file)
@@ -36,7 +36,7 @@ describe('BuildbotTriggerable', function () {
                 const slaveInfo = {name: 'sync-slave', password: 'password'};
                 const triggerable = new BuildbotTriggerable(config, TestServer.remoteAPI(), MockRemoteAPI, slaveInfo, logger);
                 syncPromise = triggerable.initSyncers().then(() => triggerable.syncOnce());
-                assertRequestAndResolve(MockRemoteAPI.requests[0], 'GET', MockData.buildbotBuildersURLDeprecated(), MockData.mockBuildbotBuildersDeprecated());
+                assertRequestAndResolve(MockRemoteAPI.requests[0], 'GET', MockData.buildbotBuildersURL(), MockData.mockBuildbotBuilders());
                 MockRemoteAPI.reset();
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
@@ -46,29 +46,30 @@ describe('BuildbotTriggerable', function () {
                 assert.equal(BuildRequest.findById(702).status(), 'pending');
                 assert.equal(BuildRequest.findById(703).status(), 'pending');
                 assert.equal(MockRemoteAPI.requests[0].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[0].url, '/json/builders/some-builder-1/pendingBuilds');
-                MockRemoteAPI.requests[0].resolve([]);
+                assert.equal(MockRemoteAPI.requests[0].url, MockData.pendingBuildsUrl('some-builder-1'));
+                MockRemoteAPI.requests[0].resolve({});
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests[1].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[1].url, '/json/builders/some-builder-1/builds/?select=-1&select=-2');
-                MockRemoteAPI.requests[1].resolve({[-1]: MockData.runningBuild(), [-2]: MockData.finishedBuild()});
+                assert.equal(MockRemoteAPI.requests[1].url, MockData.recentBuildsUrl('some-builder-1', 2));
+                MockRemoteAPI.requests[1].resolve({'builds': [MockData.runningBuildData(), MockData.finishedBuildData()]});
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests[2].method, 'POST');
-                assert.equal(MockRemoteAPI.requests[2].url, '/builders/some-builder-1/force');
-                assert.deepEqual(MockRemoteAPI.requests[2].data, {'wk': '191622', 'os': '10.11 15A284', 'build-request-id': '702', 'forcescheduler': 'force-some-builder-1'});
+                assert.equal(MockRemoteAPI.requests[2].url, '/api/v2/forceschedulers/force-some-builder-1');
+                assert.deepEqual(MockRemoteAPI.requests[2].data, {'id': 702, 'jsonrpc': '2.0', 'method': 'force', 'params':
+                    {'wk': '191622', 'os': '10.11 15A284', 'build-request-id': 702, 'forcescheduler': 'force-some-builder-1'}});
                 MockRemoteAPI.requests[2].resolve('OK');
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests[3].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[3].url, '/json/builders/some-builder-1/pendingBuilds');
-                MockRemoteAPI.requests[3].resolve([MockData.pendingBuild()])
+                assert.equal(MockRemoteAPI.requests[3].url, MockData.pendingBuildsUrl('some-builder-1'));
+                MockRemoteAPI.requests[3].resolve(MockData.pendingBuild())
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests[4].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[4].url, '/json/builders/some-builder-1/builds/?select=-1&select=-2');
-                MockRemoteAPI.requests[4].resolve({[-1]: MockData.runningBuild(), [-2]: MockData.finishedBuild()});
+                assert.equal(MockRemoteAPI.requests[4].url, MockData.recentBuildsUrl('some-builder-1', 2));
+                MockRemoteAPI.requests[4].resolve({'builds': [MockData.runningBuildData(), MockData.finishedBuildData()]});
                 return syncPromise;
             }).then(() => {
                 return BuildRequest.fetchForTriggerable(MockData.mockTestSyncConfigWithSingleBuilder().triggerableName);
@@ -92,28 +93,28 @@ describe('BuildbotTriggerable', function () {
                 let slaveInfo = {name: 'sync-slave', password: 'password'};
                 let triggerable = new BuildbotTriggerable(config, TestServer.remoteAPI(), MockRemoteAPI, slaveInfo, logger);
                 syncPromise = triggerable.initSyncers().then(() => triggerable.syncOnce());
-                assertRequestAndResolve(MockRemoteAPI.requests[0], 'GET', MockData.buildbotBuildersURLDeprecated(), MockData.mockBuildbotBuildersDeprecated());
+                assertRequestAndResolve(MockRemoteAPI.requests[0], 'GET', MockData.buildbotBuildersURL(), MockData.mockBuildbotBuilders());
                 MockRemoteAPI.reset();
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests[0].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[0].url, '/json/builders/some-builder-1/pendingBuilds');
-                MockRemoteAPI.requests[0].resolve([MockData.pendingBuild()]);
+                assert.equal(MockRemoteAPI.requests[0].url, MockData.pendingBuildsUrl('some-builder-1'));
+                MockRemoteAPI.requests[0].resolve(MockData.pendingBuild());
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests[1].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[1].url, '/json/builders/some-builder-1/builds/?select=-1&select=-2');
-                MockRemoteAPI.requests[1].resolve({[-1]: MockData.runningBuild(), [-2]: MockData.finishedBuild()});
+                assert.equal(MockRemoteAPI.requests[1].url, MockData.recentBuildsUrl('some-builder-1', 2));
+                MockRemoteAPI.requests[1].resolve({'builds' : [MockData.runningBuildData(), MockData.finishedBuildData()]});
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests[2].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[2].url, '/json/builders/some-builder-1/pendingBuilds');
-                MockRemoteAPI.requests[2].resolve([MockData.pendingBuild()])
+                assert.equal(MockRemoteAPI.requests[2].url, MockData.pendingBuildsUrl('some-builder-1'));
+                MockRemoteAPI.requests[2].resolve(MockData.pendingBuild())
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests[3].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[3].url, '/json/builders/some-builder-1/builds/?select=-1&select=-2');
-                MockRemoteAPI.requests[3].resolve({[-1]: MockData.runningBuild(), [-2]: MockData.finishedBuild()});
+                assert.equal(MockRemoteAPI.requests[3].url, MockData.recentBuildsUrl('some-builder-1', 2));
+                MockRemoteAPI.requests[3].resolve({'builds' : [MockData.runningBuildData(), MockData.finishedBuildData()]});
                 return syncPromise;
             }).then(() => {
                 assert.equal(BuildRequest.all().length, 4);
@@ -142,50 +143,51 @@ describe('BuildbotTriggerable', function () {
                 const slaveInfo = {name: 'sync-slave', password: 'password'};
                 const triggerable = new BuildbotTriggerable(config, TestServer.remoteAPI(), MockRemoteAPI, slaveInfo, logger);
                 syncPromise = triggerable.initSyncers().then(() => triggerable.syncOnce());
-                assertRequestAndResolve(MockRemoteAPI.requests[0], 'GET', MockData.buildbotBuildersURLDeprecated(), MockData.mockBuildbotBuildersDeprecated());
+                assertRequestAndResolve(MockRemoteAPI.requests[0], 'GET', MockData.buildbotBuildersURL(), MockData.mockBuildbotBuilders());
                 MockRemoteAPI.reset();
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests.length, 2);
                 assert.equal(MockRemoteAPI.requests[0].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[0].url, '/json/builders/some-builder-1/pendingBuilds');
-                MockRemoteAPI.requests[0].resolve([MockData.pendingBuild({buildRequestId: 999})]);
+                assert.equal(MockRemoteAPI.requests[0].url, MockData.pendingBuildsUrl('some-builder-1'));
+                MockRemoteAPI.requests[0].resolve(MockData.pendingBuild({buildRequestId: 999}));
                 assert.equal(MockRemoteAPI.requests[1].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[1].url, '/json/builders/some%20builder%202/pendingBuilds');
-                MockRemoteAPI.requests[1].resolve([]);
+                assert.equal(MockRemoteAPI.requests[1].url, MockData.pendingBuildsUrl('some builder 2'));
+                MockRemoteAPI.requests[1].resolve({});
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests.length, 4);
                 assert.equal(MockRemoteAPI.requests[2].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[2].url, '/json/builders/some-builder-1/builds/?select=-1&select=-2');
+                assert.equal(MockRemoteAPI.requests[2].url, MockData.recentBuildsUrl('some-builder-1', 2));
                 MockRemoteAPI.requests[2].resolve({});
                 assert.equal(MockRemoteAPI.requests[3].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[3].url, '/json/builders/some%20builder%202/builds/?select=-1&select=-2');
+                assert.equal(MockRemoteAPI.requests[3].url, MockData.recentBuildsUrl('some builder 2', 2));
                 MockRemoteAPI.requests[3].resolve({});
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests.length, 5);
                 assert.equal(MockRemoteAPI.requests[4].method, 'POST');
-                assert.equal(MockRemoteAPI.requests[4].url, '/builders/some%20builder%202/force');
-                assert.deepEqual(MockRemoteAPI.requests[4].data, {'wk': '191622', 'os': '10.11 15A284', 'build-request-id': '700', 'forcescheduler': 'force-some-builder-2'});
+                assert.equal(MockRemoteAPI.requests[4].url, '/api/v2/forceschedulers/force-some-builder-2');
+                assert.deepEqual(MockRemoteAPI.requests[4].data, {'id': '700', 'jsonrpc': '2.0', 'method': 'force', 'params':
+                    {'wk': '191622', 'os': '10.11 15A284', 'build-request-id': '700', 'forcescheduler': 'force-some-builder-2'}});
                 MockRemoteAPI.requests[4].resolve('OK');
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests.length, 7);
                 assert.equal(MockRemoteAPI.requests[5].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[5].url, '/json/builders/some-builder-1/pendingBuilds');
-                MockRemoteAPI.requests[5].resolve([MockData.pendingBuild({buildRequestId: 999})]);
+                assert.equal(MockRemoteAPI.requests[5].url, MockData.pendingBuildsUrl('some-builder-1'));
+                MockRemoteAPI.requests[5].resolve(MockData.pendingBuild({buildRequestId: 999}));
                 assert.equal(MockRemoteAPI.requests[6].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[6].url, '/json/builders/some%20builder%202/pendingBuilds');
-                MockRemoteAPI.requests[6].resolve([MockData.pendingBuild({builder: 'some builder 2', buildRequestId: 700})]);
+                assert.equal(MockRemoteAPI.requests[6].url, MockData.pendingBuildsUrl('some builder 2'));
+                MockRemoteAPI.requests[6].resolve(MockData.pendingBuild({builderId: MockData.builderIDForName('some builder 2'), buildRequestId: 700, buildbotBuildRequestId: 17}));
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests.length, 9);
                 assert.equal(MockRemoteAPI.requests[7].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[7].url, '/json/builders/some-builder-1/builds/?select=-1&select=-2');
+                assert.equal(MockRemoteAPI.requests[7].url, MockData.recentBuildsUrl('some-builder-1', 2));
                 MockRemoteAPI.requests[7].resolve({});
                 assert.equal(MockRemoteAPI.requests[8].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[8].url, '/json/builders/some%20builder%202/builds/?select=-1&select=-2');
+                assert.equal(MockRemoteAPI.requests[8].url, MockData.recentBuildsUrl('some builder 2', 2));
                 MockRemoteAPI.requests[8].resolve({});
                 return syncPromise;
             }).then(() => {
@@ -202,7 +204,7 @@ describe('BuildbotTriggerable', function () {
             }).then(() => {
                 assert.equal(BuildRequest.all().length, 4);
                 assert.equal(BuildRequest.findById(700).status(), 'scheduled');
-                assert.equal(BuildRequest.findById(700).statusUrl(), 'http://build.webkit.org/builders/some%20builder%202/');
+                assert.equal(BuildRequest.findById(700).statusUrl(), 'http://build.webkit.org/#/buildrequests/17');
                 assert.equal(BuildRequest.findById(701).status(), 'pending');
                 assert.equal(BuildRequest.findById(701).statusUrl(), null);
                 assert.equal(BuildRequest.findById(702).status(), 'pending');
@@ -223,43 +225,43 @@ describe('BuildbotTriggerable', function () {
                 let slaveInfo = {name: 'sync-slave', password: 'password'};
                 let triggerable = new BuildbotTriggerable(config, TestServer.remoteAPI(), MockRemoteAPI, slaveInfo, logger);
                 syncPromise = triggerable.initSyncers().then(() => triggerable.syncOnce());
-                assertRequestAndResolve(MockRemoteAPI.requests[0], 'GET', MockData.buildbotBuildersURLDeprecated(), MockData.mockBuildbotBuildersDeprecated());
+                assertRequestAndResolve(MockRemoteAPI.requests[0], 'GET', MockData.buildbotBuildersURL(), MockData.mockBuildbotBuilders());
                 MockRemoteAPI.reset();
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests.length, 2);
                 assert.equal(MockRemoteAPI.requests[0].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[0].url, '/json/builders/some-builder-1/pendingBuilds');
-                MockRemoteAPI.requests[0].resolve([MockData.pendingBuild({buildRequestId: 700})]);
+                assert.equal(MockRemoteAPI.requests[0].url, MockData.pendingBuildsUrl('some-builder-1'));
+                MockRemoteAPI.requests[0].resolve(MockData.pendingBuild({buildRequestId: 700, buildbotBuildRequestId: 17}));
                 assert.equal(MockRemoteAPI.requests[1].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[1].url, '/json/builders/some%20builder%202/pendingBuilds');
-                MockRemoteAPI.requests[1].resolve([]);
+                assert.equal(MockRemoteAPI.requests[1].url, MockData.pendingBuildsUrl('some builder 2'));
+                MockRemoteAPI.requests[1].resolve({});
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests.length, 4);
                 assert.equal(MockRemoteAPI.requests[2].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[2].url, '/json/builders/some-builder-1/builds/?select=-1&select=-2');
+                assert.equal(MockRemoteAPI.requests[2].url, MockData.recentBuildsUrl('some-builder-1', 2));
                 MockRemoteAPI.requests[2].resolve({});
                 assert.equal(MockRemoteAPI.requests[3].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[3].url, '/json/builders/some%20builder%202/builds/?select=-1&select=-2');
+                assert.equal(MockRemoteAPI.requests[3].url, MockData.recentBuildsUrl('some builder 2', 2));
                 MockRemoteAPI.requests[3].resolve({});
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests.length, 6);
                 assert.equal(MockRemoteAPI.requests[4].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[4].url, '/json/builders/some-builder-1/pendingBuilds');
-                MockRemoteAPI.requests[4].resolve([MockData.pendingBuild({buildRequestId: 700})]);
+                assert.equal(MockRemoteAPI.requests[4].url, MockData.pendingBuildsUrl('some-builder-1'));
+                MockRemoteAPI.requests[4].resolve(MockData.pendingBuild({buildRequestId: 700, buildbotBuildRequestId: 17}));
                 assert.equal(MockRemoteAPI.requests[5].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[5].url, '/json/builders/some%20builder%202/pendingBuilds');
-                MockRemoteAPI.requests[5].resolve([]);
+                assert.equal(MockRemoteAPI.requests[5].url, MockData.pendingBuildsUrl('some builder 2'));
+                MockRemoteAPI.requests[5].resolve({});
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests.length, 8);
                 assert.equal(MockRemoteAPI.requests[6].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[6].url, '/json/builders/some-builder-1/builds/?select=-1&select=-2');
+                assert.equal(MockRemoteAPI.requests[6].url, MockData.recentBuildsUrl('some-builder-1', 2));
                 MockRemoteAPI.requests[6].resolve({});
                 assert.equal(MockRemoteAPI.requests[7].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[7].url, '/json/builders/some%20builder%202/builds/?select=-1&select=-2');
+                assert.equal(MockRemoteAPI.requests[7].url, MockData.recentBuildsUrl('some builder 2', 2));
                 MockRemoteAPI.requests[7].resolve({});
                 return syncPromise;
             }).then(() => {
@@ -276,7 +278,7 @@ describe('BuildbotTriggerable', function () {
             }).then(() => {
                 assert.equal(BuildRequest.all().length, 4);
                 assert.equal(BuildRequest.findById(700).status(), 'scheduled');
-                assert.equal(BuildRequest.findById(700).statusUrl(), 'http://build.webkit.org/builders/some-builder-1/');
+                assert.equal(BuildRequest.findById(700).statusUrl(), 'http://build.webkit.org/#/buildrequests/17');
                 assert.equal(BuildRequest.findById(701).status(), 'pending');
                 assert.equal(BuildRequest.findById(701).statusUrl(), null);
                 assert.equal(BuildRequest.findById(702).status(), 'pending');
@@ -297,50 +299,51 @@ describe('BuildbotTriggerable', function () {
                 const slaveInfo = {name: 'sync-slave', password: 'password'};
                 const triggerable = new BuildbotTriggerable(config, TestServer.remoteAPI(), MockRemoteAPI, slaveInfo, logger);
                 syncPromise = triggerable.initSyncers().then(() => triggerable.syncOnce());
-                assertRequestAndResolve(MockRemoteAPI.requests[0], 'GET', MockData.buildbotBuildersURLDeprecated(), MockData.mockBuildbotBuildersDeprecated());
+                assertRequestAndResolve(MockRemoteAPI.requests[0], 'GET', MockData.buildbotBuildersURL(), MockData.mockBuildbotBuilders());
                 MockRemoteAPI.reset();
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests.length, 2);
                 assert.equal(MockRemoteAPI.requests[0].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[0].url, '/json/builders/some-builder-1/pendingBuilds');
-                MockRemoteAPI.requests[0].resolve([]);
+                assert.equal(MockRemoteAPI.requests[0].url, MockData.pendingBuildsUrl('some-builder-1'));
+                MockRemoteAPI.requests[0].resolve({});
                 assert.equal(MockRemoteAPI.requests[1].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[1].url, '/json/builders/some%20builder%202/pendingBuilds');
-                MockRemoteAPI.requests[1].resolve([]);
+                assert.equal(MockRemoteAPI.requests[1].url, MockData.pendingBuildsUrl('some builder 2'));
+                MockRemoteAPI.requests[1].resolve({});
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests.length, 4);
                 assert.equal(MockRemoteAPI.requests[2].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[2].url, '/json/builders/some-builder-1/builds/?select=-1&select=-2');
-                MockRemoteAPI.requests[2].resolve({[-1]: MockData.runningBuild({buildRequestId: 701}), [-2]: MockData.finishedBuild({buildRequestId: 700})});
+                assert.equal(MockRemoteAPI.requests[2].url, MockData.recentBuildsUrl('some-builder-1', 2));
+                MockRemoteAPI.requests[2].resolve({'builds' : [MockData.runningBuildData({buildRequestId: 701}), MockData.finishedBuildData({buildRequestId: 700})]});
                 assert.equal(MockRemoteAPI.requests[3].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[3].url, '/json/builders/some%20builder%202/builds/?select=-1&select=-2');
+                assert.equal(MockRemoteAPI.requests[3].url, MockData.recentBuildsUrl('some builder 2', 2));
                 MockRemoteAPI.requests[3].resolve({});
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests.length, 5);
                 assert.equal(MockRemoteAPI.requests[4].method, 'POST');
-                assert.equal(MockRemoteAPI.requests[4].url, '/builders/some-builder-1/force');
-                assert.deepEqual(MockRemoteAPI.requests[4].data, {'wk': '191622', 'os': '10.11 15A284', 'build-request-id': '702', 'forcescheduler': 'force-some-builder-1'});
+                assert.equal(MockRemoteAPI.requests[4].url, '/api/v2/forceschedulers/force-some-builder-1');
+                assert.deepEqual(MockRemoteAPI.requests[4].data, {'id': '702', 'jsonrpc': '2.0', 'method': 'force', 'params':
+                    {'wk': '191622', 'os': '10.11 15A284', 'build-request-id': '702', 'forcescheduler': 'force-some-builder-1'}});
                 MockRemoteAPI.requests[4].resolve('OK');
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests.length, 7);
                 assert.equal(MockRemoteAPI.requests[5].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[5].url, '/json/builders/some-builder-1/pendingBuilds');
-                MockRemoteAPI.requests[5].resolve([MockData.pendingBuild({buildRequestId: 702})]);
+                assert.equal(MockRemoteAPI.requests[5].url, MockData.pendingBuildsUrl('some-builder-1'));
+                MockRemoteAPI.requests[5].resolve(MockData.pendingBuild({buildRequestId: 702, buildbotBuildRequestId: 17}));
                 assert.equal(MockRemoteAPI.requests[6].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[6].url, '/json/builders/some%20builder%202/pendingBuilds');
-                MockRemoteAPI.requests[6].resolve([]);
+                assert.equal(MockRemoteAPI.requests[6].url, MockData.pendingBuildsUrl('some builder 2'));
+                MockRemoteAPI.requests[6].resolve({});
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests.length, 9);
                 assert.equal(MockRemoteAPI.requests[7].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[7].url, '/json/builders/some-builder-1/builds/?select=-1&select=-2');
-                MockRemoteAPI.requests[7].resolve({[-1]: MockData.runningBuild({buildRequestId: 701}), [-2]: MockData.finishedBuild({buildRequestId: 700})});
+                assert.equal(MockRemoteAPI.requests[7].url, MockData.recentBuildsUrl('some-builder-1', 2));
+                MockRemoteAPI.requests[7].resolve({'builds' : [MockData.runningBuildData({buildRequestId: 701}), MockData.finishedBuildData({buildRequestId: 700})]});
                 assert.equal(MockRemoteAPI.requests[8].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[8].url, '/json/builders/some%20builder%202/builds/?select=-1&select=-2');
+                assert.equal(MockRemoteAPI.requests[8].url, MockData.recentBuildsUrl('some builder 2', 2));
                 MockRemoteAPI.requests[8].resolve({});
                 return syncPromise;
             }).then(() => {
@@ -357,11 +360,11 @@ describe('BuildbotTriggerable', function () {
             }).then(() => {
                 assert.equal(BuildRequest.all().length, 4);
                 assert.equal(BuildRequest.findById(700).status(), 'failed');
-                assert.equal(BuildRequest.findById(700).statusUrl(), 'http://build.webkit.org/builders/some-builder-1/builds/123');
+                assert.equal(BuildRequest.findById(700).statusUrl(), MockData.statusUrl('some-builder-1', 123));
                 assert.equal(BuildRequest.findById(701).status(), 'running');
-                assert.equal(BuildRequest.findById(701).statusUrl(), 'http://build.webkit.org/builders/some-builder-1/builds/124');
+                assert.equal(BuildRequest.findById(701).statusUrl(), MockData.statusUrl('some-builder-1', 124));
                 assert.equal(BuildRequest.findById(702).status(), 'scheduled');
-                assert.equal(BuildRequest.findById(702).statusUrl(), 'http://build.webkit.org/builders/some-builder-1/');
+                assert.equal(BuildRequest.findById(702).statusUrl(), 'http://build.webkit.org/#/buildrequests/17');
                 assert.equal(BuildRequest.findById(703).status(), 'pending');
                 assert.equal(BuildRequest.findById(703).statusUrl(), null);
             });
@@ -378,32 +381,32 @@ describe('BuildbotTriggerable', function () {
                 let slaveInfo = {name: 'sync-slave', password: 'password'};
                 let triggerable = new BuildbotTriggerable(config, TestServer.remoteAPI(), MockRemoteAPI, slaveInfo, logger);
                 syncPromise = triggerable.initSyncers().then(() => triggerable.syncOnce());
-                assertRequestAndResolve(MockRemoteAPI.requests[0], 'GET', MockData.buildbotBuildersURLDeprecated(), MockData.mockBuildbotBuildersDeprecated());
+                assertRequestAndResolve(MockRemoteAPI.requests[0], 'GET', MockData.buildbotBuildersURL(), MockData.mockBuildbotBuilders());
                 MockRemoteAPI.reset();
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests.length, 1);
                 assert.equal(MockRemoteAPI.requests[0].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[0].url, '/json/builders/some-builder-1/pendingBuilds');
-                MockRemoteAPI.requests[0].resolve([MockData.pendingBuild({buildRequestId: 700})]);
+                assert.equal(MockRemoteAPI.requests[0].url, MockData.pendingBuildsUrl('some-builder-1'));
+                MockRemoteAPI.requests[0].resolve(MockData.pendingBuild({buildRequestId: 700, buildbotBuildRequestId: 17}));
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests.length, 2);
                 assert.equal(MockRemoteAPI.requests[1].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[1].url, '/json/builders/some-builder-1/builds/?select=-1&select=-2');
+                assert.equal(MockRemoteAPI.requests[1].url, MockData.recentBuildsUrl('some-builder-1', 2));
                 MockRemoteAPI.requests[1].resolve({});
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests.length, 3);
                 assert.equal(MockRemoteAPI.requests[2].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[2].url, '/json/builders/some-builder-1/pendingBuilds');
-                MockRemoteAPI.requests[2].resolve([]);
+                assert.equal(MockRemoteAPI.requests[2].url, MockData.pendingBuildsUrl('some-builder-1'));
+                MockRemoteAPI.requests[2].resolve({});
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests.length, 4);
                 assert.equal(MockRemoteAPI.requests[3].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[3].url, '/json/builders/some-builder-1/builds/?select=-1&select=-2');
-                MockRemoteAPI.requests[3].resolve({[-1]: MockData.runningBuild({buildRequestId: 700})});
+                assert.equal(MockRemoteAPI.requests[3].url, MockData.recentBuildsUrl('some-builder-1', 2));
+                MockRemoteAPI.requests[3].resolve(MockData.runningBuild({buildRequestId: 700}));
                 return syncPromise;
             }).then(() => {
                 assert.equal(BuildRequest.all().length, 4);
@@ -419,7 +422,7 @@ describe('BuildbotTriggerable', function () {
             }).then(() => {
                 assert.equal(BuildRequest.all().length, 4);
                 assert.equal(BuildRequest.findById(700).status(), 'running');
-                assert.equal(BuildRequest.findById(700).statusUrl(), 'http://build.webkit.org/builders/some-builder-1/builds/124');
+                assert.equal(BuildRequest.findById(700).statusUrl(), MockData.statusUrl('some-builder-1', 124));
                 assert.equal(BuildRequest.findById(701).status(), 'pending');
                 assert.equal(BuildRequest.findById(701).statusUrl(), null);
                 assert.equal(BuildRequest.findById(702).status(), 'pending');
@@ -443,50 +446,51 @@ describe('BuildbotTriggerable', function () {
                 const slaveInfo = {name: 'sync-slave', password: 'password'};
                 const triggerable = new BuildbotTriggerable(config, TestServer.remoteAPI(), MockRemoteAPI, slaveInfo, logger);
                 syncPromise = triggerable.initSyncers().then(() => triggerable.syncOnce());
-                assertRequestAndResolve(MockRemoteAPI.requests[0], 'GET', MockData.buildbotBuildersURLDeprecated(), MockData.mockBuildbotBuildersDeprecated());
+                assertRequestAndResolve(MockRemoteAPI.requests[0], 'GET', MockData.buildbotBuildersURL(), MockData.mockBuildbotBuilders());
                 MockRemoteAPI.reset();
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests.length, 2);
                 assert.equal(MockRemoteAPI.requests[0].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[0].url, '/json/builders/some-builder-1/pendingBuilds');
-                MockRemoteAPI.requests[0].resolve([MockData.pendingBuild({buildRequestId: 702})]);
+                assert.equal(MockRemoteAPI.requests[0].url, MockData.pendingBuildsUrl('some-builder-1'));
+                MockRemoteAPI.requests[0].resolve(MockData.pendingBuild({buildRequestId: 702, buildbotBuildRequestId: 17}));
                 assert.equal(MockRemoteAPI.requests[1].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[1].url, '/json/builders/some%20builder%202/pendingBuilds');
-                MockRemoteAPI.requests[1].resolve([]);
+                assert.equal(MockRemoteAPI.requests[1].url, MockData.pendingBuildsUrl('some builder 2'));
+                MockRemoteAPI.requests[1].resolve({});
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests.length, 4);
                 assert.equal(MockRemoteAPI.requests[2].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[2].url, '/json/builders/some-builder-1/builds/?select=-1&select=-2');
-                MockRemoteAPI.requests[2].resolve({[-1]: MockData.runningBuild({buildRequestId: 701}), [-2]: MockData.finishedBuild({buildRequestId: 700})});
+                assert.equal(MockRemoteAPI.requests[2].url, MockData.recentBuildsUrl('some-builder-1', 2));
+                MockRemoteAPI.requests[2].resolve({'builds' : [MockData.runningBuildData({buildRequestId: 701}), MockData.finishedBuildData({buildRequestId: 700})]});
                 assert.equal(MockRemoteAPI.requests[3].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[3].url, '/json/builders/some%20builder%202/builds/?select=-1&select=-2');
+                assert.equal(MockRemoteAPI.requests[3].url, MockData.recentBuildsUrl('some builder 2', 2));
                 MockRemoteAPI.requests[3].resolve({});
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests.length, 5);
                 assert.equal(MockRemoteAPI.requests[4].method, 'POST');
-                assert.equal(MockRemoteAPI.requests[4].url, '/builders/some%20builder%202/force');
-                assert.deepEqual(MockRemoteAPI.requests[4].data, {'wk': '191622', 'os': '10.11 15A284', 'build-request-id': '710', 'forcescheduler': 'force-some-builder-2'});
+                assert.equal(MockRemoteAPI.requests[4].url, '/api/v2/forceschedulers/force-some-builder-2');
+                assert.deepEqual(MockRemoteAPI.requests[4].data, {'id': '710', 'jsonrpc': '2.0', 'method': 'force', 'params':
+                    {'wk': '191622', 'os': '10.11 15A284', 'build-request-id': '710', 'forcescheduler': 'force-some-builder-2'}});
                 MockRemoteAPI.requests[4].resolve('OK');
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests.length, 7);
                 assert.equal(MockRemoteAPI.requests[5].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[5].url, '/json/builders/some-builder-1/pendingBuilds');
-                MockRemoteAPI.requests[5].resolve([MockData.pendingBuild({buildRequestId: 702})]);
+                assert.equal(MockRemoteAPI.requests[5].url, MockData.pendingBuildsUrl('some-builder-1'));
+                MockRemoteAPI.requests[5].resolve(MockData.pendingBuild({buildRequestId: 702, buildbotBuildRequestId: 17}));
                 assert.equal(MockRemoteAPI.requests[6].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[6].url, '/json/builders/some%20builder%202/pendingBuilds');
-                MockRemoteAPI.requests[6].resolve([MockData.pendingBuild({builder: 'some builder 2', buildRequestId: 710})]);
+                assert.equal(MockRemoteAPI.requests[6].url, MockData.pendingBuildsUrl('some builder 2'));
+                MockRemoteAPI.requests[6].resolve(MockData.pendingBuild({builderId: MockData.builderIDForName('some builder 2'), buildRequestId: 710, buildbotBuildRequestId: 17}));
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests.length, 9);
                 assert.equal(MockRemoteAPI.requests[7].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[7].url, '/json/builders/some-builder-1/builds/?select=-1&select=-2');
-                MockRemoteAPI.requests[7].resolve({[-1]: MockData.runningBuild({buildRequestId: 701}), [-2]: MockData.finishedBuild({buildRequestId: 700})});
+                assert.equal(MockRemoteAPI.requests[7].url, MockData.recentBuildsUrl('some-builder-1', 2));
+                MockRemoteAPI.requests[7].resolve({'builds' : [MockData.runningBuildData({buildRequestId: 701}), MockData.finishedBuildData({buildRequestId: 700})]});
                 assert.equal(MockRemoteAPI.requests[8].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[8].url, '/json/builders/some%20builder%202/builds/?select=-1&select=-2');
+                assert.equal(MockRemoteAPI.requests[8].url, MockData.recentBuildsUrl('some builder 2', 2));
                 MockRemoteAPI.requests[8].resolve({});
                 return syncPromise;
             }).then(() => {
@@ -511,15 +515,15 @@ describe('BuildbotTriggerable', function () {
             }).then(() => {
                 assert.equal(BuildRequest.all().length, 8);
                 assert.equal(BuildRequest.findById(700).status(), 'completed');
-                assert.equal(BuildRequest.findById(700).statusUrl(), 'http://build.webkit.org/builders/some-builder-1/builds/123');
+                assert.equal(BuildRequest.findById(700).statusUrl(), MockData.statusUrl('some-builder-1', 123));
                 assert.equal(BuildRequest.findById(701).status(), 'running');
-                assert.equal(BuildRequest.findById(701).statusUrl(), 'http://build.webkit.org/builders/some-builder-1/builds/124');
+                assert.equal(BuildRequest.findById(701).statusUrl(), MockData.statusUrl('some-builder-1', 124));
                 assert.equal(BuildRequest.findById(702).status(), 'scheduled');
-                assert.equal(BuildRequest.findById(702).statusUrl(), 'http://build.webkit.org/builders/some-builder-1/');
+                assert.equal(BuildRequest.findById(702).statusUrl(), 'http://build.webkit.org/#/buildrequests/17');
                 assert.equal(BuildRequest.findById(703).status(), 'pending');
                 assert.equal(BuildRequest.findById(703).statusUrl(), null);
                 assert.equal(BuildRequest.findById(710).status(), 'scheduled');
-                assert.equal(BuildRequest.findById(710).statusUrl(), 'http://build.webkit.org/builders/some%20builder%202/');
+                assert.equal(BuildRequest.findById(710).statusUrl(), 'http://build.webkit.org/#/buildrequests/17');
                 assert.equal(BuildRequest.findById(711).status(), 'pending');
                 assert.equal(BuildRequest.findById(711).statusUrl(), null);
                 assert.equal(BuildRequest.findById(712).status(), 'pending');
@@ -543,55 +547,57 @@ describe('BuildbotTriggerable', function () {
                 const slaveInfo = {name: 'sync-slave', password: 'password'};
                 const triggerable = new BuildbotTriggerable(config, TestServer.remoteAPI(), MockRemoteAPI, slaveInfo, logger);
                 syncPromise = triggerable.initSyncers().then(() => triggerable.syncOnce());
-                assertRequestAndResolve(MockRemoteAPI.requests[0], 'GET', MockData.buildbotBuildersURLDeprecated(), MockData.mockBuildbotBuildersDeprecated());
+                assertRequestAndResolve(MockRemoteAPI.requests[0], 'GET', MockData.buildbotBuildersURL(), MockData.mockBuildbotBuilders());
                 MockRemoteAPI.reset();
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests.length, 2);
                 assert.equal(MockRemoteAPI.requests[0].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[0].url, '/json/builders/some-builder-1/pendingBuilds');
-                MockRemoteAPI.requests[0].resolve([]);
+                assert.equal(MockRemoteAPI.requests[0].url, MockData.pendingBuildsUrl('some-builder-1'));
+                MockRemoteAPI.requests[0].resolve({});
                 assert.equal(MockRemoteAPI.requests[1].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[1].url, '/json/builders/some%20builder%202/pendingBuilds');
-                MockRemoteAPI.requests[1].resolve([]);
+                assert.equal(MockRemoteAPI.requests[1].url, MockData.pendingBuildsUrl('some builder 2'));
+                MockRemoteAPI.requests[1].resolve({});
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests.length, 4);
                 assert.equal(MockRemoteAPI.requests[2].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[2].url, '/json/builders/some-builder-1/builds/?select=-1&select=-2');
-                MockRemoteAPI.requests[2].resolve({[-1]: MockData.runningBuild({buildRequestId: 710})});
+                assert.equal(MockRemoteAPI.requests[2].url, MockData.recentBuildsUrl('some-builder-1', 2));
+                MockRemoteAPI.requests[2].resolve(MockData.runningBuild({buildRequestId: 710}));
                 assert.equal(MockRemoteAPI.requests[3].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[3].url, '/json/builders/some%20builder%202/builds/?select=-1&select=-2');
-                MockRemoteAPI.requests[3].resolve({[-1]: MockData.runningBuild({builder: 'some builder 2', buildRequestId: 700})});
+                assert.equal(MockRemoteAPI.requests[3].url, MockData.recentBuildsUrl('some builder 2', 2));
+                MockRemoteAPI.requests[3].resolve(MockData.runningBuild({builderId: MockData.builderIDForName('some builder 2'), buildRequestId: 700}));
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests.length, 6);
                 assert.equal(MockRemoteAPI.requests[4].method, 'POST');
-                assert.equal(MockRemoteAPI.requests[4].url, '/builders/some%20builder%202/force');
-                assert.deepEqual(MockRemoteAPI.requests[4].data, {'wk': '192736', 'os': '10.11 15A284', 'build-request-id': '701', 'forcescheduler': 'force-some-builder-2'});
+                assert.equal(MockRemoteAPI.requests[4].url, '/api/v2/forceschedulers/force-some-builder-2');
+                assert.deepEqual(MockRemoteAPI.requests[4].data, {'id': '701', 'jsonrpc': '2.0', 'method': 'force', 'params':
+                    {'wk': '192736', 'os': '10.11 15A284', 'build-request-id': '701', 'forcescheduler': 'force-some-builder-2'}});
                 MockRemoteAPI.requests[4].resolve('OK');
                 assert.equal(MockRemoteAPI.requests[5].method, 'POST');
-                assert.equal(MockRemoteAPI.requests[5].url, '/builders/some-builder-1/force');
-                assert.deepEqual(MockRemoteAPI.requests[5].data, {'wk': '192736', 'os': '10.11 15A284', 'build-request-id': '711', 'forcescheduler': 'force-some-builder-1'});
+                assert.equal(MockRemoteAPI.requests[5].url, '/api/v2/forceschedulers/force-some-builder-1');
+                assert.deepEqual(MockRemoteAPI.requests[5].data, {'id': '711', 'jsonrpc': '2.0', 'method': 'force', 'params':
+                    {'wk': '192736', 'os': '10.11 15A284', 'build-request-id': '711', 'forcescheduler': 'force-some-builder-1'}});
                 MockRemoteAPI.requests[5].resolve('OK');
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests.length, 8);
                 assert.equal(MockRemoteAPI.requests[6].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[6].url, '/json/builders/some-builder-1/pendingBuilds');
-                MockRemoteAPI.requests[6].resolve([MockData.pendingBuild({buildRequestId: 711})]);
+                assert.equal(MockRemoteAPI.requests[6].url, MockData.pendingBuildsUrl('some-builder-1'));
+                MockRemoteAPI.requests[6].resolve(MockData.pendingBuild({buildRequestId: 711, buildbotBuildRequestId: 17}));
                 assert.equal(MockRemoteAPI.requests[7].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[7].url, '/json/builders/some%20builder%202/pendingBuilds');
-                MockRemoteAPI.requests[7].resolve([MockData.pendingBuild({builder: 'some builder 2',buildRequestId: 701})]);
+                assert.equal(MockRemoteAPI.requests[7].url, MockData.pendingBuildsUrl('some builder 2'));
+                MockRemoteAPI.requests[7].resolve(MockData.pendingBuild({builderId: MockData.builderIDForName('some builder 2'), buildRequestId: 701, buildbotBuildRequestId: 17}));
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests.length, 10);
                 assert.equal(MockRemoteAPI.requests[8].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[8].url, '/json/builders/some-builder-1/builds/?select=-1&select=-2');
-                MockRemoteAPI.requests[8].resolve({[-1]: MockData.runningBuild({buildRequestId: 710})});
+                assert.equal(MockRemoteAPI.requests[8].url, MockData.recentBuildsUrl('some-builder-1', 2));
+                MockRemoteAPI.requests[8].resolve(MockData.runningBuild({buildRequestId: 710}));
                 assert.equal(MockRemoteAPI.requests[9].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[9].url, '/json/builders/some%20builder%202/builds/?select=-1&select=-2');
-                MockRemoteAPI.requests[9].resolve({[-1]: MockData.runningBuild({builder: 'some builder 2', buildRequestId: 700})});
+                assert.equal(MockRemoteAPI.requests[9].url, MockData.recentBuildsUrl('some builder 2', 2));
+                MockRemoteAPI.requests[9].resolve(MockData.runningBuild({builderId: MockData.builderIDForName('some builder 2'), buildRequestId: 700}));
                 return syncPromise;
             }).then(() => {
                 assert.equal(BuildRequest.all().length, 8);
@@ -615,17 +621,17 @@ describe('BuildbotTriggerable', function () {
             }).then(() => {
                 assert.equal(BuildRequest.all().length, 8);
                 assert.equal(BuildRequest.findById(700).status(), 'running');
-                assert.equal(BuildRequest.findById(700).statusUrl(), 'http://build.webkit.org/builders/some%20builder%202/builds/124');
+                assert.equal(BuildRequest.findById(700).statusUrl(), MockData.statusUrl('some builder 2', 124));
                 assert.equal(BuildRequest.findById(701).status(), 'scheduled');
-                assert.equal(BuildRequest.findById(701).statusUrl(), 'http://build.webkit.org/builders/some%20builder%202/');
+                assert.equal(BuildRequest.findById(701).statusUrl(), 'http://build.webkit.org/#/buildrequests/17');
                 assert.equal(BuildRequest.findById(702).status(), 'pending');
                 assert.equal(BuildRequest.findById(702).statusUrl(), null);
                 assert.equal(BuildRequest.findById(703).status(), 'pending');
                 assert.equal(BuildRequest.findById(703).statusUrl(), null);
                 assert.equal(BuildRequest.findById(710).status(), 'running');
-                assert.equal(BuildRequest.findById(710).statusUrl(), 'http://build.webkit.org/builders/some-builder-1/builds/124');
+                assert.equal(BuildRequest.findById(710).statusUrl(), MockData.statusUrl('some-builder-1', 124));
                 assert.equal(BuildRequest.findById(711).status(), 'scheduled');
-                assert.equal(BuildRequest.findById(711).statusUrl(), 'http://build.webkit.org/builders/some-builder-1/');
+                assert.equal(BuildRequest.findById(711).statusUrl(), 'http://build.webkit.org/#/buildrequests/17');
                 assert.equal(BuildRequest.findById(712).status(), 'pending');
                 assert.equal(BuildRequest.findById(712).statusUrl(), null);
                 assert.equal(BuildRequest.findById(713).status(), 'pending');
@@ -646,26 +652,27 @@ describe('BuildbotTriggerable', function () {
                 const slaveInfo = {name: 'sync-slave', password: 'password'};
                 const triggerable = new BuildbotTriggerable(config, TestServer.remoteAPI(), MockRemoteAPI, slaveInfo, logger);
                 syncPromise = triggerable.initSyncers().then(() => triggerable.syncOnce());
-                assertRequestAndResolve(requests[0], 'GET', MockData.buildbotBuildersURLDeprecated(), MockData.mockBuildbotBuildersDeprecated());
+                assertRequestAndResolve(requests[0], 'GET', MockData.buildbotBuildersURL(), MockData.mockBuildbotBuilders());
                 MockRemoteAPI.reset();
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(requests.length, 1);
                 assert.equal(requests[0].method, 'GET');
-                assert.equal(requests[0].url, '/json/builders/some-builder-1/pendingBuilds');
-                MockRemoteAPI.requests[0].resolve([]);
+                assert.equal(requests[0].url, MockData.pendingBuildsUrl('some-builder-1'));
+                MockRemoteAPI.requests[0].resolve({});
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(requests.length, 2);
                 assert.equal(requests[1].method, 'GET');
-                assert.equal(requests[1].url, '/json/builders/some-builder-1/builds/?select=-1&select=-2');
+                assert.equal(requests[1].url, MockData.recentBuildsUrl('some-builder-1', 2));
                 requests[1].resolve({});
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(requests.length, 3);
                 assert.equal(requests[2].method, 'POST');
-                assert.equal(requests[2].url, '/builders/some-builder-1/force');
-                assert.deepEqual(requests[2].data, {'wk': '191622', 'os': '10.11 15A284', 'build-request-id': '700', 'forcescheduler': 'force-some-builder-1'});
+                assert.equal(requests[2].url, '/api/v2/forceschedulers/force-some-builder-1');
+                assert.deepEqual(requests[2].data, {'id': '700', 'jsonrpc': '2.0', 'method': 'force', 'params':
+                    {'wk': '191622', 'os': '10.11 15A284', 'build-request-id': '700', 'forcescheduler': 'force-some-builder-1'}});
                 return new Promise((resolve) => setTimeout(resolve, 10));
             }).then(() => {
                 assert.equal(requests.length, 3);
@@ -674,13 +681,13 @@ describe('BuildbotTriggerable', function () {
             }).then(() => {
                 assert.equal(requests.length, 4);
                 assert.equal(requests[3].method, 'GET');
-                assert.equal(requests[3].url, '/json/builders/some-builder-1/pendingBuilds');
-                MockRemoteAPI.requests[3].resolve([MockData.pendingBuild({buildRequestId: 700})]);
+                assert.equal(requests[3].url, MockData.pendingBuildsUrl('some-builder-1'));
+                MockRemoteAPI.requests[3].resolve(MockData.pendingBuild({buildRequestId: 700, buildbotBuildRequestId: 17}));
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(requests.length, 5);
                 assert.equal(requests[4].method, 'GET');
-                assert.equal(requests[4].url, '/json/builders/some-builder-1/builds/?select=-1&select=-2');
+                assert.equal(requests[4].url, MockData.recentBuildsUrl('some-builder-1', 2));
                 requests[4].resolve({});
                 return syncPromise;
             }).then(() => {
@@ -688,7 +695,7 @@ describe('BuildbotTriggerable', function () {
             }).then(() => {
                 assert.equal(BuildRequest.all().length, 8);
                 assert.equal(BuildRequest.findById(700).status(), 'scheduled');
-                assert.equal(BuildRequest.findById(700).statusUrl(), 'http://build.webkit.org/builders/some-builder-1/');
+                assert.equal(BuildRequest.findById(700).statusUrl(), 'http://build.webkit.org/#/buildrequests/17');
                 assert.equal(BuildRequest.findById(701).status(), 'pending');
                 assert.equal(BuildRequest.findById(701).statusUrl(), null);
                 assert.equal(BuildRequest.findById(702).status(), 'pending');
@@ -723,54 +730,55 @@ describe('BuildbotTriggerable', function () {
                 const slaveInfo = {name: 'sync-slave', password: 'password'};
                 triggerable = new BuildbotTriggerable(config, TestServer.remoteAPI(), MockRemoteAPI, slaveInfo, logger);
                 syncPromise = triggerable.initSyncers().then(() => triggerable.syncOnce());
-                assertRequestAndResolve(requests[0], 'GET', MockData.buildbotBuildersURLDeprecated(), MockData.mockBuildbotBuildersDeprecated());
+                assertRequestAndResolve(requests[0], 'GET', MockData.buildbotBuildersURL(), MockData.mockBuildbotBuilders());
                 MockRemoteAPI.reset();
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(requests.length, 1);
-                assertRequestAndResolve(requests[0], 'GET', '/json/builders/some-builder-1/pendingBuilds', []);
+                assertRequestAndResolve(requests[0], 'GET', MockData.pendingBuildsUrl('some-builder-1'), {});
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(requests.length, 2);
-                assertRequestAndResolve(requests[1], 'GET', '/json/builders/some-builder-1/builds/?select=-1&select=-2',
-                    {[-1]: MockData.runningBuild({buildRequestId: 700}), [-2]: MockData.finishedBuild({buildRequestId: 710})});
+                assertRequestAndResolve(requests[1], 'GET', MockData.recentBuildsUrl('some-builder-1', 2),
+                    {'builds' : [MockData.runningBuildData({buildRequestId: 700}), MockData.finishedBuildData({buildRequestId: 710})]});
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(requests.length, 3);
-                assertRequestAndResolve(requests[2], 'POST', '/builders/some-builder-1/force');
-                assert.deepEqual(requests[2].data, {'wk': '192736', 'os': '10.11 15A284', 'build-request-id': '701', 'forcescheduler': 'force-some-builder-1'});
+                assertRequestAndResolve(requests[2], 'POST', '/api/v2/forceschedulers/force-some-builder-1');
+                assert.deepEqual(MockRemoteAPI.requests[2].data, {'id': '701', 'jsonrpc': '2.0', 'method': 'force', 'params':
+                    {'wk': '192736', 'os': '10.11 15A284', 'build-request-id': '701', 'forcescheduler': 'force-some-builder-1'}});
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(requests.length, 4);
-                assertRequestAndResolve(requests[3], 'GET', '/json/builders/some-builder-1/pendingBuilds',
-                    [MockData.pendingBuild({buildRequestId: 701})]);
+                assertRequestAndResolve(requests[3], 'GET', MockData.pendingBuildsUrl('some-builder-1'),
+                    MockData.pendingBuild({buildRequestId: 701, buildbotBuildRequestId: 17}));
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(requests.length, 5);
-                assertRequestAndResolve(requests[4], 'GET', '/json/builders/some-builder-1/builds/?select=-1&select=-2',
-                    {[-1]: MockData.runningBuild({buildRequestId: 700}), [-2]: MockData.finishedBuild({buildRequestId: 710})});
+                assertRequestAndResolve(requests[4], 'GET', MockData.recentBuildsUrl('some-builder-1', 2),
+                    {'builds': [MockData.runningBuildData({buildRequestId: 700}), MockData.finishedBuildData({buildRequestId: 710})]});
                 return syncPromise;
             }).then(() => {
                 syncPromise = triggerable.initSyncers().then(() => triggerable.syncOnce());
-                assertRequestAndResolve(requests[5], 'GET', MockData.buildbotBuildersURLDeprecated(), MockData.mockBuildbotBuildersDeprecated());
+                assertRequestAndResolve(requests[5], 'GET', MockData.buildbotBuildersURL(), MockData.mockBuildbotBuilders());
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(requests.length, 7);
-                assertRequestAndResolve(requests[6], 'GET', '/json/builders/some-builder-1/pendingBuilds', []);
+                assertRequestAndResolve(requests[6], 'GET', MockData.pendingBuildsUrl('some-builder-1'), {});
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(requests.length, 8);
-                assertRequestAndResolve(requests[7], 'GET', '/json/builders/some-builder-1/builds/?select=-1&select=-2',
-                    {[-1]: MockData.runningBuild({buildRequestId: 701}), [-2]: MockData.runningBuild({buildRequestId: 700})});
+                assertRequestAndResolve(requests[7], 'GET', MockData.recentBuildsUrl('some-builder-1', 2),
+                    {'builds': [MockData.runningBuildData({buildRequestId: 701}), MockData.runningBuildData({buildRequestId: 700})]});
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(requests.length, 9);
-                assertRequestAndResolve(requests[8], 'GET', '/json/builders/some-builder-1/pendingBuilds', []);
+                assertRequestAndResolve(requests[8], 'GET', MockData.pendingBuildsUrl('some-builder-1'), {});
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(requests.length, 10);
-                assertRequestAndResolve(requests[9], 'GET', '/json/builders/some-builder-1/builds/?select=-1&select=-2',
-                    {[-1]: MockData.runningBuild({buildRequestId: 701}), [-2]: MockData.runningBuild({buildRequestId: 700})});
+                assertRequestAndResolve(requests[9], 'GET', MockData.recentBuildsUrl('some-builder-1', 2),
+                    {'builds': [MockData.runningBuildData({buildRequestId: 701}), MockData.runningBuildData({buildRequestId: 700})]});
                 return syncPromise;
             });
         });
@@ -786,38 +794,39 @@ describe('BuildbotTriggerable', function () {
                 const slaveInfo = {name: 'sync-slave', password: 'password'};
                 const triggerable = new BuildbotTriggerable(config, TestServer.remoteAPI(), MockRemoteAPI, slaveInfo, logger);
                 syncPromise = triggerable.initSyncers().then(() => triggerable.syncOnce());
-                assertRequestAndResolve(MockRemoteAPI.requests[0], 'GET', MockData.buildbotBuildersURLDeprecated(), MockData.mockBuildbotBuildersDeprecated());
+                assertRequestAndResolve(MockRemoteAPI.requests[0], 'GET', MockData.buildbotBuildersURL(), MockData.mockBuildbotBuilders());
                 MockRemoteAPI.reset();
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests.length, 1);
                 assert.equal(MockRemoteAPI.requests[0].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[0].url, '/json/builders/some-builder-1/pendingBuilds');
-                MockRemoteAPI.requests[0].resolve([]);
+                assert.equal(MockRemoteAPI.requests[0].url, MockData.pendingBuildsUrl('some-builder-1'));
+                MockRemoteAPI.requests[0].resolve({});
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests.length, 2);
                 assert.equal(MockRemoteAPI.requests[1].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[1].url, '/json/builders/some-builder-1/builds/?select=-1&select=-2');
+                assert.equal(MockRemoteAPI.requests[1].url, MockData.recentBuildsUrl('some-builder-1', 2));
                 MockRemoteAPI.requests[1].resolve({});
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests.length, 3);
                 assert.equal(MockRemoteAPI.requests[2].method, 'POST');
-                assert.equal(MockRemoteAPI.requests[2].url, '/builders/some-builder-1/force');
-                assert.deepEqual(MockRemoteAPI.requests[2].data, {'wk': '192736', 'os': '10.11 15A284', 'build-request-id': '701', 'forcescheduler': 'force-some-builder-1'});
+                assert.equal(MockRemoteAPI.requests[2].url, '/api/v2/forceschedulers/force-some-builder-1');
+                assert.deepEqual(MockRemoteAPI.requests[2].data, {'id': '701', 'jsonrpc': '2.0', 'method': 'force', 'params':
+                    {'wk': '192736', 'os': '10.11 15A284', 'build-request-id': '701', 'forcescheduler': 'force-some-builder-1'}});
                 MockRemoteAPI.requests[2].resolve('OK');
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests.length, 4);
                 assert.equal(MockRemoteAPI.requests[3].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[3].url, '/json/builders/some-builder-1/pendingBuilds');
-                MockRemoteAPI.requests[3].resolve([MockData.pendingBuild({buildRequestId: 701})]);
+                assert.equal(MockRemoteAPI.requests[3].url, MockData.pendingBuildsUrl('some-builder-1'));
+                MockRemoteAPI.requests[3].resolve(MockData.pendingBuild({buildRequestId: 701, buildbotBuildRequestId: 17}));
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests.length, 5);
                 assert.equal(MockRemoteAPI.requests[4].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[4].url, '/json/builders/some-builder-1/builds/?select=-1&select=-2');
+                assert.equal(MockRemoteAPI.requests[4].url, MockData.recentBuildsUrl('some-builder-1', 2));
                 MockRemoteAPI.requests[4].resolve({});
                 return syncPromise;
             }).then(() => {
@@ -836,7 +845,7 @@ describe('BuildbotTriggerable', function () {
                 assert.equal(BuildRequest.findById(700).status(), 'failed');
                 assert.equal(BuildRequest.findById(700).statusUrl(), null);
                 assert.equal(BuildRequest.findById(701).status(), 'scheduled');
-                assert.equal(BuildRequest.findById(701).statusUrl(), 'http://build.webkit.org/builders/some-builder-1/');
+                assert.equal(BuildRequest.findById(701).statusUrl(), 'http://build.webkit.org/#/buildrequests/17');
                 assert.equal(BuildRequest.findById(702).status(), 'pending');
                 assert.equal(BuildRequest.findById(702).statusUrl(), null);
                 assert.equal(BuildRequest.findById(703).status(), 'pending');
@@ -855,31 +864,31 @@ describe('BuildbotTriggerable', function () {
                 const slaveInfo = {name: 'sync-slave', password: 'password'};
                 const triggerable = new BuildbotTriggerable(config, TestServer.remoteAPI(), MockRemoteAPI, slaveInfo, logger);
                 syncPromise = triggerable.initSyncers().then(() => triggerable.syncOnce());
-                assertRequestAndResolve(MockRemoteAPI.requests[0], 'GET', MockData.buildbotBuildersURLDeprecated(), MockData.mockBuildbotBuildersDeprecated());
+                assertRequestAndResolve(MockRemoteAPI.requests[0], 'GET', MockData.buildbotBuildersURL(), MockData.mockBuildbotBuilders());
                 MockRemoteAPI.reset();
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests.length, 1);
                 assert.equal(MockRemoteAPI.requests[0].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[0].url, '/json/builders/some-builder-1/pendingBuilds');
-                MockRemoteAPI.requests[0].resolve([]);
+                assert.equal(MockRemoteAPI.requests[0].url, MockData.pendingBuildsUrl('some-builder-1'));
+                MockRemoteAPI.requests[0].resolve({});
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests.length, 2);
                 assert.equal(MockRemoteAPI.requests[1].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[1].url, '/json/builders/some-builder-1/builds/?select=-1&select=-2');
+                assert.equal(MockRemoteAPI.requests[1].url, MockData.recentBuildsUrl('some-builder-1', 2));
                 MockRemoteAPI.requests[1].resolve({});
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests.length, 3);
                 assert.equal(MockRemoteAPI.requests[2].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[2].url, '/json/builders/some-builder-1/pendingBuilds');
-                MockRemoteAPI.requests[2].resolve([]);
+                assert.equal(MockRemoteAPI.requests[2].url, MockData.pendingBuildsUrl('some-builder-1'));
+                MockRemoteAPI.requests[2].resolve({});
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests.length, 4);
                 assert.equal(MockRemoteAPI.requests[3].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[3].url, '/json/builders/some-builder-1/builds/?select=-1&select=-2');
+                assert.equal(MockRemoteAPI.requests[3].url, MockData.recentBuildsUrl('some-builder-1', 2));
                 MockRemoteAPI.requests[3].resolve({});
                 return syncPromise;
             }).then(() => {
@@ -912,26 +921,28 @@ describe('BuildbotTriggerable', function () {
                 const slaveInfo = {name: 'sync-slave', password: 'password'};
                 const triggerable = new BuildbotTriggerable(config, TestServer.remoteAPI(), MockRemoteAPI, slaveInfo, logger);
                 syncPromise = triggerable.initSyncers().then(() => triggerable.syncOnce());
-                assertRequestAndResolve(MockRemoteAPI.requests[0], 'GET', MockData.buildbotBuildersURLDeprecated(), MockData.mockBuildbotBuildersDeprecated());
+                assertRequestAndResolve(MockRemoteAPI.requests[0], 'GET', MockData.buildbotBuildersURL(), MockData.mockBuildbotBuilders());
                 MockRemoteAPI.reset();
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests.length, 1);
                 assert.equal(MockRemoteAPI.requests[0].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[0].url, '/json/builders/some-builder-1/pendingBuilds');
-                MockRemoteAPI.requests[0].resolve([]);
+                assert.equal(MockRemoteAPI.requests[0].url, MockData.pendingBuildsUrl('some-builder-1'));
+                MockRemoteAPI.requests[0].resolve({});
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests.length, 2);
                 assert.equal(MockRemoteAPI.requests[1].method, 'GET');
-                assert.equal(MockRemoteAPI.requests[1].url, '/json/builders/some-builder-1/builds/?select=-1&select=-2');
+                assert.equal(MockRemoteAPI.requests[1].url, MockData.recentBuildsUrl('some-builder-1', 2));
                 MockRemoteAPI.requests[1].resolve({});
                 return MockRemoteAPI.waitForRequest();
             }).then(() => {
                 assert.equal(MockRemoteAPI.requests.length, 3);
                 assert.equal(MockRemoteAPI.requests[2].method, 'POST');
-                assert.equal(MockRemoteAPI.requests[2].url, '/builders/some-builder-1/force');
-                assert.deepEqual(MockRemoteAPI.requests[2].data, {'wk': '191622', 'os': '10.11 15A284', 'build-request-id': '710', 'forcescheduler': 'force-some-builder-1'});
+                assert.equal(MockRemoteAPI.requests[2].url, '/api/v2/forceschedulers/force-some-builder-1');
+
+                assert.deepEqual(MockRemoteAPI.requests[2].data, {'id': '710', 'jsonrpc': '2.0', 'method': 'force', 'params':
+                    {'wk': '191622', 'os': '10.11 15A284', 'build-request-id': '710', 'forcescheduler': 'force-some-builder-1'}});
                 MockRemoteAPI.requests[2].resolve('OK');
             });
         });
@@ -1000,7 +1011,7 @@ describe('BuildbotTriggerable', function () {
                 const slaveInfo = {name: 'sync-slave', password: 'password'};
                 const buildbotTriggerable = new BuildbotTriggerable(config, TestServer.remoteAPI(), MockRemoteAPI, slaveInfo, logger);
                 const triggerablePromise = buildbotTriggerable.initSyncers().then(() => buildbotTriggerable.updateTriggerable());
-                assertRequestAndResolve(MockRemoteAPI.requests[0], 'GET', MockData.buildbotBuildersURLDeprecated(), MockData.mockBuildbotBuildersDeprecated());
+                assertRequestAndResolve(MockRemoteAPI.requests[0], 'GET', MockData.buildbotBuildersURL(), MockData.mockBuildbotBuilders());
                 return triggerablePromise;
             }).then(() => refetchManifest()).then(() => {
                 assert.equal(Triggerable.all().length, 1);
@@ -1027,7 +1038,7 @@ describe('BuildbotTriggerable', function () {
                 const slaveInfo = {name: 'sync-slave', password: 'password'};
                 const buildbotTriggerable = new BuildbotTriggerable(config, TestServer.remoteAPI(), MockRemoteAPI, slaveInfo, logger);
                 const triggerablePromise = buildbotTriggerable.initSyncers().then(() => buildbotTriggerable.updateTriggerable());
-                assertRequestAndResolve(MockRemoteAPI.requests[1], 'GET', MockData.buildbotBuildersURLDeprecated(), MockData.mockBuildbotBuildersDeprecated());
+                assertRequestAndResolve(MockRemoteAPI.requests[1], 'GET', MockData.buildbotBuildersURL(), MockData.mockBuildbotBuilders());
                 return triggerablePromise;
             }).then(() => refetchManifest()).then(() => {
                 assert.equal(Triggerable.all().length, 1);
index c737bb6..6be2c80 100644 (file)
@@ -157,7 +157,7 @@ function createTriggerable(config = configWithOneTesterTwoBuilders)
     }).then(() => {
         triggerable = new BuildbotTriggerable(config, TestServer.remoteAPI(), MockRemoteAPI, {name: 'sync-slave', password: 'password'}, new MockLogger);
         const syncPromise = triggerable.initSyncers().then(() => triggerable.updateTriggerable());
-        assertAndResolveRequest(MockRemoteAPI.requests[0], 'GET', MockData.buildbotBuildersURLDeprecated(), MockData.mockBuildbotBuildersDeprecated());
+        assertAndResolveRequest(MockRemoteAPI.requests[0], 'GET', MockData.buildbotBuildersURL(), MockData.mockBuildbotBuilders());
         MockRemoteAPI.reset();
         return syncPromise;
     }).then(() => Manifest.fetch()).then(() => {
@@ -252,32 +252,33 @@ describe('sync-buildbot', function () {
             taskId = firstTestGroup.task().id();
             anotherTaskId = secondTestGroup.task().id();
             syncPromise = triggerable.initSyncers().then(() => triggerable.syncOnce());
-            assertAndResolveRequest(requests[0], 'GET', MockData.buildbotBuildersURLDeprecated(), MockData.mockBuildbotBuildersDeprecated());
+            assertAndResolveRequest(requests[0], 'GET', MockData.buildbotBuildersURL(), MockData.mockBuildbotBuilders());
             MockRemoteAPI.reset();
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 2);
-            assertAndResolveRequest(requests[0], 'GET', '/json/builders/some%20tester/pendingBuilds', [MockData.pendingBuild({builder: 'some tester', buildRequestId: 5})]);
-            assertAndResolveRequest(requests[1], 'GET', '/json/builders/another%20tester/pendingBuilds', []);
+            assertAndResolveRequest(requests[0], 'GET', MockData.pendingBuildsUrl('some tester'), MockData.pendingBuild({builderId: MockData.builderIDForName('some tester'), buildRequestId: 5}));
+            assertAndResolveRequest(requests[1], 'GET', MockData.pendingBuildsUrl('another tester'), {});
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 4);
-            assertAndResolveRequest(requests[2], 'GET', '/json/builders/some%20tester/builds/?select=-1&select=-2', {
-                [-1]: MockData.runningBuild({builder: 'some tester', buildRequestId: 1})});
-            assertAndResolveRequest(requests[3], 'GET', '/json/builders/another%20tester/builds/?select=-1&select=-2', {});
+            assertAndResolveRequest(requests[2], 'GET', MockData.recentBuildsUrl('some tester', 2),
+                MockData.runningBuild({builderId: MockData.builderIDForName('some tester'), buildRequestId: 1}));
+            assertAndResolveRequest(requests[3], 'GET', MockData.recentBuildsUrl('another tester', 2), {});
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 6);
-            assertAndResolveRequest(requests[4], 'GET', '/json/builders/some%20tester/pendingBuilds', []);
-            assertAndResolveRequest(requests[5], 'GET', '/json/builders/another%20tester/pendingBuilds',[]);
+            assertAndResolveRequest(requests[4], 'GET', MockData.pendingBuildsUrl('some tester'), {});
+            assertAndResolveRequest(requests[5], 'GET', MockData.pendingBuildsUrl('another tester'), {});
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 8);
-            assertAndResolveRequest(requests[6], 'GET', '/json/builders/some%20tester/builds/?select=-1&select=-2', {
-                [-1]: MockData.runningBuild({builder: 'some tester', buildRequestId: 5}),
-                [-2]: MockData.finishedBuild({builder: 'some tester', buildRequestId: 1})
+            assertAndResolveRequest(requests[6], 'GET', MockData.recentBuildsUrl('some tester', 2), {
+                'builds': [
+                    MockData.runningBuildData({builderId: MockData.builderIDForName('some tester'), buildRequestId: 5}),
+                    MockData.finishedBuildData({builderId: MockData.builderIDForName('some tester'), buildRequestId: 1})]
             });
-            assertAndResolveRequest(requests[7], 'GET', '/json/builders/another%20tester/builds/?select=-1&select=-2', {});
+            assertAndResolveRequest(requests[7], 'GET', MockData.recentBuildsUrl('another tester', 2), {});
             return syncPromise;
         }).then(() => {
             return TestGroup.fetchForTask(taskId, true);
@@ -366,41 +367,40 @@ describe('sync-buildbot', function () {
             assert.deepEqual(otherCommitSet.allRootFiles(), []);
 
             syncPromise = triggerable.initSyncers().then(() => triggerable.syncOnce());
-            assertAndResolveRequest(requests[0], 'GET', MockData.buildbotBuildersURLDeprecated(), MockData.mockBuildbotBuildersDeprecated());
+            assertAndResolveRequest(requests[0], 'GET', MockData.buildbotBuildersURL(), MockData.mockBuildbotBuilders());
             MockRemoteAPI.reset();
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 3);
-            assertAndResolveRequest(requests[0], 'GET', '/json/builders/some%20tester/pendingBuilds', []);
-            assertAndResolveRequest(requests[1], 'GET', '/json/builders/some%20builder/pendingBuilds', []);
-            assertAndResolveRequest(requests[2], 'GET', '/json/builders/other%20builder/pendingBuilds', []);
+            assertAndResolveRequest(requests[0], 'GET', MockData.pendingBuildsUrl('some tester'), {});
+            assertAndResolveRequest(requests[1], 'GET', MockData.pendingBuildsUrl('some builder'), {});
+            assertAndResolveRequest(requests[2], 'GET', MockData.pendingBuildsUrl('other builder'), {});
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 6);
-            assertAndResolveRequest(requests[3], 'GET', '/json/builders/some%20tester/builds/?select=-1&select=-2', {});
-            assertAndResolveRequest(requests[4], 'GET', '/json/builders/some%20builder/builds/?select=-1&select=-2', {});
-            assertAndResolveRequest(requests[5], 'GET', '/json/builders/other%20builder/builds/?select=-1&select=-2', {});
+            assertAndResolveRequest(requests[3], 'GET', MockData.recentBuildsUrl('some tester', 2), {});
+            assertAndResolveRequest(requests[4], 'GET', MockData.recentBuildsUrl('some builder', 2), {});
+            assertAndResolveRequest(requests[5], 'GET', MockData.recentBuildsUrl('other builder', 2), {});
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 7);
-            assertAndResolveRequest(requests[6], 'POST', '/builders/some%20builder/force', 'OK');
-            assert.deepEqual(requests[6].data, {'wk': '191622', 'wk-patch': RemoteAPI.url('/api/uploaded-file/1.dat'),
-                'build-request-id': '1', 'forcescheduler': 'force-ab-builds', 'checkbox': 'build-wk', 'build-wk': true});
+            assertAndResolveRequest(requests[6], 'POST', '/api/v2/forceschedulers/force-ab-builds', 'OK');
+            assert.deepEqual(requests[6].data, {'id': '1', 'jsonrpc': '2.0', 'method': 'force', 'params':
+                {'wk': '191622', 'wk-patch': RemoteAPI.url('/api/uploaded-file/1.dat'), 'checkbox': 'build-wk', 'build-wk': true, 'build-request-id': '1', 'forcescheduler': 'force-ab-builds'}});
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 10);
-            assertAndResolveRequest(requests[7], 'GET', '/json/builders/some%20tester/pendingBuilds', []);
-            assertAndResolveRequest(requests[8], 'GET', '/json/builders/some%20builder/pendingBuilds',
-                [MockData.pendingBuild({builder: 'some builder', buildRequestId: 1})]);
-            assertAndResolveRequest(requests[9], 'GET', '/json/builders/other%20builder/pendingBuilds', []);
+            assertAndResolveRequest(requests[7], 'GET', MockData.pendingBuildsUrl('some tester'), {});
+            assertAndResolveRequest(requests[8], 'GET', MockData.pendingBuildsUrl('some builder'),
+                MockData.pendingBuild({builderId: MockData.builderIDForName('some builder'), buildRequestId: 1}));
+            assertAndResolveRequest(requests[9], 'GET', MockData.pendingBuildsUrl('other builder'), {});
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 13);
-            assertAndResolveRequest(requests[10], 'GET', '/json/builders/some%20tester/builds/?select=-1&select=-2', {});
-            assertAndResolveRequest(requests[11], 'GET', '/json/builders/some%20builder/builds/?select=-1&select=-2', {
-                [-1]: MockData.runningBuild({builder: 'some builder', buildRequestId: 1})
-            });
-            assertAndResolveRequest(requests[12], 'GET', '/json/builders/other%20builder/builds/?select=-1&select=-2', {});
+            assertAndResolveRequest(requests[10], 'GET', MockData.recentBuildsUrl('some tester', 2), {});
+            assertAndResolveRequest(requests[11], 'GET', MockData.recentBuildsUrl('some builder', 2),
+                MockData.runningBuild({builderId: MockData.builderIDForName('some builder'), buildRequestId: 1}));
+            assertAndResolveRequest(requests[12], 'GET', MockData.recentBuildsUrl('other builder', 2), {});
             return syncPromise;
         }).then(() => {
             return TestGroup.fetchForTask(taskId, true);
@@ -414,7 +414,7 @@ describe('sync-buildbot', function () {
             assert(buildRequest.isBuild());
             assert(!buildRequest.isTest());
             assert.equal(buildRequest.statusLabel(), 'Running');
-            assert.equal(buildRequest.statusUrl(), 'http://build.webkit.org/builders/some%20builder/builds/124');
+            assert.equal(buildRequest.statusUrl(), MockData.statusUrl('some builder', 124));
             assert.equal(buildRequest.buildId(), null);
 
             const commitSet = buildRequest.commitSet();
@@ -451,7 +451,7 @@ describe('sync-buildbot', function () {
             assert(buildRequest.isBuild());
             assert(!buildRequest.isTest());
             assert.equal(buildRequest.statusLabel(), 'Completed');
-            assert.equal(buildRequest.statusUrl(), 'http://build.webkit.org/builders/some%20builder/builds/124');
+            assert.equal(buildRequest.statusUrl(), MockData.statusUrl('some builder', 124));
             assert.notEqual(buildRequest.buildId(), null);
 
             const commitSet = buildRequest.commitSet();
@@ -479,42 +479,43 @@ describe('sync-buildbot', function () {
 
             MockRemoteAPI.reset();
             syncPromise = triggerable.initSyncers().then(() => triggerable.syncOnce());
-            assertAndResolveRequest(requests[0], 'GET', MockData.buildbotBuildersURLDeprecated(), MockData.mockBuildbotBuildersDeprecated());
+            assertAndResolveRequest(requests[0], 'GET', MockData.buildbotBuildersURL(), MockData.mockBuildbotBuilders());
             MockRemoteAPI.reset();
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 3);
-            assertAndResolveRequest(requests[0], 'GET', '/json/builders/some%20tester/pendingBuilds', []);
-            assertAndResolveRequest(requests[1], 'GET', '/json/builders/some%20builder/pendingBuilds', []);
-            assertAndResolveRequest(requests[2], 'GET', '/json/builders/other%20builder/pendingBuilds', []);
+            assertAndResolveRequest(requests[0], 'GET', MockData.pendingBuildsUrl('some tester'), {});
+            assertAndResolveRequest(requests[1], 'GET', MockData.pendingBuildsUrl('some builder'), {});
+            assertAndResolveRequest(requests[2], 'GET', MockData.pendingBuildsUrl('other builder'), {});
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 6);
-            assertAndResolveRequest(requests[3], 'GET', '/json/builders/some%20tester/builds/?select=-1&select=-2', {});
-            assertAndResolveRequest(requests[4], 'GET', '/json/builders/some%20builder/builds/?select=-1&select=-2', {
-                [-1]: MockData.finishedBuild({builder: 'some builder', buildRequestId: 1})
-            });
-            assertAndResolveRequest(requests[5], 'GET', '/json/builders/other%20builder/builds/?select=-1&select=-2', {});
+            assertAndResolveRequest(requests[3], 'GET', MockData.recentBuildsUrl('some tester', 2), {});
+            assertAndResolveRequest(requests[4], 'GET', MockData.recentBuildsUrl('some builder', 2),
+                MockData.finishedBuild({builderId: MockData.builderIDForName('some builder'), buildRequestId: 1}));
+            assertAndResolveRequest(requests[5], 'GET', MockData.recentBuildsUrl('other builder', 2), {});
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 7);
-            assertAndResolveRequest(requests[6], 'POST', '/builders/some%20builder/force', 'OK');
-            assert.deepEqual(requests[6].data, {'wk': '191622', 'build-request-id': '2', 'forcescheduler': 'force-ab-builds', 'checkbox': 'build-wk', 'build-wk': true});
+            assertAndResolveRequest(requests[6], 'POST', '/api/v2/forceschedulers/force-ab-builds', 'OK');
+            assert.deepEqual(requests[6].data, {'id': '2', 'jsonrpc': '2.0', 'method': 'force', 'params':
+                {'wk': '191622', 'build-request-id': '2', 'forcescheduler': 'force-ab-builds', 'checkbox': 'build-wk', 'build-wk': true}});
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 10);
-            assertAndResolveRequest(requests[7], 'GET', '/json/builders/some%20tester/pendingBuilds', []);
-            assertAndResolveRequest(requests[8], 'GET', '/json/builders/some%20builder/pendingBuilds', []);
-            assertAndResolveRequest(requests[9], 'GET', '/json/builders/other%20builder/pendingBuilds', []);
+            assertAndResolveRequest(requests[7], 'GET', MockData.pendingBuildsUrl('some tester'), {});
+            assertAndResolveRequest(requests[8], 'GET', MockData.pendingBuildsUrl('some builder'), {});
+            assertAndResolveRequest(requests[9], 'GET', MockData.pendingBuildsUrl('other builder'), {});
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 13);
-            assertAndResolveRequest(requests[10], 'GET', '/json/builders/some%20tester/builds/?select=-1&select=-2', {});
-            assertAndResolveRequest(requests[11], 'GET', '/json/builders/some%20builder/builds/?select=-1&select=-2', {
-                [-1]: MockData.runningBuild({builder: 'some builder', buildRequestId: 2}),
-                [-2]: MockData.finishedBuild({builder: 'some builder', buildRequestId: 1}),
+            assertAndResolveRequest(requests[10], 'GET', MockData.recentBuildsUrl('some tester', 2), {});
+            assertAndResolveRequest(requests[11], 'GET', MockData.recentBuildsUrl('some builder', 2), {
+                'builds': [
+                    MockData.runningBuildData({builderId: MockData.builderIDForName('some builder'), buildRequestId: 2}),
+                    MockData.finishedBuildData({builderId: MockData.builderIDForName('some builder'), buildRequestId: 1})]
             });
-            assertAndResolveRequest(requests[12], 'GET', '/json/builders/other%20builder/builds/?select=-1&select=-2', {});
+            assertAndResolveRequest(requests[12], 'GET', MockData.recentBuildsUrl('other builder', 2), {});
             return syncPromise;
         }).then(() => {
             return TestGroup.fetchForTask(taskId, true);
@@ -528,7 +529,7 @@ describe('sync-buildbot', function () {
             assert(buildRequest.isBuild());
             assert(!buildRequest.isTest());
             assert.equal(buildRequest.statusLabel(), 'Completed');
-            assert.equal(buildRequest.statusUrl(), 'http://build.webkit.org/builders/some%20builder/builds/124');
+            assert.equal(buildRequest.statusUrl(), MockData.statusUrl('some builder', 124));
             assert.notEqual(buildRequest.buildId(), null);
 
             const commitSet = buildRequest.commitSet();
@@ -545,7 +546,7 @@ describe('sync-buildbot', function () {
             assert(otherBuildRequest.isBuild());
             assert(!otherBuildRequest.isTest());
             assert.equal(otherBuildRequest.statusLabel(), 'Running');
-            assert.equal(otherBuildRequest.statusUrl(), 'http://build.webkit.org/builders/some%20builder/builds/124');
+            assert.equal(otherBuildRequest.statusUrl(), MockData.statusUrl('some builder', 124));
             assert.equal(otherBuildRequest.buildId(), null);
 
             const otherCommitSet = otherBuildRequest.commitSet();
@@ -567,7 +568,7 @@ describe('sync-buildbot', function () {
             assert(buildRequest.isBuild());
             assert(!buildRequest.isTest());
             assert.equal(buildRequest.statusLabel(), 'Completed');
-            assert.equal(buildRequest.statusUrl(), 'http://build.webkit.org/builders/some%20builder/builds/124');
+            assert.equal(buildRequest.statusUrl(), MockData.statusUrl('some builder', 124));
             assert.notEqual(buildRequest.buildId(), null);
 
             const commitSet = buildRequest.commitSet();
@@ -584,7 +585,7 @@ describe('sync-buildbot', function () {
             assert(otherBuildRequest.isBuild());
             assert(!otherBuildRequest.isTest());
             assert.equal(otherBuildRequest.statusLabel(), 'Completed');
-            assert.equal(otherBuildRequest.statusUrl(), 'http://build.webkit.org/builders/some%20builder/builds/124');
+            assert.equal(otherBuildRequest.statusUrl(), MockData.statusUrl('some builder', 124));
             assert.notEqual(otherBuildRequest.buildId(), null);
 
             const otherCommitSet = otherBuildRequest.commitSet();
@@ -639,41 +640,40 @@ describe('sync-buildbot', function () {
             assert.deepEqual(otherCommitSet.allRootFiles(), []);
 
             syncPromise = triggerable.initSyncers().then(() => triggerable.syncOnce());
-            assertAndResolveRequest(requests[0], 'GET', MockData.buildbotBuildersURLDeprecated(), MockData.mockBuildbotBuildersDeprecated());
+            assertAndResolveRequest(requests[0], 'GET', MockData.buildbotBuildersURL(), MockData.mockBuildbotBuilders());
             MockRemoteAPI.reset();
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 3);
-            assertAndResolveRequest(requests[0], 'GET', '/json/builders/some%20tester/pendingBuilds', []);
-            assertAndResolveRequest(requests[1], 'GET', '/json/builders/some%20builder/pendingBuilds', []);
-            assertAndResolveRequest(requests[2], 'GET', '/json/builders/other%20builder/pendingBuilds', []);
+            assertAndResolveRequest(requests[0], 'GET', MockData.pendingBuildsUrl('some tester'), {});
+            assertAndResolveRequest(requests[1], 'GET', MockData.pendingBuildsUrl('some builder'), {});
+            assertAndResolveRequest(requests[2], 'GET', MockData.pendingBuildsUrl('other builder'), {});
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 6);
-            assertAndResolveRequest(requests[3], 'GET', '/json/builders/some%20tester/builds/?select=-1&select=-2', {});
-            assertAndResolveRequest(requests[4], 'GET', '/json/builders/some%20builder/builds/?select=-1&select=-2', {});
-            assertAndResolveRequest(requests[5], 'GET', '/json/builders/other%20builder/builds/?select=-1&select=-2', {});
+            assertAndResolveRequest(requests[3], 'GET', MockData.recentBuildsUrl('some tester', 2), {});
+            assertAndResolveRequest(requests[4], 'GET', MockData.recentBuildsUrl('some builder', 2), {});
+            assertAndResolveRequest(requests[5], 'GET', MockData.recentBuildsUrl('other builder', 2), {});
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 7);
-            assertAndResolveRequest(requests[6], 'POST', '/builders/some%20builder/force', 'OK');
-            assert.deepEqual(requests[6].data, {'wk': '191622', 'wk-patch': RemoteAPI.url('/api/uploaded-file/1.dat'),
-                'build-request-id': '1', 'forcescheduler': 'force-ab-builds', 'checkbox': 'build-wk', 'build-wk': true, 'platform-name': 'some platform'});
+            assertAndResolveRequest(requests[6], 'POST', '/api/v2/forceschedulers/force-ab-builds', 'OK');
+            assert.deepEqual(requests[6].data, {'id': '1', 'jsonrpc': '2.0', 'method': 'force', 'params':
+                {'wk': '191622', 'wk-patch': RemoteAPI.url('/api/uploaded-file/1.dat'), 'build-request-id': '1', 'forcescheduler': 'force-ab-builds', 'checkbox': 'build-wk', 'build-wk': true, 'platform-name': 'some platform'}});
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 10);
-            assertAndResolveRequest(requests[7], 'GET', '/json/builders/some%20tester/pendingBuilds', []);
-            assertAndResolveRequest(requests[8], 'GET', '/json/builders/some%20builder/pendingBuilds',
-                [MockData.pendingBuild({builder: 'some builder', buildRequestId: 1})]);
-            assertAndResolveRequest(requests[9], 'GET', '/json/builders/other%20builder/pendingBuilds', []);
+            assertAndResolveRequest(requests[7], 'GET', MockData.pendingBuildsUrl('some tester'), {});
+            assertAndResolveRequest(requests[8], 'GET', MockData.pendingBuildsUrl('some builder'),
+                MockData.pendingBuild({builderId: MockData.builderIDForName('some builder'), buildRequestId: 1}));
+            assertAndResolveRequest(requests[9], 'GET', MockData.pendingBuildsUrl('other builder'), {});
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 13);
-            assertAndResolveRequest(requests[10], 'GET', '/json/builders/some%20tester/builds/?select=-1&select=-2', {});
-            assertAndResolveRequest(requests[11], 'GET', '/json/builders/some%20builder/builds/?select=-1&select=-2', {
-                [-1]: MockData.runningBuild({builder: 'some builder', buildRequestId: 1})
-            });
-            assertAndResolveRequest(requests[12], 'GET', '/json/builders/other%20builder/builds/?select=-1&select=-2', {});
+            assertAndResolveRequest(requests[10], 'GET', MockData.recentBuildsUrl('some tester', 2), {});
+            assertAndResolveRequest(requests[11], 'GET', MockData.recentBuildsUrl('some builder', 2),
+                MockData.runningBuild({builderId: MockData.builderIDForName('some builder'), buildRequestId: 1}));
+            assertAndResolveRequest(requests[12], 'GET', MockData.recentBuildsUrl('other builder', 2), {});
             return syncPromise;
         }).then(() => {
             return TestGroup.fetchForTask(taskId, true);
@@ -687,7 +687,7 @@ describe('sync-buildbot', function () {
             assert(buildRequest.isBuild());
             assert(!buildRequest.isTest());
             assert.equal(buildRequest.statusLabel(), 'Running');
-            assert.equal(buildRequest.statusUrl(), 'http://build.webkit.org/builders/some%20builder/builds/124');
+            assert.equal(buildRequest.statusUrl(), MockData.statusUrl('some builder', 124));
             assert.equal(buildRequest.buildId(), null);
 
             const commitSet = buildRequest.commitSet();
@@ -724,7 +724,7 @@ describe('sync-buildbot', function () {
             assert(buildRequest.isBuild());
             assert(!buildRequest.isTest());
             assert.equal(buildRequest.statusLabel(), 'Completed');
-            assert.equal(buildRequest.statusUrl(), 'http://build.webkit.org/builders/some%20builder/builds/124');
+            assert.equal(buildRequest.statusUrl(), MockData.statusUrl('some builder', 124));
             assert.notEqual(buildRequest.buildId(), null);
 
             const commitSet = buildRequest.commitSet();
@@ -752,42 +752,43 @@ describe('sync-buildbot', function () {
 
             MockRemoteAPI.reset();
             syncPromise = triggerable.initSyncers().then(() => triggerable.syncOnce());
-            assertAndResolveRequest(requests[0], 'GET', MockData.buildbotBuildersURLDeprecated(), MockData.mockBuildbotBuildersDeprecated());
+            assertAndResolveRequest(requests[0], 'GET', MockData.buildbotBuildersURL(), MockData.mockBuildbotBuilders());
             MockRemoteAPI.reset();
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 3);
-            assertAndResolveRequest(requests[0], 'GET', '/json/builders/some%20tester/pendingBuilds', []);
-            assertAndResolveRequest(requests[1], 'GET', '/json/builders/some%20builder/pendingBuilds', []);
-            assertAndResolveRequest(requests[2], 'GET', '/json/builders/other%20builder/pendingBuilds', []);
+            assertAndResolveRequest(requests[0], 'GET', MockData.pendingBuildsUrl('some tester'), {});
+            assertAndResolveRequest(requests[1], 'GET', MockData.pendingBuildsUrl('some builder'), {});
+            assertAndResolveRequest(requests[2], 'GET', MockData.pendingBuildsUrl('other builder'), {});
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 6);
-            assertAndResolveRequest(requests[3], 'GET', '/json/builders/some%20tester/builds/?select=-1&select=-2', {});
-            assertAndResolveRequest(requests[4], 'GET', '/json/builders/some%20builder/builds/?select=-1&select=-2', {
-                [-1]: MockData.finishedBuild({builder: 'some builder', buildRequestId: 1})
-            });
-            assertAndResolveRequest(requests[5], 'GET', '/json/builders/other%20builder/builds/?select=-1&select=-2', {});
+            assertAndResolveRequest(requests[3], 'GET', MockData.recentBuildsUrl('some tester', 2), {});
+            assertAndResolveRequest(requests[4], 'GET', MockData.recentBuildsUrl('some builder', 2),
+                MockData.finishedBuild({builderId: MockData.builderIDForName('some builder'), buildRequestId: 1}));
+            assertAndResolveRequest(requests[5], 'GET', MockData.recentBuildsUrl('other builder', 2), {});
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 7);
-            assertAndResolveRequest(requests[6], 'POST', '/builders/some%20builder/force', 'OK');
-            assert.deepEqual(requests[6].data, {'wk': '191622', 'build-request-id': '2', 'forcescheduler': 'force-ab-builds', 'checkbox': 'build-wk', 'build-wk': true, 'platform-name': 'some platform'});
+            assertAndResolveRequest(requests[6], 'POST', '/api/v2/forceschedulers/force-ab-builds', 'OK');
+            assert.deepEqual(requests[6].data, {'id': '2', 'jsonrpc': '2.0', 'method': 'force', 'params':
+                {'wk': '191622', 'build-request-id': '2', 'forcescheduler': 'force-ab-builds', 'checkbox': 'build-wk', 'build-wk': true, 'platform-name': 'some platform'}});
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 10);
-            assertAndResolveRequest(requests[7], 'GET', '/json/builders/some%20tester/pendingBuilds', []);
-            assertAndResolveRequest(requests[8], 'GET', '/json/builders/some%20builder/pendingBuilds', []);
-            assertAndResolveRequest(requests[9], 'GET', '/json/builders/other%20builder/pendingBuilds', []);
+            assertAndResolveRequest(requests[7], 'GET', MockData.pendingBuildsUrl('some tester'), {});
+            assertAndResolveRequest(requests[8], 'GET', MockData.pendingBuildsUrl('some builder'), {});
+            assertAndResolveRequest(requests[9], 'GET', MockData.pendingBuildsUrl('other builder'), {});
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 13);
-            assertAndResolveRequest(requests[10], 'GET', '/json/builders/some%20tester/builds/?select=-1&select=-2', {});
-            assertAndResolveRequest(requests[11], 'GET', '/json/builders/some%20builder/builds/?select=-1&select=-2', {
-                [-1]: MockData.runningBuild({builder: 'some builder', buildRequestId: 2}),
-                [-2]: MockData.finishedBuild({builder: 'some builder', buildRequestId: 1}),
+            assertAndResolveRequest(requests[10], 'GET', MockData.recentBuildsUrl('some tester', 2), {});
+            assertAndResolveRequest(requests[11], 'GET', MockData.recentBuildsUrl('some builder', 2), {
+                'builds': [
+                    MockData.runningBuildData({builderId: MockData.builderIDForName('some builder'), buildRequestId: 2}),
+                    MockData.finishedBuildData({builderId: MockData.builderIDForName('some builder'), buildRequestId: 1})]
             });
-            assertAndResolveRequest(requests[12], 'GET', '/json/builders/other%20builder/builds/?select=-1&select=-2', {});
+            assertAndResolveRequest(requests[12], 'GET', MockData.recentBuildsUrl('other builder', 2), {});
             return syncPromise;
         }).then(() => {
             return TestGroup.fetchForTask(taskId, true);
@@ -801,7 +802,7 @@ describe('sync-buildbot', function () {
             assert(buildRequest.isBuild());
             assert(!buildRequest.isTest());
             assert.equal(buildRequest.statusLabel(), 'Completed');
-            assert.equal(buildRequest.statusUrl(), 'http://build.webkit.org/builders/some%20builder/builds/124');
+            assert.equal(buildRequest.statusUrl(), MockData.statusUrl('some builder', 124));
             assert.notEqual(buildRequest.buildId(), null);
 
             const commitSet = buildRequest.commitSet();
@@ -818,7 +819,7 @@ describe('sync-buildbot', function () {
             assert(otherBuildRequest.isBuild());
             assert(!otherBuildRequest.isTest());
             assert.equal(otherBuildRequest.statusLabel(), 'Running');
-            assert.equal(otherBuildRequest.statusUrl(), 'http://build.webkit.org/builders/some%20builder/builds/124');
+            assert.equal(otherBuildRequest.statusUrl(), MockData.statusUrl('some builder', 124));
             assert.equal(otherBuildRequest.buildId(), null);
 
             const otherCommitSet = otherBuildRequest.commitSet();
@@ -840,7 +841,7 @@ describe('sync-buildbot', function () {
             assert(buildRequest.isBuild());
             assert(!buildRequest.isTest());
             assert.equal(buildRequest.statusLabel(), 'Completed');
-            assert.equal(buildRequest.statusUrl(), 'http://build.webkit.org/builders/some%20builder/builds/124');
+            assert.equal(buildRequest.statusUrl(), MockData.statusUrl('some builder', 124));
             assert.notEqual(buildRequest.buildId(), null);
 
             const commitSet = buildRequest.commitSet();
@@ -857,7 +858,7 @@ describe('sync-buildbot', function () {
             assert(otherBuildRequest.isBuild());
             assert(!otherBuildRequest.isTest());
             assert.equal(otherBuildRequest.statusLabel(), 'Completed');
-            assert.equal(otherBuildRequest.statusUrl(), 'http://build.webkit.org/builders/some%20builder/builds/124');
+            assert.equal(otherBuildRequest.statusUrl(), MockData.statusUrl('some builder', 124));
             assert.notEqual(otherBuildRequest.buildId(), null);
 
             const otherCommitSet = otherBuildRequest.commitSet();
@@ -928,46 +929,48 @@ describe('sync-buildbot', function () {
             assert.equal(otherRoots.length, 1);
             assert.deepEqual(otherRoots[0].filename(), 'root46.dat');
             syncPromise = triggerable.initSyncers().then(() => triggerable.syncOnce());
-            assertAndResolveRequest(requests[0], 'GET', MockData.buildbotBuildersURLDeprecated(), MockData.mockBuildbotBuildersDeprecated());
+            assertAndResolveRequest(requests[0], 'GET', MockData.buildbotBuildersURL(), MockData.mockBuildbotBuilders());
             MockRemoteAPI.reset();
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 3);
-            assertAndResolveRequest(requests[0], 'GET', '/json/builders/some%20tester/pendingBuilds', []);
-            assertAndResolveRequest(requests[1], 'GET', '/json/builders/some%20builder/pendingBuilds', []);
-            assertAndResolveRequest(requests[2], 'GET', '/json/builders/other%20builder/pendingBuilds', []);
+            assertAndResolveRequest(requests[0], 'GET', MockData.pendingBuildsUrl('some tester'), {});
+            assertAndResolveRequest(requests[1], 'GET', MockData.pendingBuildsUrl('some builder'), {});
+            assertAndResolveRequest(requests[2], 'GET', MockData.pendingBuildsUrl('other builder'), {});
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 6);
-            assertAndResolveRequest(requests[3], 'GET', '/json/builders/some%20tester/builds/?select=-1&select=-2', {});
-            assertAndResolveRequest(requests[4], 'GET', '/json/builders/some%20builder/builds/?select=-1&select=-2', {
-                [-1]: MockData.finishedBuild({builder: 'some builder', buildRequestId: 1}),
-                [-2]: MockData.finishedBuild({builder: 'some builder', buildRequestId: 2}),
+            assertAndResolveRequest(requests[3], 'GET', MockData.recentBuildsUrl('some tester', 2), {});
+            assertAndResolveRequest(requests[4], 'GET', MockData.recentBuildsUrl('some builder', 2), {
+                'builds': [
+                    MockData.finishedBuildData({builderId: MockData.builderIDForName('some builder'), buildRequestId: 1}),
+                    MockData.finishedBuildData({builderId: MockData.builderIDForName('some builder'), buildRequestId: 2})]
             });
-            assertAndResolveRequest(requests[5], 'GET', '/json/builders/other%20builder/builds/?select=-1&select=-2', {});
+            assertAndResolveRequest(requests[5], 'GET', MockData.recentBuildsUrl('other builder', 2), {});
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 7);
-            assertAndResolveRequest(requests[6], 'POST', '/builders/some%20tester/force', 'OK');
-            assert.deepEqual(requests[6].data, {'test': 'some-test', 'wk': '191622', 'build-request-id': '3', 'forcescheduler': 'force-ab-tests',
-                'roots': JSON.stringify([{url: firstRoot.url()}])});
+            assertAndResolveRequest(requests[6], 'POST', '/api/v2/forceschedulers/force-ab-tests', 'OK');
+            assert.deepEqual(requests[6].data, {'id': '3', 'jsonrpc': '2.0', 'method': 'force', 'params':
+                {'test': 'some-test', 'wk': '191622', 'build-request-id': '3','forcescheduler': 'force-ab-tests', 'roots': JSON.stringify([{url: firstRoot.url()}])}});
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 10);
-            assertAndResolveRequest(requests[7], 'GET', '/json/builders/some%20tester/pendingBuilds', [
-                MockData.pendingBuild({builder: 'some tester', buildRequestId: 3}),
+            assertAndResolveRequest(requests[7], 'GET', MockData.pendingBuildsUrl('some tester'), [
+                MockData.pendingBuild({builderId: MockData.builderIDForName('some tester'), buildRequestId: 3}),
             ]);
-            assertAndResolveRequest(requests[8], 'GET', '/json/builders/some%20builder/pendingBuilds', []);
-            assertAndResolveRequest(requests[9], 'GET', '/json/builders/other%20builder/pendingBuilds', []);
+            assertAndResolveRequest(requests[8], 'GET', MockData.pendingBuildsUrl('some builder'), {});
+            assertAndResolveRequest(requests[9], 'GET', MockData.pendingBuildsUrl('other builder'), {});
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 13);
-            assertAndResolveRequest(requests[10], 'GET', '/json/builders/some%20tester/builds/?select=-1&select=-2', {});
-            assertAndResolveRequest(requests[11], 'GET', '/json/builders/some%20builder/builds/?select=-1&select=-2', {
-                [-1]: MockData.finishedBuild({builder: 'some builder', buildRequestId: 1}),
-                [-2]: MockData.finishedBuild({builder: 'some builder', buildRequestId: 2}),
+            assertAndResolveRequest(requests[10], 'GET', MockData.recentBuildsUrl('some tester', 2), {});
+            assertAndResolveRequest(requests[11], 'GET', MockData.recentBuildsUrl('some builder', 2), {
+                'builds': [
+                    MockData.finishedBuildData({builderId: MockData.builderIDForName('some builder'), buildRequestId: 1}),
+                    MockData.finishedBuildData({builderId: MockData.builderIDForName('some builder'), buildRequestId: 2})]
             });
-            assertAndResolveRequest(requests[12], 'GET', '/json/builders/other%20builder/builds/?select=-1&select=-2', {});
+            assertAndResolveRequest(requests[12], 'GET', MockData.recentBuildsUrl('other builder', 2), {});
             return syncPromise;
         });
     });
@@ -1001,38 +1004,41 @@ describe('sync-buildbot', function () {
             assert.equal(otherBuildRequest.buildId(), null);
 
             syncPromise = triggerable.initSyncers().then(() => triggerable.syncOnce());
-            assertAndResolveRequest(requests[0], 'GET', MockData.buildbotBuildersURLDeprecated(), MockData.mockBuildbotBuildersDeprecated());
+            assertAndResolveRequest(requests[0], 'GET', MockData.buildbotBuildersURL(), MockData.mockBuildbotBuilders());
             MockRemoteAPI.reset();
             return Promise.all([MockRemoteAPI.waitForRequest(), uploadRoot(1, 123)]);
         }).then(() => {
             assert.equal(requests.length, 3);
-            assertAndResolveRequest(requests[0], 'GET', '/json/builders/some%20tester/pendingBuilds', []);
-            assertAndResolveRequest(requests[1], 'GET', '/json/builders/some%20builder/pendingBuilds', []);
-            assertAndResolveRequest(requests[2], 'GET', '/json/builders/other%20builder/pendingBuilds', []);
+            assertAndResolveRequest(requests[0], 'GET', MockData.pendingBuildsUrl('some tester'), {});
+            assertAndResolveRequest(requests[1], 'GET', MockData.pendingBuildsUrl('some builder'), {});
+            assertAndResolveRequest(requests[2], 'GET', MockData.pendingBuildsUrl('other builder'), {});
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 6);
-            assertAndResolveRequest(requests[3], 'GET', '/json/builders/some%20tester/builds/?select=-1&select=-2', {});
-            assertAndResolveRequest(requests[4], 'GET', '/json/builders/some%20builder/builds/?select=-1&select=-2', {
-                [-1]: MockData.runningBuild({builder: 'some builder', buildRequestId: 2}),
-                [-2]: MockData.finishedBuild({builder: 'some builder', buildRequestId: 1}),
+            assertAndResolveRequest(requests[3], 'GET', MockData.recentBuildsUrl('some tester', 2), {});
+            assertAndResolveRequest(requests[4], 'GET', MockData.recentBuildsUrl('some builder', 2), {
+                'builds': [
+                    MockData.runningBuildData({builderId: MockData.builderIDForName('some builder'), buildRequestId: 2}),
+                    MockData.finishedBuildData({builderId: MockData.builderIDForName('some builder'), buildRequestId: 1})
+                ]
             });
-            assertAndResolveRequest(requests[5], 'GET', '/json/builders/other%20builder/builds/?select=-1&select=-2', {});
+            assertAndResolveRequest(requests[5], 'GET', MockData.recentBuildsUrl('other builder', 2), {});
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 9);
-            assertAndResolveRequest(requests[6], 'GET', '/json/builders/some%20tester/pendingBuilds', []);
-            assertAndResolveRequest(requests[7], 'GET', '/json/builders/some%20builder/pendingBuilds', []);
-            assertAndResolveRequest(requests[8], 'GET', '/json/builders/other%20builder/pendingBuilds', []);
+            assertAndResolveRequest(requests[6], 'GET', MockData.pendingBuildsUrl('some tester'), {});
+            assertAndResolveRequest(requests[7], 'GET', MockData.pendingBuildsUrl('some builder'), {});
+            assertAndResolveRequest(requests[8], 'GET', MockData.pendingBuildsUrl('other builder'), {});
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 12);
-            assertAndResolveRequest(requests[9], 'GET', '/json/builders/some%20tester/builds/?select=-1&select=-2', {});
-            assertAndResolveRequest(requests[10], 'GET', '/json/builders/some%20builder/builds/?select=-1&select=-2', {
-                [-1]: MockData.runningBuild({builder: 'some builder', buildRequestId: 2, buildNumber: 1002}),
-                [-2]: MockData.finishedBuild({builder: 'some builder', buildRequestId: 1}),
+            assertAndResolveRequest(requests[9], 'GET', MockData.recentBuildsUrl('some tester', 2), {});
+            assertAndResolveRequest(requests[10], 'GET', MockData.recentBuildsUrl('some builder', 2), {
+                'builds': [
+                     MockData.runningBuildData({builderId: MockData.builderIDForName('some builder'), buildRequestId: 2, buildNumber: 1002}),
+                     MockData.finishedBuildData({builderId: MockData.builderIDForName('some builder'), buildRequestId: 1})]
             });
-            assertAndResolveRequest(requests[11], 'GET', '/json/builders/other%20builder/builds/?select=-1&select=-2', {});
+            assertAndResolveRequest(requests[11], 'GET', MockData.recentBuildsUrl('other builder', 2), {});
             return syncPromise;
         }).then(() => {
             return TestGroup.fetchForTask(taskId, true);
@@ -1053,7 +1059,7 @@ describe('sync-buildbot', function () {
             assert(otherBuildRequest.isBuild());
             assert(!otherBuildRequest.isTest());
             assert.equal(otherBuildRequest.statusLabel(), 'Running');
-            assert.equal(otherBuildRequest.statusUrl(), 'http://build.webkit.org/builders/some%20builder/builds/1002');
+            assert.equal(otherBuildRequest.statusUrl(), MockData.statusUrl('some builder', 1002));
             assert.equal(otherBuildRequest.buildId(), null);
         });
     });
@@ -1087,36 +1093,34 @@ describe('sync-buildbot', function () {
             assert.equal(otherBuildRequest.buildId(), null);
 
             syncPromise = triggerable.initSyncers().then(() => triggerable.syncOnce());
-            assertAndResolveRequest(requests[0], 'GET', MockData.buildbotBuildersURLDeprecated(), MockData.mockBuildbotBuildersDeprecated());
+            assertAndResolveRequest(requests[0], 'GET', MockData.buildbotBuildersURL(), MockData.mockBuildbotBuilders());
             MockRemoteAPI.reset();
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 3);
-            assertAndResolveRequest(requests[0], 'GET', '/json/builders/some%20tester/pendingBuilds', []);
-            assertAndResolveRequest(requests[1], 'GET', '/json/builders/some%20builder/pendingBuilds', []);
-            assertAndResolveRequest(requests[2], 'GET', '/json/builders/other%20builder/pendingBuilds', []);
+            assertAndResolveRequest(requests[0], 'GET', MockData.pendingBuildsUrl('some tester'), {});
+            assertAndResolveRequest(requests[1], 'GET', MockData.pendingBuildsUrl('some builder'), {});
+            assertAndResolveRequest(requests[2], 'GET', MockData.pendingBuildsUrl('other builder'), {});
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 6);
-            assertAndResolveRequest(requests[3], 'GET', '/json/builders/some%20tester/builds/?select=-1&select=-2', {});
-            assertAndResolveRequest(requests[4], 'GET', '/json/builders/some%20builder/builds/?select=-1&select=-2', {});
-            assertAndResolveRequest(requests[5], 'GET', '/json/builders/other%20builder/builds/?select=-1&select=-2', {
-                [-1]: MockData.finishedBuild({builder: 'other builder', buildRequestId: 1, buildNumber: 312}),
-            });
+            assertAndResolveRequest(requests[3], 'GET', MockData.recentBuildsUrl('some tester', 2), {});
+            assertAndResolveRequest(requests[4], 'GET', MockData.recentBuildsUrl('some builder', 2), {});
+            assertAndResolveRequest(requests[5], 'GET', MockData.recentBuildsUrl('other builder', 2),
+                MockData.finishedBuild({builderId: MockData.builderIDForName('other builder'), buildRequestId: 1, buildNumber: 312}));
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 9);
-            assertAndResolveRequest(requests[6], 'GET', '/json/builders/some%20tester/pendingBuilds', []);
-            assertAndResolveRequest(requests[7], 'GET', '/json/builders/some%20builder/pendingBuilds', []);
-            assertAndResolveRequest(requests[8], 'GET', '/json/builders/other%20builder/pendingBuilds', []);
+            assertAndResolveRequest(requests[6], 'GET', MockData.pendingBuildsUrl('some tester'), {});
+            assertAndResolveRequest(requests[7], 'GET', MockData.pendingBuildsUrl('some builder'), {});
+            assertAndResolveRequest(requests[8], 'GET', MockData.pendingBuildsUrl('other builder'), {});
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 12);
-            assertAndResolveRequest(requests[9], 'GET', '/json/builders/some%20tester/builds/?select=-1&select=-2', {});
-            assertAndResolveRequest(requests[10], 'GET', '/json/builders/some%20builder/builds/?select=-1&select=-2', {});
-            assertAndResolveRequest(requests[11], 'GET', '/json/builders/other%20builder/builds/?select=-1&select=-2', {
-                [-1]: MockData.finishedBuild({builder: 'other builder', buildRequestId: 1, buildNumber: 312}),
-            });
+            assertAndResolveRequest(requests[9], 'GET', MockData.recentBuildsUrl('some tester', 2), {});
+            assertAndResolveRequest(requests[10], 'GET', MockData.recentBuildsUrl('some builder', 2), {});
+            assertAndResolveRequest(requests[11], 'GET', MockData.recentBuildsUrl('other builder', 2),
+                MockData.finishedBuild({builderId: MockData.builderIDForName('other builder'), buildRequestId: 1, buildNumber: 312}));
             return syncPromise;
         }).then(() => {
             return TestGroup.fetchForTask(taskId, true);
@@ -1127,7 +1131,7 @@ describe('sync-buildbot', function () {
             assert(buildReqeusts[0].isBuild());
             assert(!buildReqeusts[0].isTest());
             assert.equal(buildReqeusts[0].statusLabel(), 'Failed');
-            assert.equal(buildReqeusts[0].statusUrl(), 'http://build.webkit.org/builders/other%20builder/builds/312');
+            assert.equal(buildReqeusts[0].statusUrl(), MockData.statusUrl('other builder', 312));
             assert.equal(buildReqeusts[0].buildId(), null);
 
             assert(buildReqeusts[1].isBuild());
@@ -1195,40 +1199,40 @@ describe('sync-buildbot', function () {
             assert.deepEqual(otherCommitSet.allRootFiles(), []);
 
             syncPromise = triggerable.initSyncers().then(() => triggerable.syncOnce());
-            assertAndResolveRequest(requests[0], 'GET', MockData.buildbotBuildersURLDeprecated(), MockData.mockBuildbotBuildersDeprecated());
+            assertAndResolveRequest(requests[0], 'GET', MockData.buildbotBuildersURL(), MockData.mockBuildbotBuilders());
             MockRemoteAPI.reset();
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 3);
-            assertAndResolveRequest(requests[0], 'GET', '/json/builders/some%20tester/pendingBuilds', []);
-            assertAndResolveRequest(requests[1], 'GET', '/json/builders/some%20builder/pendingBuilds', []);
-            assertAndResolveRequest(requests[2], 'GET', '/json/builders/other%20builder/pendingBuilds', []);
+            assertAndResolveRequest(requests[0], 'GET', MockData.pendingBuildsUrl('some tester'), {});
+            assertAndResolveRequest(requests[1], 'GET', MockData.pendingBuildsUrl('some builder'), {});
+            assertAndResolveRequest(requests[2], 'GET', MockData.pendingBuildsUrl('other builder'), {});
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 6);
-            assertAndResolveRequest(requests[3], 'GET', '/json/builders/some%20tester/builds/?select=-1&select=-2', {});
-            assertAndResolveRequest(requests[4], 'GET', '/json/builders/some%20builder/builds/?select=-1&select=-2', {});
-            assertAndResolveRequest(requests[5], 'GET', '/json/builders/other%20builder/builds/?select=-1&select=-2', {});
+            assertAndResolveRequest(requests[3], 'GET', MockData.recentBuildsUrl('some tester', 2), {});
+            assertAndResolveRequest(requests[4], 'GET', MockData.recentBuildsUrl('some builder', 2), {});
+            assertAndResolveRequest(requests[5], 'GET', MockData.recentBuildsUrl('other builder', 2), {});
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 7);
-            assertAndResolveRequest(requests[6], 'POST', '/builders/some%20builder/force', 'OK');
-            assert.deepEqual(requests[6].data, {'wk': '191622', 'build-request-id': '1', 'forcescheduler': 'force-ab-builds', 'owned-commits': `{"WebKit":[{"revision":"owned-jsc-6161","repository":"JavaScriptCore","ownerRevision":"191622"}]}`});
+            assertAndResolveRequest(requests[6], 'POST', '/api/v2/forceschedulers/force-ab-builds', 'OK');
+            assert.deepEqual(requests[6].data, {'id': '1', 'jsonrpc': '2.0', 'method': 'force', 'params':
+                {'wk': '191622', 'build-request-id': '1', 'forcescheduler': 'force-ab-builds', 'owned-commits': `{"WebKit":[{"revision":"owned-jsc-6161","repository":"JavaScriptCore","ownerRevision":"191622"}]}`}});
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 10);
-            assertAndResolveRequest(requests[7], 'GET', '/json/builders/some%20tester/pendingBuilds', []);
-            assertAndResolveRequest(requests[8], 'GET', '/json/builders/some%20builder/pendingBuilds',
-                [MockData.pendingBuild({builder: 'some builder', buildRequestId: 1})]);
-            assertAndResolveRequest(requests[9], 'GET', '/json/builders/other%20builder/pendingBuilds', []);
+            assertAndResolveRequest(requests[7], 'GET', MockData.pendingBuildsUrl('some tester'), {});
+            assertAndResolveRequest(requests[8], 'GET', MockData.pendingBuildsUrl('some builder'),
+                MockData.pendingBuild({builderId: MockData.builderIDForName('some builder'), buildRequestId: 1}));
+            assertAndResolveRequest(requests[9], 'GET', MockData.pendingBuildsUrl('other builder'), {});
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 13);
-            assertAndResolveRequest(requests[10], 'GET', '/json/builders/some%20tester/builds/?select=-1&select=-2', {});
-            assertAndResolveRequest(requests[11], 'GET', '/json/builders/some%20builder/builds/?select=-1&select=-2', {
-                [-1]: MockData.runningBuild({builder: 'some builder', buildRequestId: 1})
-            });
-            assertAndResolveRequest(requests[12], 'GET', '/json/builders/other%20builder/builds/?select=-1&select=-2', {});
+            assertAndResolveRequest(requests[10], 'GET', MockData.recentBuildsUrl('some tester', 2), {});
+            assertAndResolveRequest(requests[11], 'GET', MockData.recentBuildsUrl('some builder', 2),
+                MockData.runningBuild({builderId: MockData.builderIDForName('some builder'), buildRequestId: 1}));
+            assertAndResolveRequest(requests[12], 'GET', MockData.recentBuildsUrl('other builder', 2), {});
             return syncPromise;
         }).then(() => {
             return TestGroup.fetchForTask(taskId, true);
@@ -1243,7 +1247,7 @@ describe('sync-buildbot', function () {
             assert(buildRequest.isBuild());
             assert(!buildRequest.isTest());
             assert.equal(buildRequest.statusLabel(), 'Running');
-            assert.equal(buildRequest.statusUrl(), 'http://build.webkit.org/builders/some%20builder/builds/124');
+            assert.equal(buildRequest.statusUrl(), MockData.statusUrl('some builder', 124));
             assert.equal(buildRequest.buildId(), null);
 
             const commitSet = buildRequest.commitSet();
@@ -1283,7 +1287,7 @@ describe('sync-buildbot', function () {
             assert(buildRequest.isBuild());
             assert(!buildRequest.isTest());
             assert.equal(buildRequest.statusLabel(), 'Completed');
-            assert.equal(buildRequest.statusUrl(), 'http://build.webkit.org/builders/some%20builder/builds/124');
+            assert.equal(buildRequest.statusUrl(), MockData.statusUrl('some builder', 124));
             assert.notEqual(buildRequest.buildId(), null);
 
             const commitSet = buildRequest.commitSet();
@@ -1316,42 +1320,43 @@ describe('sync-buildbot', function () {
 
             MockRemoteAPI.reset();
             syncPromise = triggerable.initSyncers().then(() => triggerable.syncOnce());
-            assertAndResolveRequest(requests[0], 'GET', MockData.buildbotBuildersURLDeprecated(), MockData.mockBuildbotBuildersDeprecated());
+            assertAndResolveRequest(requests[0], 'GET', MockData.buildbotBuildersURL(), MockData.mockBuildbotBuilders());
             MockRemoteAPI.reset();
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 3);
-            assertAndResolveRequest(requests[0], 'GET', '/json/builders/some%20tester/pendingBuilds', []);
-            assertAndResolveRequest(requests[1], 'GET', '/json/builders/some%20builder/pendingBuilds', []);
-            assertAndResolveRequest(requests[2], 'GET', '/json/builders/other%20builder/pendingBuilds', []);
+            assertAndResolveRequest(requests[0], 'GET', MockData.pendingBuildsUrl('some tester'), {});
+            assertAndResolveRequest(requests[1], 'GET', MockData.pendingBuildsUrl('some builder'), {});
+            assertAndResolveRequest(requests[2], 'GET', MockData.pendingBuildsUrl('other builder'), {});
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 6);
-            assertAndResolveRequest(requests[3], 'GET', '/json/builders/some%20tester/builds/?select=-1&select=-2', {});
-            assertAndResolveRequest(requests[4], 'GET', '/json/builders/some%20builder/builds/?select=-1&select=-2', {
-                [-1]: MockData.finishedBuild({builder: 'some builder', buildRequestId: 1})
-            });
-            assertAndResolveRequest(requests[5], 'GET', '/json/builders/other%20builder/builds/?select=-1&select=-2', {});
+            assertAndResolveRequest(requests[3], 'GET', MockData.recentBuildsUrl('some tester', 2), {});
+            assertAndResolveRequest(requests[4], 'GET', MockData.recentBuildsUrl('some builder', 2),
+                MockData.finishedBuild({builderId: MockData.builderIDForName('some builder'), buildRequestId: 1}));
+            assertAndResolveRequest(requests[5], 'GET', MockData.recentBuildsUrl('other builder', 2), {});
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 7);
-            assertAndResolveRequest(requests[6], 'POST', '/builders/some%20builder/force', 'OK');
-            assert.deepEqual(requests[6].data, {'wk': '192736', 'build-request-id': '2', 'forcescheduler': 'force-ab-builds', 'owned-commits': `{"WebKit":[{"revision":"owned-jsc-9191","repository":"JavaScriptCore","ownerRevision":"192736"}]}`});
+            assertAndResolveRequest(requests[6], 'POST', '/api/v2/forceschedulers/force-ab-builds', 'OK');
+            assert.deepEqual(requests[6].data, {'id': '2', 'jsonrpc': '2.0', 'method': 'force', 'params':
+                {'wk': '192736', 'build-request-id': '2', 'forcescheduler': 'force-ab-builds', 'owned-commits': `{"WebKit":[{"revision":"owned-jsc-9191","repository":"JavaScriptCore","ownerRevision":"192736"}]}`}});
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 10);
-            assertAndResolveRequest(requests[7], 'GET', '/json/builders/some%20tester/pendingBuilds', []);
-            assertAndResolveRequest(requests[8], 'GET', '/json/builders/some%20builder/pendingBuilds', []);
-            assertAndResolveRequest(requests[9], 'GET', '/json/builders/other%20builder/pendingBuilds', []);
+            assertAndResolveRequest(requests[7], 'GET', MockData.pendingBuildsUrl('some tester'), {});
+            assertAndResolveRequest(requests[8], 'GET', MockData.pendingBuildsUrl('some builder'), {});
+            assertAndResolveRequest(requests[9], 'GET', MockData.pendingBuildsUrl('other builder'), {});
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 13);
-            assertAndResolveRequest(requests[10], 'GET', '/json/builders/some%20tester/builds/?select=-1&select=-2', {});
-            assertAndResolveRequest(requests[11], 'GET', '/json/builders/some%20builder/builds/?select=-1&select=-2', {
-                [-1]: MockData.runningBuild({builder: 'some builder', buildRequestId: 2}),
-                [-2]: MockData.finishedBuild({builder: 'some builder', buildRequestId: 1}),
+            assertAndResolveRequest(requests[10], 'GET', MockData.recentBuildsUrl('some tester', 2), {});
+            assertAndResolveRequest(requests[11], 'GET', MockData.recentBuildsUrl('some builder', 2), {
+                'builds': [
+                    MockData.runningBuildData({builderId: MockData.builderIDForName('some builder'), buildRequestId: 2}),
+                    MockData.finishedBuildData({builderId: MockData.builderIDForName('some builder'), buildRequestId: 1})]
             });
-            assertAndResolveRequest(requests[12], 'GET', '/json/builders/other%20builder/builds/?select=-1&select=-2', {});
+            assertAndResolveRequest(requests[12], 'GET', MockData.recentBuildsUrl('other builder', 2), {});
             return syncPromise;
         }).then(() => {
             return TestGroup.fetchForTask(taskId, true);
@@ -1366,7 +1371,7 @@ describe('sync-buildbot', function () {
             assert(buildRequest.isBuild());
             assert(!buildRequest.isTest());
             assert.equal(buildRequest.statusLabel(), 'Completed');
-            assert.equal(buildRequest.statusUrl(), 'http://build.webkit.org/builders/some%20builder/builds/124');
+            assert.equal(buildRequest.statusUrl(), MockData.statusUrl('some builder', 124));
             assert.notEqual(buildRequest.buildId(), null);
 
             const commitSet = buildRequest.commitSet();
@@ -1386,7 +1391,7 @@ describe('sync-buildbot', function () {
             assert(otherBuildRequest.isBuild());
             assert(!otherBuildRequest.isTest());
             assert.equal(otherBuildRequest.statusLabel(), 'Running');
-            assert.equal(otherBuildRequest.statusUrl(), 'http://build.webkit.org/builders/some%20builder/builds/124');
+            assert.equal(otherBuildRequest.statusUrl(), MockData.statusUrl('some builder', 124));
             assert.equal(otherBuildRequest.buildId(), null);
 
             const otherCommitSet = otherBuildRequest.commitSet();
@@ -1411,7 +1416,7 @@ describe('sync-buildbot', function () {
             assert(buildRequest.isBuild());
             assert(!buildRequest.isTest());
             assert.equal(buildRequest.statusLabel(), 'Completed');
-            assert.equal(buildRequest.statusUrl(), 'http://build.webkit.org/builders/some%20builder/builds/124');
+            assert.equal(buildRequest.statusUrl(), MockData.statusUrl('some builder', 124));
             assert.notEqual(buildRequest.buildId(), null);
 
             const commitSet = buildRequest.commitSet();
@@ -1431,7 +1436,7 @@ describe('sync-buildbot', function () {
             assert(otherBuildRequest.isBuild());
             assert(!otherBuildRequest.isTest());
             assert.equal(otherBuildRequest.statusLabel(), 'Completed');
-            assert.equal(otherBuildRequest.statusUrl(), 'http://build.webkit.org/builders/some%20builder/builds/124');
+            assert.equal(otherBuildRequest.statusUrl(), MockData.statusUrl('some builder', 124));
             assert.notEqual(otherBuildRequest.buildId(), null);
 
             const otherCommitSet = otherBuildRequest.commitSet();
@@ -1494,40 +1499,40 @@ describe('sync-buildbot', function () {
             assert.deepEqual(otherCommitSet.allRootFiles(), []);
 
             syncPromise = triggerable.initSyncers().then(() => triggerable.syncOnce());
-            assertAndResolveRequest(requests[0], 'GET', MockData.buildbotBuildersURLDeprecated(), MockData.mockBuildbotBuildersDeprecated());
+            assertAndResolveRequest(requests[0], 'GET', MockData.buildbotBuildersURL(), MockData.mockBuildbotBuilders());
             MockRemoteAPI.reset();
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 3);
-            assertAndResolveRequest(requests[0], 'GET', '/json/builders/some%20tester/pendingBuilds', []);
-            assertAndResolveRequest(requests[1], 'GET', '/json/builders/some%20builder/pendingBuilds', []);
-            assertAndResolveRequest(requests[2], 'GET', '/json/builders/other%20builder/pendingBuilds', []);
+            assertAndResolveRequest(requests[0], 'GET', MockData.pendingBuildsUrl('some tester'), {});
+            assertAndResolveRequest(requests[1], 'GET', MockData.pendingBuildsUrl('some builder'), {});
+            assertAndResolveRequest(requests[2], 'GET', MockData.pendingBuildsUrl('other builder'), {});
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 6);
-            assertAndResolveRequest(requests[3], 'GET', '/json/builders/some%20tester/builds/?select=-1&select=-2', {});
-            assertAndResolveRequest(requests[4], 'GET', '/json/builders/some%20builder/builds/?select=-1&select=-2', {});
-            assertAndResolveRequest(requests[5], 'GET', '/json/builders/other%20builder/builds/?select=-1&select=-2', {});
+            assertAndResolveRequest(requests[3], 'GET', MockData.recentBuildsUrl('some tester', 2), {});
+            assertAndResolveRequest(requests[4], 'GET', MockData.recentBuildsUrl('some builder', 2), {});
+            assertAndResolveRequest(requests[5], 'GET', MockData.recentBuildsUrl('other builder', 2), {});
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 7);
-            assertAndResolveRequest(requests[6], 'POST', '/builders/some%20builder/force', 'OK');
-            assert.deepEqual(requests[6].data, {'wk': '191622', 'build-request-id': '1', 'forcescheduler': 'force-ab-builds', 'owned-commits': `{"WebKit":[{"revision":"owned-jsc-6161","repository":"JavaScriptCore","ownerRevision":"191622"}]}`});
+            assertAndResolveRequest(requests[6], 'POST', '/api/v2/forceschedulers/force-ab-builds', 'OK');
+            assert.deepEqual(requests[6].data, {'id': '1', 'jsonrpc': '2.0', 'method': 'force', 'params':
+                {'wk': '191622', 'build-request-id': '1', 'forcescheduler': 'force-ab-builds', 'owned-commits': `{"WebKit":[{"revision":"owned-jsc-6161","repository":"JavaScriptCore","ownerRevision":"191622"}]}`}});
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 10);
-            assertAndResolveRequest(requests[7], 'GET', '/json/builders/some%20tester/pendingBuilds', []);
-            assertAndResolveRequest(requests[8], 'GET', '/json/builders/some%20builder/pendingBuilds',
-                [MockData.pendingBuild({builder: 'some builder', buildRequestId: 1})]);
-            assertAndResolveRequest(requests[9], 'GET', '/json/builders/other%20builder/pendingBuilds', []);
+            assertAndResolveRequest(requests[7], 'GET', MockData.pendingBuildsUrl('some tester'), {});
+            assertAndResolveRequest(requests[8], 'GET', MockData.pendingBuildsUrl('some builder'),
+                MockData.pendingBuild({builderId: MockData.builderIDForName('some builder'), buildRequestId: 1}));
+            assertAndResolveRequest(requests[9], 'GET', MockData.pendingBuildsUrl('other builder'), {});
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 13);
-            assertAndResolveRequest(requests[10], 'GET', '/json/builders/some%20tester/builds/?select=-1&select=-2', {});
-            assertAndResolveRequest(requests[11], 'GET', '/json/builders/some%20builder/builds/?select=-1&select=-2', {
-                [-1]: MockData.runningBuild({builder: 'some builder', buildRequestId: 1})
-            });
-            assertAndResolveRequest(requests[12], 'GET', '/json/builders/other%20builder/builds/?select=-1&select=-2', {});
+            assertAndResolveRequest(requests[10], 'GET', MockData.recentBuildsUrl('some tester', 2), {});
+            assertAndResolveRequest(requests[11], 'GET', MockData.recentBuildsUrl('some builder', 2),
+                MockData.runningBuild({builderId: MockData.builderIDForName('some builder'), buildRequestId: 1}));
+            assertAndResolveRequest(requests[12], 'GET', MockData.recentBuildsUrl('other builder', 2), {});
             return syncPromise;
         }).then(() => {
             return TestGroup.fetchForTask(taskId, true);
@@ -1542,7 +1547,7 @@ describe('sync-buildbot', function () {
             assert(buildRequest.isBuild());
             assert(!buildRequest.isTest());
             assert.equal(buildRequest.statusLabel(), 'Running');
-            assert.equal(buildRequest.statusUrl(), 'http://build.webkit.org/builders/some%20builder/builds/124');
+            assert.equal(buildRequest.statusUrl(), MockData.statusUrl('some builder', 124));
             assert.equal(buildRequest.buildId(), null);
 
             const commitSet = buildRequest.commitSet();
@@ -1582,7 +1587,7 @@ describe('sync-buildbot', function () {
             assert(buildRequest.isBuild());
             assert(!buildRequest.isTest());
             assert.equal(buildRequest.statusLabel(), 'Running');
-            assert.equal(buildRequest.statusUrl(), 'http://build.webkit.org/builders/some%20builder/builds/124');
+            assert.equal(buildRequest.statusUrl(), MockData.statusUrl('some builder', 124));
             assert.equal(buildRequest.buildId(), null);
 
             const commitSet = buildRequest.commitSet();
@@ -1623,7 +1628,7 @@ describe('sync-buildbot', function () {
             assert(buildRequest.isBuild());
             assert(!buildRequest.isTest());
             assert.equal(buildRequest.statusLabel(), 'Completed');
-            assert.equal(buildRequest.statusUrl(), 'http://build.webkit.org/builders/some%20builder/builds/124');
+            assert.equal(buildRequest.statusUrl(), MockData.statusUrl('some builder', 124));
             assert.notEqual(buildRequest.buildId(), null);
 
             const commitSet = buildRequest.commitSet();
@@ -1656,42 +1661,43 @@ describe('sync-buildbot', function () {
 
             MockRemoteAPI.reset();
             syncPromise = triggerable.initSyncers().then(() => triggerable.syncOnce());
-            assertAndResolveRequest(requests[0], 'GET', MockData.buildbotBuildersURLDeprecated(), MockData.mockBuildbotBuildersDeprecated());
+            assertAndResolveRequest(requests[0], 'GET', MockData.buildbotBuildersURL(), MockData.mockBuildbotBuilders());
             MockRemoteAPI.reset();
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 3);
-            assertAndResolveRequest(requests[0], 'GET', '/json/builders/some%20tester/pendingBuilds', []);
-            assertAndResolveRequest(requests[1], 'GET', '/json/builders/some%20builder/pendingBuilds', []);
-            assertAndResolveRequest(requests[2], 'GET', '/json/builders/other%20builder/pendingBuilds', []);
+            assertAndResolveRequest(requests[0], 'GET', MockData.pendingBuildsUrl('some tester'), {});
+            assertAndResolveRequest(requests[1], 'GET', MockData.pendingBuildsUrl('some builder'), {});
+            assertAndResolveRequest(requests[2], 'GET', MockData.pendingBuildsUrl('other builder'), {});
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 6);
-            assertAndResolveRequest(requests[3], 'GET', '/json/builders/some%20tester/builds/?select=-1&select=-2', {});
-            assertAndResolveRequest(requests[4], 'GET', '/json/builders/some%20builder/builds/?select=-1&select=-2', {
-                [-1]: MockData.finishedBuild({builder: 'some builder', buildRequestId: 1})
-            });
-            assertAndResolveRequest(requests[5], 'GET', '/json/builders/other%20builder/builds/?select=-1&select=-2', {});
+            assertAndResolveRequest(requests[3], 'GET', MockData.recentBuildsUrl('some tester', 2), {});
+            assertAndResolveRequest(requests[4], 'GET', MockData.recentBuildsUrl('some builder', 2),
+                MockData.finishedBuild({builderId: MockData.builderIDForName('some builder'), buildRequestId: 1}));
+            assertAndResolveRequest(requests[5], 'GET', MockData.recentBuildsUrl('other builder', 2), {});
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 7);
-            assertAndResolveRequest(requests[6], 'POST', '/builders/some%20builder/force', 'OK');
-            assert.deepEqual(requests[6].data, {'wk': '192736', 'build-request-id': '2', 'forcescheduler': 'force-ab-builds', 'owned-commits': `{"WebKit":[{"revision":"owned-jsc-9191","repository":"JavaScriptCore","ownerRevision":"192736"}]}`});
+            assertAndResolveRequest(requests[6], 'POST', '/api/v2/forceschedulers/force-ab-builds', 'OK');
+            assert.deepEqual(requests[6].data, {'id': '2', 'jsonrpc': '2.0', 'method': 'force', 'params':
+                {'wk': '192736', 'build-request-id': '2', 'forcescheduler': 'force-ab-builds', 'owned-commits': `{"WebKit":[{"revision":"owned-jsc-9191","repository":"JavaScriptCore","ownerRevision":"192736"}]}`}});
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 10);
-            assertAndResolveRequest(requests[7], 'GET', '/json/builders/some%20tester/pendingBuilds', []);
-            assertAndResolveRequest(requests[8], 'GET', '/json/builders/some%20builder/pendingBuilds', []);
-            assertAndResolveRequest(requests[9], 'GET', '/json/builders/other%20builder/pendingBuilds', []);
+            assertAndResolveRequest(requests[7], 'GET', MockData.pendingBuildsUrl('some tester'), {});
+            assertAndResolveRequest(requests[8], 'GET', MockData.pendingBuildsUrl('some builder'), {});
+            assertAndResolveRequest(requests[9], 'GET', MockData.pendingBuildsUrl('other builder'), {});
             return MockRemoteAPI.waitForRequest();
         }).then(() => {
             assert.equal(requests.length, 13);
-            assertAndResolveRequest(requests[10], 'GET', '/json/builders/some%20tester/builds/?select=-1&select=-2', {});
-            assertAndResolveRequest(requests[11], 'GET', '/json/builders/some%20builder/builds/?select=-1&select=-2', {
-                [-1]: MockData.runningBuild({builder: 'some builder', buildRequestId: 2}),
-                [-2]: MockData.finishedBuild({builder: 'some builder', buildRequestId: 1}),
+            assertAndResolveRequest(requests[10], 'GET', MockData.recentBuildsUrl('some tester', 2), {});
+            assertAndResolveRequest(requests[11], 'GET', MockData.recentBuildsUrl('some builder', 2), {
+                'builds': [
+                    MockData.runningBuildData({builderId: MockData.builderIDForName('some builder'), buildRequestId: 2}),
+                    MockData.finishedBuildData({builderId: MockData.builderIDForName('some builder'), buildRequestId: 1})]
             });
-            assertAndResolveRequest(requests[12], 'GET', '/json/builders/other%20builder/builds/?select=-1&select=-2', {});
+            assertAndResolveRequest(requests[12], 'GET', MockData.recentBuildsUrl('other builder', 2), {});
             return syncPromise;
         }).then(() => {
             return TestGroup.fetchForTask(taskId, true);
@@ -1706,7 +1712,7 @@ describe('sync-buildbot', function () {
             assert(buildRequest.isBuild());
             assert(!buildRequest.isTest());
             assert.equal(buildRequest.statusLabel(), 'Completed');
-            assert.equal(buildRequest.statusUrl(), 'http://build.webkit.org/builders/some%20builder/builds/124');
+            assert.equal(buildRequest.statusUrl(), MockData.statusUrl('some builder', 124));
             assert.notEqual(buildRequest.buildId(), null);
 
             const commitSet = buildRequest.commitSet();
@@ -1726,7 +1732,7 @@ describe('sync-buildbot', function () {
             assert(otherBuildRequest.isBuild());
             assert(!otherBuildRequest.isTest());
             assert.equal(otherBuildRequest.statusLabel(), 'Running');
-            assert.equal(otherBuildRequest.statusUrl(), 'http://build.webkit.org/builders/some%20builder/builds/124');
+            assert.equal(otherBuildRequest.statusUrl(), MockData.statusUrl('some builder', 124));
             assert.equal(otherBuildRequest.buildId(), null);
 
             const otherCommitSet = otherBuildRequest.commitSet();
@@ -1751,7 +1757,7 @@ describe('sync-buildbot', function () {
             assert(buildRequest.isBuild());
             assert(!buildRequest.isTest());
             assert.equal(buildRequest.statusLabel(), 'Completed');
-            assert.equal(buildRequest.statusUrl(), 'http://build.webkit.org/builders/some%20builder/builds/124');
+            assert.equal(buildRequest.statusUrl(), MockData.statusUrl('some builder', 124));
             assert.notEqual(buildRequest.buildId(), null);
 
             const commitSet = buildRequest.commitSet();
@@ -1771,7 +1777,7 @@ describe('sync-buildbot', function () {
             assert(otherBuildRequest.isBuild());
             assert(!otherBuildRequest.isTest());
             assert.equal(otherBuildRequest.statusLabel(), 'Running');
-            assert.equal(otherBuildRequest.statusUrl(), 'http://build.webkit.org/builders/some%20builder/builds/124');
+            assert.equal(otherBuildRequest.statusUrl(), MockData.statusUrl('some builder', 124));
             assert.equal(otherBuildRequest.buildId(), null);
 
             const otherCommitSet = otherBuildRequest.commitSet();
@@ -1797,7 +1803,7 @@ describe('sync-buildbot', function () {
             assert(buildRequest.isBuild());
             assert(!buildRequest.isTest());
             assert.equal(buildRequest.statusLabel(), 'Completed');
-            assert.equal(buildRequest.statusUrl(), 'http://build.webkit.org/builders/some%20builder/builds/124');
+            assert.equal(buildRequest.statusUrl(), MockData.statusUrl('some builder', 124));
             assert.notEqual(buildRequest.buildId(), null);
 
             const commitSet = buildRequest.commitSet();
@@ -1817,7 +1823,7 @@ describe('sync-buildbot', function () {
             assert(otherBuildRequest.isBuild());
             assert(!otherBuildRequest.isTest());
             assert.equal(otherBuildRequest.statusLabel(), 'Completed');
-            assert.equal(otherBuildRequest.statusUrl(), 'http://build.webkit.org/builders/some%20builder/builds/124');
+            assert.equal(otherBuildRequest.statusUrl(), MockData.statusUrl('some builder', 124));
             assert.notEqual(otherBuildRequest.buildId(), null);
 
             const otherCommitSet = otherBuildRequest.commitSet();
index 81afaf1..07a94cd 100644 (file)
@@ -151,7 +151,7 @@ class BuildbotSyncer {
             properties[this._platformPropertyName] = newRequest.platform().name();
 
         this._slavesWithNewRequests.add(slaveName);
-        return this.scheduleBuildOnBuildbotDeprecated(properties);
+        return this.scheduleBuildOnBuildbot(properties);
     }
 
     scheduleBuildOnBuildbotDeprecated(properties)
@@ -211,9 +211,9 @@ class BuildbotSyncer {
 
     pullBuildbot(count)
     {
-        return this._remote.getJSON(this.pathForPendingBuildsJSONDeprecated()).then((content) => {
-            let pendingEntries = content.map((entry) => new BuildbotBuildEntryDeprecated(this, entry));
-            return this._pullRecentBuildsDeprecated(count).then((entries) => {
+        return this._remote.getJSON(this.pathForPendingBuilds()).then((content) => {
+            const pendingEntries = (content.buildrequests || []).map((entry) => new BuildbotBuildEntry(this, entry));
+            return this._pullRecentBuilds(count).then((entries) => {
                 let entryByRequest = {};
 
                 for (let entry of pendingEntries)
index 8992840..dd85092 100644 (file)
@@ -55,7 +55,7 @@ class BuildbotTriggerable {
 
     initSyncers()
     {
-        return this.getBuilderNameToIDMapDeprecated().then((builderNameToIDMap) => {
+        return this.getBuilderNameToIDMap().then((builderNameToIDMap) => {
             this._syncers = BuildbotSyncer._loadConfig(this._buildbotRemote, this._config, builderNameToIDMap);
         });
     }
index 216cf9f..5cc2bae 100644 (file)
@@ -155,11 +155,16 @@ function builderNameToIDMap()
         'iPhone AB Tests' : '104',
         'iPhone 2 AB Tests': '105',
         'iPad AB Tests': '106'
-    }    
+    };
 }
 
 function smallPendingBuild()
 {
+    return samplePendingBuildRequests(null, null, null, "some builder");
+}
+
+function smallPendingBuildDeprecated()
+{
     return {
         'builderName': 'some builder',
         'builds': [],
@@ -178,6 +183,11 @@ function smallPendingBuild()
 
 function smallInProgressBuild()
 {
+    return sampleInProgressBuild();
+}
+
+function smallInProgressBuildDeprecated()
+{
     return {
         'builderName': 'some builder',
         'builds': [],
@@ -199,6 +209,11 @@ function smallInProgressBuild()
 
 function smallFinishedBuild()
 {
+    return sampleFinishedBuild(null, null, "some builder");
+}
+
+function smallFinishedBuildDeprecated()
+{
     return {
         'builderName': 'some builder',
         'builds': [],
@@ -1433,8 +1448,8 @@ describe('BuildbotSyncer', () => {
         it('should fetch pending builds from the right URL', () => {
             let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
             assert.equal(syncer.builderName(), 'ABTest-iPad-RunBenchmark-Tests');
-            let expectedURL = '/json/builders/ABTest-iPad-RunBenchmark-Tests/pendingBuilds';
-            assert.equal(syncer.pathForPendingBuildsJSONDeprecated(), expectedURL);
+            let expectedURL = '/api/v2/builders/102/buildrequests?complete=false&claimed=false&property=*';
+            assert.equal(syncer.pathForPendingBuilds(), expectedURL);
             syncer.pullBuildbot();
             assert.equal(requests.length, 1);
             assert.equal(requests[0].url, expectedURL);
@@ -1446,11 +1461,11 @@ describe('BuildbotSyncer', () => {
 
             syncer.pullBuildbot(1);
             assert.equal(requests.length, 1);
-            assert.equal(requests[0].url, '/json/builders/ABTest-iPad-RunBenchmark-Tests/pendingBuilds');
+            assert.equal(requests[0].url, '/api/v2/builders/102/buildrequests?complete=false&claimed=false&property=*');
             requests[0].resolve([]);
             return MockRemoteAPI.waitForRequest().then(() => {
                 assert.equal(requests.length, 2);
-                assert.equal(requests[1].url, '/json/builders/ABTest-iPad-RunBenchmark-Tests/builds/?select=-1');
+                assert.equal(requests[1].url, '/api/v2/builders/102/builds?limit=1&order=-number&property=*');
             });
         });
 
@@ -1459,29 +1474,29 @@ describe('BuildbotSyncer', () => {
 
             syncer.pullBuildbot(3);
             assert.equal(requests.length, 1);
-            assert.equal(requests[0].url, '/json/builders/ABTest-iPad-RunBenchmark-Tests/pendingBuilds');
+            assert.equal(requests[0].url, '/api/v2/builders/102/buildrequests?complete=false&claimed=false&property=*');
             requests[0].resolve([]);
             return MockRemoteAPI.waitForRequest().then(() => {
                 assert.equal(requests.length, 2);
-                assert.equal(requests[1].url, '/json/builders/ABTest-iPad-RunBenchmark-Tests/builds/?select=-1&select=-2&select=-3');
+                assert.equal(requests[1].url, '/api/v2/builders/102/builds?limit=3&order=-number&property=*');
             });
         });
 
         it('should create BuildbotBuildEntry for pending builds', () => {
             let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
             let promise = syncer.pullBuildbot();
-            requests[0].resolve([samplePendingBuildRequestDeprecated()]);
+            requests[0].resolve(samplePendingBuildRequests());
             return promise.then((entries) => {
                 assert.equal(entries.length, 1);
                 let entry = entries[0];
-                assert.ok(entry instanceof BuildbotBuildEntryDeprecated);
+                assert.ok(entry instanceof BuildbotBuildEntry);
                 assert.ok(!entry.buildNumber());
                 assert.ok(!entry.slaveName());
                 assert.equal(entry.buildRequestId(), 16733);
                 assert.ok(entry.isPending());
                 assert.ok(!entry.isInProgress());
                 assert.ok(!entry.hasFinished());
-                assert.equal(entry.url(), 'http://build.webkit.org/builders/ABTest-iPad-RunBenchmark-Tests/');
+                assert.equal(entry.url(), 'http://build.webkit.org/#/buildrequests/17');
             });
         });
 
@@ -1493,19 +1508,19 @@ describe('BuildbotSyncer', () => {
             requests[0].resolve([]);
             return MockRemoteAPI.waitForRequest().then(() => {
                 assert.equal(requests.length, 2);
-                requests[1].resolve({[-1]: sampleInProgressBuildDeprecated()});
+                requests[1].resolve(sampleInProgressBuild());
                 return promise;
             }).then((entries) => {
                 assert.equal(entries.length, 1);
                 let entry = entries[0];
-                assert.ok(entry instanceof BuildbotBuildEntryDeprecated);
+                assert.ok(entry instanceof BuildbotBuildEntry);
                 assert.equal(entry.buildNumber(), 614);
                 assert.equal(entry.slaveName(), 'ABTest-iPad-0');
                 assert.equal(entry.buildRequestId(), 16733);
                 assert.ok(!entry.isPending());
                 assert.ok(entry.isInProgress());
                 assert.ok(!entry.hasFinished());
-                assert.equal(entry.url(), 'http://build.webkit.org/builders/ABTest-iPad-RunBenchmark-Tests/builds/614');
+                assert.equal(entry.url(), 'http://build.webkit.org/#/builders/102/builds/614');
             });
         });
 
@@ -1517,19 +1532,19 @@ describe('BuildbotSyncer', () => {
             requests[0].resolve([]);
             return MockRemoteAPI.waitForRequest().then(() => {
                 assert.equal(requests.length, 2);
-                requests[1].resolve({[-1]: sampleFinishedBuildDeprecated()});
+                requests[1].resolve(sampleFinishedBuild());
                 return promise;
             }).then((entries) => {
                 assert.deepEqual(entries.length, 1);
                 let entry = entries[0];
-                assert.ok(entry instanceof BuildbotBuildEntryDeprecated);
+                assert.ok(entry instanceof BuildbotBuildEntry);
                 assert.equal(entry.buildNumber(), 1755);
                 assert.equal(entry.slaveName(), 'ABTest-iPad-0');
                 assert.equal(entry.buildRequestId(), 18935);
                 assert.ok(!entry.isPending());
                 assert.ok(!entry.isInProgress());
                 assert.ok(entry.hasFinished());
-                assert.equal(entry.url(), 'http://build.webkit.org/builders/ABTest-iPad-RunBenchmark-Tests/builds/1755');
+                assert.equal(entry.url(), 'http://build.webkit.org/#/builders/102/builds/1755');
             });
         });
 
@@ -1539,44 +1554,44 @@ describe('BuildbotSyncer', () => {
             let promise = syncer.pullBuildbot(5);
             assert.equal(requests.length, 1);
 
-            requests[0].resolve([samplePendingBuildRequestDeprecated(123)]);
+            requests[0].resolve(samplePendingBuildRequests(123));
 
             return MockRemoteAPI.waitForRequest().then(() => {
                 assert.equal(requests.length, 2);
-                requests[1].resolve({[-1]: sampleFinishedBuildDeprecated(), [-2]: {'error': 'Not available'}, [-4]: sampleInProgressBuildDeprecated()});
+                requests[1].resolve({'builds': [sampleFinishedBuildData(), sampleInProgressBuildData()]});
                 return promise;
             }).then((entries) => {
                 assert.deepEqual(entries.length, 3);
 
                 let entry = entries[0];
-                assert.ok(entry instanceof BuildbotBuildEntryDeprecated);
+                assert.ok(entry instanceof BuildbotBuildEntry);
                 assert.equal(entry.buildNumber(), null);
                 assert.equal(entry.slaveName(), null);
                 assert.equal(entry.buildRequestId(), 123);
                 assert.ok(entry.isPending());
                 assert.ok(!entry.isInProgress());
                 assert.ok(!entry.hasFinished());
-                assert.equal(entry.url(), 'http://build.webkit.org/builders/ABTest-iPad-RunBenchmark-Tests/');
+                assert.equal(entry.url(), 'http://build.webkit.org/#/buildrequests/17');
 
                 entry = entries[1];
-                assert.ok(entry instanceof BuildbotBuildEntryDeprecated);
+                assert.ok(entry instanceof BuildbotBuildEntry);
                 assert.equal(entry.buildNumber(), 614);
                 assert.equal(entry.slaveName(), 'ABTest-iPad-0');
                 assert.equal(entry.buildRequestId(), 16733);
                 assert.ok(!entry.isPending());
                 assert.ok(entry.isInProgress());
                 assert.ok(!entry.hasFinished());
-                assert.equal(entry.url(), 'http://build.webkit.org/builders/ABTest-iPad-RunBenchmark-Tests/builds/614');
+                assert.equal(entry.url(), 'http://build.webkit.org/#/builders/102/builds/614');
 
                 entry = entries[2];
-                assert.ok(entry instanceof BuildbotBuildEntryDeprecated);
+                assert.ok(entry instanceof BuildbotBuildEntry);
                 assert.equal(entry.buildNumber(), 1755);
                 assert.equal(entry.slaveName(), 'ABTest-iPad-0');
                 assert.equal(entry.buildRequestId(), 18935);
                 assert.ok(!entry.isPending());
                 assert.ok(!entry.isInProgress());
                 assert.ok(entry.hasFinished());
-                assert.equal(entry.url(), 'http://build.webkit.org/builders/ABTest-iPad-RunBenchmark-Tests/builds/1755');
+                assert.equal(entry.url(), 'http://build.webkit.org/#/builders/102/builds/1755');
             });
         });
 
@@ -1586,54 +1601,54 @@ describe('BuildbotSyncer', () => {
             let promise = syncer.pullBuildbot(5);
             assert.equal(requests.length, 1);
 
-            requests[0].resolve([samplePendingBuildRequestDeprecated(456, 2), samplePendingBuildRequestDeprecated(123, 1)]);
+            requests[0].resolve({"buildrequests": [samplePendingBuildRequestData(456, 2), samplePendingBuildRequestData(123, 1)]});
 
             return MockRemoteAPI.waitForRequest().then(() => {
                 assert.equal(requests.length, 2);
-                requests[1].resolve({[-3]: sampleFinishedBuildDeprecated(), [-1]: {'error': 'Not available'}, [-2]: sampleInProgressBuildDeprecated()});
+                requests[1].resolve({'builds': [sampleFinishedBuildData(), sampleInProgressBuildData()]});
                 return promise;
             }).then((entries) => {
                 assert.deepEqual(entries.length, 4);
 
                 let entry = entries[0];
-                assert.ok(entry instanceof BuildbotBuildEntryDeprecated);
+                assert.ok(entry instanceof BuildbotBuildEntry);
                 assert.equal(entry.buildNumber(), null);
                 assert.equal(entry.slaveName(), null);
                 assert.equal(entry.buildRequestId(), 123);
                 assert.ok(entry.isPending());
                 assert.ok(!entry.isInProgress());
                 assert.ok(!entry.hasFinished());
-                assert.equal(entry.url(), 'http://build.webkit.org/builders/ABTest-iPad-RunBenchmark-Tests/');
+                assert.equal(entry.url(), 'http://build.webkit.org/#/buildrequests/17');
 
                 entry = entries[1];
-                assert.ok(entry instanceof BuildbotBuildEntryDeprecated);
+                assert.ok(entry instanceof BuildbotBuildEntry);
                 assert.equal(entry.buildNumber(), null);
                 assert.equal(entry.slaveName(), null);
                 assert.equal(entry.buildRequestId(), 456);
                 assert.ok(entry.isPending());
                 assert.ok(!entry.isInProgress());
                 assert.ok(!entry.hasFinished());
-                assert.equal(entry.url(), 'http://build.webkit.org/builders/ABTest-iPad-RunBenchmark-Tests/');
+                assert.equal(entry.url(), 'http://build.webkit.org/#/buildrequests/17');
 
                 entry = entries[2];
-                assert.ok(entry instanceof BuildbotBuildEntryDeprecated);
+                assert.ok(entry instanceof BuildbotBuildEntry);
                 assert.equal(entry.buildNumber(), 614);
                 assert.equal(entry.slaveName(), 'ABTest-iPad-0');
                 assert.equal(entry.buildRequestId(), 16733);
                 assert.ok(!entry.isPending());
                 assert.ok(entry.isInProgress());
                 assert.ok(!entry.hasFinished());
-                assert.equal(entry.url(), 'http://build.webkit.org/builders/ABTest-iPad-RunBenchmark-Tests/builds/614');
+                assert.equal(entry.url(), 'http://build.webkit.org/#/builders/102/builds/614');
 
                 entry = entries[3];
-                assert.ok(entry instanceof BuildbotBuildEntryDeprecated);
+                assert.ok(entry instanceof BuildbotBuildEntry);
                 assert.equal(entry.buildNumber(), 1755);
                 assert.equal(entry.slaveName(), 'ABTest-iPad-0');
                 assert.equal(entry.buildRequestId(), 18935);
                 assert.ok(!entry.isPending());
                 assert.ok(!entry.isInProgress());
                 assert.ok(entry.hasFinished());
-                assert.equal(entry.url(), 'http://build.webkit.org/builders/ABTest-iPad-RunBenchmark-Tests/builds/1755');
+                assert.equal(entry.url(), 'http://build.webkit.org/#/builders/102/builds/1755');
             });
         });
 
@@ -1643,24 +1658,24 @@ describe('BuildbotSyncer', () => {
             let promise = syncer.pullBuildbot(5);
             assert.equal(requests.length, 1);
 
-            requests[0].resolve([samplePendingBuildRequestDeprecated()]);
+            requests[0].resolve(samplePendingBuildRequests());
 
             return MockRemoteAPI.waitForRequest().then(() => {
                 assert.equal(requests.length, 2);
-                requests[1].resolve({[-1]: sampleInProgressBuildDeprecated()});
+                requests[1].resolve(sampleInProgressBuild());
                 return promise;
             }).then((entries) => {
                 assert.equal(entries.length, 1);
 
                 let entry = entries[0];
-                assert.ok(entry instanceof BuildbotBuildEntryDeprecated);
+                assert.ok(entry instanceof BuildbotBuildEntry);
                 assert.equal(entry.buildNumber(), 614);
                 assert.equal(entry.slaveName(), 'ABTest-iPad-0');
                 assert.equal(entry.buildRequestId(), 16733);
                 assert.ok(!entry.isPending());
                 assert.ok(entry.isInProgress());
                 assert.ok(!entry.hasFinished());
-                assert.equal(entry.url(), 'http://build.webkit.org/builders/ABTest-iPad-RunBenchmark-Tests/builds/614');
+                assert.equal(entry.url(), 'http://build.webkit.org/#/builders/102/builds/614');
             });
         });
 
@@ -1670,24 +1685,24 @@ describe('BuildbotSyncer', () => {
             let promise = syncer.pullBuildbot(5);
             assert.equal(requests.length, 1);
 
-            requests[0].resolve([samplePendingBuildRequestDeprecated()]);
+            requests[0].resolve(samplePendingBuildRequests());
 
             return MockRemoteAPI.waitForRequest().then(() => {
                 assert.equal(requests.length, 2);
-                requests[1].resolve({[-1]: sampleFinishedBuildDeprecated(16733)});
+                requests[1].resolve(sampleFinishedBuild(16733));
                 return promise;
             }).then((entries) => {
                 assert.equal(entries.length, 1);
 
                 let entry = entries[0];
-                assert.ok(entry instanceof BuildbotBuildEntryDeprecated);
+                assert.ok(entry instanceof BuildbotBuildEntry);
                 assert.equal(entry.buildNumber(), 1755);
                 assert.equal(entry.slaveName(), 'ABTest-iPad-0');
                 assert.equal(entry.buildRequestId(), 16733);
                 assert.ok(!entry.isPending());
                 assert.ok(!entry.isInProgress());
                 assert.ok(entry.hasFinished());
-                assert.equal(entry.url(), 'http://build.webkit.org/builders/ABTest-iPad-RunBenchmark-Tests/builds/1755');
+                assert.equal(entry.url(), 'http://build.webkit.org/#/builders/102/builds/1755');
             });
         });
     });
@@ -1728,15 +1743,20 @@ describe('BuildbotSyncer', () => {
             syncer.scheduleRequest(request, [request], 'some-slave');
             return waitForRequest.then(() => {
                 assert.equal(requests.length, 1);
-                assert.equal(requests[0].url, '/builders/ABTest-iPhone-RunBenchmark-Tests/force');
+                assert.equal(requests[0].url, '/api/v2/forceschedulers/ABTest-iPhone-RunBenchmark-Tests-ForceScheduler');
                 assert.equal(requests[0].method, 'POST');
                 assert.deepEqual(requests[0].data, {
-                    'build_request_id': '16733-' + MockModels.iphone.id(),
-                    'desired_image': '13A452',
-                    "opensource": "197463",
-                    'forcescheduler': 'ABTest-iPhone-RunBenchmark-Tests-ForceScheduler',
-                    'slavename': 'some-slave',
-                    'test_name': 'speedometer'
+                    'id': '16733-' + MockModels.iphone.id(),
+                    'jsonrpc': '2.0',
+                    'method': 'force',
+                    'params': {
+                        'build_request_id': '16733-' + MockModels.iphone.id(),
+                        'desired_image': '13A452',
+                        'opensource': '197463',
+                        'forcescheduler': 'ABTest-iPhone-RunBenchmark-Tests-ForceScheduler',
+                        'slavename': 'some-slave',
+                        'test_name': 'speedometer'
+                    }
                 });
             });
         });
@@ -1760,33 +1780,35 @@ describe('BuildbotSyncer', () => {
         it('should schedule a build if builder has no builds if slaveList is not specified', () => {
             let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, smallConfiguration(), builderNameToIDMap())[0];
 
-            return pullBuildbotWithAssertion(syncer, [], {}).then(() => {
+            return pullBuildbotWithAssertion(syncer, {}, {}).then(() => {
                 const request = createSampleBuildRequest(MockModels.somePlatform, MockModels.someTest);
                 syncer.scheduleRequestInGroupIfAvailable(request, [request]);
                 assert.equal(requests.length, 1);
-                assert.equal(requests[0].url, '/builders/some%20builder/force');
+                assert.equal(requests[0].url, '/api/v2/forceschedulers/some-builder-ForceScheduler');
                 assert.equal(requests[0].method, 'POST');
-                assert.deepEqual(requests[0].data, {id: '16733-' + MockModels.somePlatform.id(), 'os': '13A452', 'wk': '197463', 'forcescheduler': 'some-builder-ForceScheduler'});
+                assert.deepEqual(requests[0].data, {id: '16733-' + MockModels.somePlatform.id(), 'jsonrpc': '2.0', 'method': 'force',
+                    'params': {id: '16733-' + MockModels.somePlatform.id(), 'forcescheduler': 'some-builder-ForceScheduler', 'os': '13A452', 'wk': '197463'}});
             });
         });
 
         it('should schedule a build if builder only has finished builds if slaveList is not specified', () => {
             let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, smallConfiguration(), builderNameToIDMap())[0];
 
-            return pullBuildbotWithAssertion(syncer, [], {[-1]: smallFinishedBuild()}).then(() => {
+            return pullBuildbotWithAssertion(syncer, {}, smallFinishedBuild()).then(() => {
                 const request = createSampleBuildRequest(MockModels.somePlatform, MockModels.someTest);
                 syncer.scheduleRequestInGroupIfAvailable(request, [request]);
                 assert.equal(requests.length, 1);
-                assert.equal(requests[0].url, '/builders/some%20builder/force');
+                assert.equal(requests[0].url, '/api/v2/forceschedulers/some-builder-ForceScheduler');
                 assert.equal(requests[0].method, 'POST');
-                assert.deepEqual(requests[0].data, {id: '16733-' + MockModels.somePlatform.id(), 'os': '13A452', 'wk': '197463', 'forcescheduler': 'some-builder-ForceScheduler'});
+                assert.deepEqual(requests[0].data, {id: '16733-' + MockModels.somePlatform.id(), 'jsonrpc': '2.0', 'method': 'force',
+                    'params': {id: '16733-' + MockModels.somePlatform.id(), 'forcescheduler': 'some-builder-ForceScheduler', 'os': '13A452', 'wk': '197463'}});
             });
         });
 
         it('should not schedule a build if builder has a pending build if slaveList is not specified', () => {
             let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, smallConfiguration(), builderNameToIDMap())[0];
 
-            return pullBuildbotWithAssertion(syncer, [smallPendingBuild()], {}).then(() => {
+            return pullBuildbotWithAssertion(syncer, smallPendingBuild(), {}).then(() => {
                 syncer.scheduleRequestInGroupIfAvailable(createSampleBuildRequest(MockModels.somePlatform, MockModels.someTest));
                 assert.equal(requests.length, 0);
             });
@@ -1795,11 +1817,11 @@ describe('BuildbotSyncer', () => {
         it('should schedule a build if builder does not have pending or completed builds on the matching slave', () => {
             let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[0];
 
-            return pullBuildbotWithAssertion(syncer, [], {}).then(() => {
+            return pullBuildbotWithAssertion(syncer, {}, {}).then(() => {
                 const request = createSampleBuildRequest(MockModels.iphone, MockModels.speedometer);
                 syncer.scheduleRequestInGroupIfAvailable(request, [request], null);
                 assert.equal(requests.length, 1);
-                assert.equal(requests[0].url, '/builders/ABTest-iPhone-RunBenchmark-Tests/force');
+                assert.equal(requests[0].url, '/api/v2/forceschedulers/ABTest-iPhone-RunBenchmark-Tests-ForceScheduler');
                 assert.equal(requests[0].method, 'POST');
             });
         });
@@ -1807,11 +1829,11 @@ describe('BuildbotSyncer', () => {
         it('should schedule a build if builder only has finished builds on the matching slave', () => {
             let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
 
-            pullBuildbotWithAssertion(syncer, [], {[-1]: sampleFinishedBuildDeprecated()}).then(() => {
+            pullBuildbotWithAssertion(syncer, {}, sampleFinishedBuild()).then(() => {
                 const request = createSampleBuildRequest(MockModels.ipad, MockModels.speedometer);
                 syncer.scheduleRequestInGroupIfAvailable(request, [request], null);
                 assert.equal(requests.length, 1);
-                assert.equal(requests[0].url, '/builders/ABTest-iPad-RunBenchmark-Tests/force');
+                assert.equal(requests[0].url, '/api/v2/forceschedulers/ABTest-iPad-RunBenchmark-Tests-ForceScheduler');
                 assert.equal(requests[0].method, 'POST');
             });
         });
@@ -1819,7 +1841,7 @@ describe('BuildbotSyncer', () => {
         it('should not schedule a build if builder has a pending build on the maching slave', () => {
             let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
 
-            pullBuildbotWithAssertion(syncer, [samplePendingBuildRequestDeprecated()], {}).then(() => {
+            pullBuildbotWithAssertion(syncer, samplePendingBuildRequests(), {}).then(() => {
                 const request = createSampleBuildRequest(MockModels.ipad, MockModels.speedometer);
                 syncer.scheduleRequestInGroupIfAvailable(request, [request], null);
                 assert.equal(requests.length, 0);
@@ -1829,7 +1851,7 @@ describe('BuildbotSyncer', () => {
         it('should schedule a build if builder only has a pending build on a non-maching slave', () => {
             let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
 
-            return pullBuildbotWithAssertion(syncer, [samplePendingBuildRequestDeprecated(1, 1, 'another-slave')], {}).then(() => {
+            return pullBuildbotWithAssertion(syncer, samplePendingBuildRequests(1, 1, 'another-slave'), {}).then(() => {
                 const request = createSampleBuildRequest(MockModels.ipad, MockModels.speedometer);
                 syncer.scheduleRequestInGroupIfAvailable(request, [request], null);
                 assert.equal(requests.length, 1);
@@ -1839,7 +1861,7 @@ describe('BuildbotSyncer', () => {
         it('should schedule a build if builder only has an in-progress build on the matching slave', () => {
             let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
 
-            return pullBuildbotWithAssertion(syncer, [], {[-1]: sampleInProgressBuildDeprecated()}).then(() => {
+            return pullBuildbotWithAssertion(syncer, {}, sampleInProgressBuild()).then(() => {
                 const request = createSampleBuildRequest(MockModels.ipad, MockModels.speedometer);
                 syncer.scheduleRequestInGroupIfAvailable(request, [request], null);
                 assert.equal(requests.length, 1);
@@ -1849,7 +1871,7 @@ describe('BuildbotSyncer', () => {
         it('should schedule a build if builder has an in-progress build on another slave', () => {
             let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
 
-            return pullBuildbotWithAssertion(syncer, [], {[-1]: sampleInProgressBuildDeprecated('other-slave')}).then(() => {
+            return pullBuildbotWithAssertion(syncer, {}, sampleInProgressBuild('other-slave')).then(() => {
                 const request = createSampleBuildRequest(MockModels.ipad, MockModels.speedometer);
                 syncer.scheduleRequestInGroupIfAvailable(request, [request], null);
                 assert.equal(requests.length, 1);
@@ -1859,7 +1881,7 @@ describe('BuildbotSyncer', () => {
         it('should not schedule a build if the request does not match any configuration', () => {
             let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[0];
 
-            return pullBuildbotWithAssertion(syncer, [], {}).then(() => {
+            return pullBuildbotWithAssertion(syncer, {}, {}).then(() => {
                 const request = createSampleBuildRequest(MockModels.ipad, MockModels.speedometer);
                 syncer.scheduleRequestInGroupIfAvailable(request, [request], null);
                 assert.equal(requests.length, 0);
@@ -1869,7 +1891,7 @@ describe('BuildbotSyncer', () => {
         it('should not schedule a build if a new request had been submitted to the same slave', (done) => {
             let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
 
-            pullBuildbotWithAssertion(syncer, [], {}).then(() => {
+            pullBuildbotWithAssertion(syncer, {}, {}).then(() => {
                 let request = createSampleBuildRequest(MockModels.ipad, MockModels.speedometer);
                 syncer.scheduleRequest(request, [request], 'ABTest-iPad-0');
                 request = createSampleBuildRequest(MockModels.ipad, MockModels.speedometer);
@@ -1887,7 +1909,7 @@ describe('BuildbotSyncer', () => {
         it('should schedule a build if a new request had been submitted to another slave', () => {
             let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
 
-            return pullBuildbotWithAssertion(syncer, [], {}).then(() => {
+            return pullBuildbotWithAssertion(syncer, {}, {}).then(() => {
                 let request = createSampleBuildRequest(MockModels.ipad, MockModels.speedometer);
                 syncer.scheduleRequest(request, [request], 'ABTest-iPad-0');
                 assert.equal(requests.length, 1);
@@ -1900,7 +1922,7 @@ describe('BuildbotSyncer', () => {
         it('should not schedule a build if a new request had been submitted to the same builder without slaveList', () => {
             let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, smallConfiguration(), builderNameToIDMap())[0];
 
-            return pullBuildbotWithAssertion(syncer, [], {}).then(() => {
+            return pullBuildbotWithAssertion(syncer, {}, {}).then(() => {
                 let request = createSampleBuildRequest(MockModels.somePlatform, MockModels.someTest);
                 syncer.scheduleRequest(request, [request], null);
                 assert.equal(requests.length, 1);