Remove deprecated Buildbot 0.8 code from Perf syncing scripts
authoraakash_jain@apple.com <aakash_jain@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Apr 2018 09:09:08 +0000 (09:09 +0000)
committeraakash_jain@apple.com <aakash_jain@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Apr 2018 09:09:08 +0000 (09:09 +0000)
https://bugs.webkit.org/show_bug.cgi?id=183915

Reviewed by Ryosuke Niwa.

* server-tests/resources/mock-data.js:
(MockData.buildbotBuildersURLDeprecated): Deleted.
(MockData.mockBuildbotBuildersDeprecated): Deleted.
(MockData.pendingBuildDeprecated): Deleted.
(MockData.runningBuildDeprecated): Deleted.
(MockData.finishedBuildDeprecated): Deleted.
* tools/js/buildbot-syncer.js:
(BuildbotBuildEntryDeprecated): Deleted.
(BuildbotBuildEntryDeprecated.prototype.initialize): Deleted.
(BuildbotBuildEntryDeprecated.prototype.url): Deleted.
(BuildbotSyncer.prototype.scheduleBuildOnBuildbotDeprecated): Deleted.
(BuildbotSyncer.prototype._pullRecentBuildsDeprecated): Deleted.
(BuildbotSyncer.prototype.pathForPendingBuildsJSONDeprecated): Deleted.
(BuildbotSyncer.prototype.pathForBuildJSONDeprecated): Deleted.
(BuildbotSyncer.prototype.pathForForceBuildDeprecated): Deleted.
(BuildbotSyncer.prototype.url): Deleted.
(BuildbotSyncer.prototype.urlForBuildNumberDeprecated): Deleted.
* tools/js/buildbot-triggerable.js:
(BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Deleted.
* unit-tests/buildbot-syncer-tests.js:
(smallPendingBuildDeprecated): Deleted.
(smallInProgressBuildDeprecated): Deleted.
(smallFinishedBuildDeprecated): Deleted.
(samplePendingBuildRequestDeprecated): Deleted.
(sampleInProgressBuildDeprecated): Deleted.
(sampleFinishedBuildDeprecated): Deleted.

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

Websites/perf.webkit.org/ChangeLog
Websites/perf.webkit.org/server-tests/resources/mock-data.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 e10319d..ed269f9 100644 (file)
@@ -1,3 +1,37 @@
+2018-04-02  Aakash Jain  <aakash_jain@apple.com>
+
+        Remove deprecated Buildbot 0.8 code from Perf syncing scripts
+        https://bugs.webkit.org/show_bug.cgi?id=183915
+
+        Reviewed by Ryosuke Niwa.
+
+        * server-tests/resources/mock-data.js:
+        (MockData.buildbotBuildersURLDeprecated): Deleted.
+        (MockData.mockBuildbotBuildersDeprecated): Deleted.
+        (MockData.pendingBuildDeprecated): Deleted.
+        (MockData.runningBuildDeprecated): Deleted.
+        (MockData.finishedBuildDeprecated): Deleted.
+        * tools/js/buildbot-syncer.js:
+        (BuildbotBuildEntryDeprecated): Deleted.
+        (BuildbotBuildEntryDeprecated.prototype.initialize): Deleted.
+        (BuildbotBuildEntryDeprecated.prototype.url): Deleted.
+        (BuildbotSyncer.prototype.scheduleBuildOnBuildbotDeprecated): Deleted.
+        (BuildbotSyncer.prototype._pullRecentBuildsDeprecated): Deleted.
+        (BuildbotSyncer.prototype.pathForPendingBuildsJSONDeprecated): Deleted.
+        (BuildbotSyncer.prototype.pathForBuildJSONDeprecated): Deleted.
+        (BuildbotSyncer.prototype.pathForForceBuildDeprecated): Deleted.
+        (BuildbotSyncer.prototype.url): Deleted.
+        (BuildbotSyncer.prototype.urlForBuildNumberDeprecated): Deleted.
+        * tools/js/buildbot-triggerable.js:
+        (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Deleted.
+        * unit-tests/buildbot-syncer-tests.js:
+        (smallPendingBuildDeprecated): Deleted.
+        (smallInProgressBuildDeprecated): Deleted.
+        (smallFinishedBuildDeprecated): Deleted.
+        (samplePendingBuildRequestDeprecated): Deleted.
+        (sampleInProgressBuildDeprecated): Deleted.
+        (sampleFinishedBuildDeprecated): Deleted.
+
 2018-03-19  Aakash Jain  <aakash_jain@apple.com>
 
         Update Perf buildbot syncing scripts for Buildbot 0.9
index 9a71425..94a393f 100644 (file)
@@ -17,7 +17,6 @@ MockData = {
     jscRepositoryId() { return 222; },
     gitWebkitRepositoryId() { return 111; },
     sharedRepositoryId() { return 14; },
-    buildbotBuildersURLDeprecated() {return '/json/builders'},
     buildbotBuildersURL() {return '/api/v2/builders'},
     pendingBuildsUrl: function (builderName) {
         const builderId = this.builderIDForName(builderName);
@@ -251,29 +250,6 @@ MockData = {
             ]
         }
     },
-    mockBuildbotBuildersDeprecated: function ()
-    {
-        return {
-            "some builder": {
-                "slaves": [ "some-slave-1" ]
-            },
-            "some-builder-1": {
-                "slaves": [ "some-slave-2" ]
-            },
-            "some builder 2": {
-                "slaves": [ "some-slave-3" ]
-            },
-            "other builder": {
-                "slaves": [ "some-slave-4" ]
-            },
-            "some tester": {
-                "slaves": [ "some-slave-5" ]
-            },
-            "another tester": {
-                "slaves": [ "some-slave-6" ]
-            }
-        }
-    },
     mockBuildbotBuilders: function ()
     {
         return {
@@ -345,28 +321,6 @@ MockData = {
             "buildrequests": [this.pendingBuildData(options)]
         };
     },
-    pendingBuildDeprecated(options)
-    {
-        options = options || {};
-        return {
-            'builderName': options.builder || 'some-builder-1',
-            'builds': [],
-            'properties': [
-                ['wk', options.webkitRevision || '191622'],
-                ['os', options.osxRevision || '10.11 15A284'],
-                ['build-request-id', (options.buildRequestId || 702).toString(), ]
-            ],
-            'source': {
-                'branch': '',
-                'changes': [],
-                'codebase': 'WebKit',
-                'hasPatch': false,
-                'project': '',
-                'repository': '',
-                'revision': ''
-            },
-        };
-    },
     sampleBuildData(options, overrides)
     {
         options = options || {};
@@ -405,31 +359,6 @@ MockData = {
             "builds": [this.runningBuildData(options)]
         };
     },
-    runningBuildDeprecated(options)
-    {
-        options = options || {};
-        return {
-            'builderName': options.builder || 'some-builder-1',
-            'builds': [],
-            'properties': [
-                ['wk', options.webkitRevision || '192736'],
-                ['os', options.osxRevision || '10.11 15A284'],
-                ['build-request-id', (options.buildRequestId || 701).toString(), ]
-            ],
-            'currentStep': {},
-            'eta': 721,
-            'number': options.buildNumber || 124,
-            'source': {
-                'branch': '',
-                'changes': [],
-                'codebase': 'WebKit',
-                'hasPatch': false,
-                'project': '',
-                'repository': '',
-                'revision': ''
-            },
-        };
-    },
     finishedBuildData(options)
     {
         options = options || {};
@@ -446,32 +375,6 @@ MockData = {
         return {
             "builds": [this.finishedBuildData(options)]
         };
-    },
-    finishedBuildDeprecated(options)
-    {
-        options = options || {};
-        return {
-            'builderName': options.builder || 'some-builder-1',
-            'builds': [],
-            'properties': [
-                ['wk', options.webkitRevision || '191622'],
-                ['os', options.osxRevision || '10.11 15A284'],
-                ['build-request-id', (options.buildRequestId || 700).toString(), ]
-            ],
-            'currentStep': null,
-            'eta': null,
-            'number': options.buildNumber || 123,
-            'source': {
-                'branch': '',
-                'changes': [],
-                'codebase': 'WebKit',
-                'hasPatch': false,
-                'project': '',
-                'repository': '',
-                'revision': ''
-            },
-            'times': [0, 1],
-        };
     }
 }
 
index 07a94cd..02256b1 100644 (file)
@@ -54,39 +54,6 @@ class BuildbotBuildEntry {
     }
 }
 
-class BuildbotBuildEntryDeprecated extends BuildbotBuildEntry {
-    constructor(syncer, rawData)
-    {
-        super(syncer, rawData);
-        this.initialize(syncer, rawData);
-    }
-
-    initialize(syncer, rawData)
-    {
-        assert.equal(syncer.builderName(), rawData['builderName']);
-
-        this._syncer = syncer;
-        this._workerName = null;
-        this._buildRequestId = null;
-        this._buildNumber = rawData['number'];
-        this._isInProgress = rawData['currentStep'] || (rawData['times'] && !rawData['times'][1]);
-        this._isPending = typeof(this._buildNumber) != 'number';
-        this._hasFinished =  !this.isPending() && !this.isInProgress();
-
-        for (let propertyTuple of (rawData['properties'] || [])) {
-            // e.g. ['build_request_id', '16733', 'Force Build Form']
-            const name = propertyTuple[0];
-            const value = propertyTuple[1];
-            if (name == syncer._slavePropertyName)
-                this._workerName = value;
-            else if (name == syncer._buildRequestPropertyName)
-                this._buildRequestId = value;
-        }
-    }
-
-    url() { return this.isPending() ? this._syncer.url() : this._syncer.urlForBuildNumberDeprecated(this._buildNumber); }
-}
-
 
 class BuildbotSyncer {
 
@@ -154,11 +121,6 @@ class BuildbotSyncer {
         return this.scheduleBuildOnBuildbot(properties);
     }
 
-    scheduleBuildOnBuildbotDeprecated(properties)
-    {
-        return this._remote.postFormUrlencodedData(this.pathForForceBuildDeprecated(), properties);
-    }
-
     scheduleBuildOnBuildbot(properties)
     {
         const data = {jsonrpc: '2.0', method: 'force', id: properties[this._buildRequestPropertyName], params: properties};
@@ -234,26 +196,6 @@ class BuildbotSyncer {
         });
     }
 
-    _pullRecentBuildsDeprecated(count)
-    {
-        if (!count)
-            return Promise.resolve([]);
-
-        let selectedBuilds = new Array(count);
-        for (let i = 0; i < count; i++)
-            selectedBuilds[i] = -i - 1;
-
-        return this._remote.getJSON(this.pathForBuildJSONDeprecated(selectedBuilds)).then((content) => {
-            const entries = [];
-            for (let index of selectedBuilds) {
-                const entry = content[index];
-                if (entry && !entry['error'])
-                    entries.push(new BuildbotBuildEntryDeprecated(this, entry));
-            }
-            return entries;
-        });
-    }
-
     _pullRecentBuilds(count)
     {
         if (!count)
@@ -266,18 +208,10 @@ class BuildbotSyncer {
         });
     }
 
-    pathForPendingBuildsJSONDeprecated() { return `/json/builders/${escape(this._builderName)}/pendingBuilds`; }
     pathForPendingBuilds() { return `/api/v2/builders/${this._builderID}/buildrequests?complete=false&claimed=false&property=*`; }
-    pathForBuildJSONDeprecated(selectedBuilds)
-    {
-        return `/json/builders/${escape(this._builderName)}/builds/?` + selectedBuilds.map((number) => 'select=' + number).join('&');
-    }
     pathForRecentBuilds(count) { return `/api/v2/builders/${this._builderID}/builds?limit=${count}&order=-number&property=*`; }
-    pathForForceBuildDeprecated() { return `/builders/${escape(this._builderName)}/force`; }
     pathForForceBuild(schedulerName) { return `/api/v2/forceschedulers/${schedulerName}`; }
 
-    url() { return this._remote.url(`/builders/${escape(this._builderName)}/`); }
-    urlForBuildNumberDeprecated(number) { return this._remote.url(`/builders/${escape(this._builderName)}/builds/${number}`); }
     urlForBuildNumber(number) { return this._remote.url(`/#/builders/${this._builderID}/builds/${number}`); }
     urlForPendingBuild(buildRequestId) { return this._remote.url(`/#/buildrequests/${buildRequestId}`); }
 
@@ -652,5 +586,4 @@ class BuildbotSyncer {
 if (typeof module != 'undefined') {
     module.exports.BuildbotSyncer = BuildbotSyncer;
     module.exports.BuildbotBuildEntry = BuildbotBuildEntry;
-    module.exports.BuildbotBuildEntryDeprecated = BuildbotBuildEntryDeprecated;
 }
index dd85092..dcdddf4 100644 (file)
@@ -27,7 +27,6 @@ class BuildbotTriggerable {
         this._logger = logger || {log: () => { }, error: () => { }};
     }
 
-    // This method handles Buildbot 0.9 data format
     getBuilderNameToIDMap()
     {
         return this._buildbotRemote.getJSON("/api/v2/builders").then((content) => {
@@ -41,18 +40,6 @@ class BuildbotTriggerable {
         });
     }
 
-    // This method handles Buildbot 0.8 data format
-    getBuilderNameToIDMapDeprecated()
-    {
-        return this._buildbotRemote.getJSON("/json/builders").then((content) => {
-            const builderNameToIDMap = {};
-            for (let builder in content)
-                builderNameToIDMap[builder] = builder;
-
-            return builderNameToIDMap;
-        });
-    }
-
     initSyncers()
     {
         return this.getBuilderNameToIDMap().then((builderNameToIDMap) => {
index 5cc2bae..2e2c3b4 100644 (file)
@@ -7,7 +7,6 @@ let MockRemoteAPI = require('./resources/mock-remote-api.js').MockRemoteAPI;
 let MockModels = require('./resources/mock-v3-models.js').MockModels;
 
 let BuildbotBuildEntry = require('../tools/js/buildbot-syncer.js').BuildbotBuildEntry;
-let BuildbotBuildEntryDeprecated = require('../tools/js/buildbot-syncer.js').BuildbotBuildEntryDeprecated;
 let BuildbotSyncer = require('../tools/js/buildbot-syncer.js').BuildbotSyncer;
 
 function sampleiOSConfig()
@@ -163,77 +162,16 @@ function smallPendingBuild()
     return samplePendingBuildRequests(null, null, null, "some builder");
 }
 
-function smallPendingBuildDeprecated()
-{
-    return {
-        'builderName': 'some builder',
-        'builds': [],
-        'properties': [],
-        'source': {
-            'branch': '',
-            'changes': [],
-            'codebase': 'WebKit',
-            'hasPatch': false,
-            'project': '',
-            'repository': '',
-            'revision': ''
-        },
-    };
-}
-
 function smallInProgressBuild()
 {
     return sampleInProgressBuild();
 }
 
-function smallInProgressBuildDeprecated()
-{
-    return {
-        'builderName': 'some builder',
-        'builds': [],
-        'properties': [],
-        'currentStep': { },
-        'eta': 123,
-        'number': 456,
-        'source': {
-            'branch': '',
-            'changes': [],
-            'codebase': 'WebKit',
-            'hasPatch': false,
-            'project': '',
-            'repository': '',
-            'revision': ''
-        },
-    };
-}
-
 function smallFinishedBuild()
 {
     return sampleFinishedBuild(null, null, "some builder");
 }
 
-function smallFinishedBuildDeprecated()
-{
-    return {
-        'builderName': 'some builder',
-        'builds': [],
-        'properties': [],
-        'currentStep': null,
-        'eta': null,
-        'number': 789,
-        'source': {
-            'branch': '',
-            'changes': [],
-            'codebase': 'WebKit',
-            'hasPatch': false,
-            'project': '',
-            'repository': '',
-            'revision': ''
-        },
-        'times': [0, 1],
-    };
-}
-
 function createSampleBuildRequest(platform, test)
 {
     assert(platform instanceof Platform);
@@ -391,197 +329,6 @@ function sampleFinishedBuild(buildRequestId, workerName, builderName)
     };
 }
 
-function samplePendingBuildRequestDeprecated(buildRequestId, buildTime, slaveName)
-{
-    return {
-        'builderName': 'ABTest-iPad-RunBenchmark-Tests',
-        'builds': [],
-        'properties': [
-            ['build_request_id', buildRequestId || '16733', 'Force Build Form'],
-            ['desired_image', '13A452', 'Force Build Form'],
-            ['owner', '<unknown>', 'Force Build Form'],
-            ['test_name', 'speedometer', 'Force Build Form'],
-            ['reason', 'force build','Force Build Form'],
-            ['slavename', slaveName, ''],
-            ['scheduler', 'ABTest-iPad-RunBenchmark-Tests-ForceScheduler', 'Scheduler']
-        ],
-        'source': {
-            'branch': '',
-            'changes': [],
-            'codebase': 'compiler-rt',
-            'hasPatch': false,
-            'project': '',
-            'repository': '',
-            'revision': ''
-        },
-        'submittedAt': buildTime || 1458704983
-    };
-}
-
-function sampleInProgressBuildDeprecated(slaveName)
-{
-    return {
-        'blame': [],
-        'builderName': 'ABTest-iPad-RunBenchmark-Tests',
-        'currentStep': {
-            'eta': 0.26548067698460565,
-            'expectations': [['output', 845, 1315.0]],
-            'hidden': false,
-            'isFinished': false,
-            'isStarted': true,
-            'logs': [['stdio', 'https://build.webkit.org/builders/ABTest-iPad-RunBenchmark-Tests/builds/614/steps/Some%20step/logs/stdio']],
-            'name': 'Some step',
-            'results': [null,[]],
-            'statistics': {},
-            'step_number': 1,
-            'text': [''],
-            'times': [1458718657.581628, null],
-            'urls': {}
-        },
-        'eta': 6497.991612434387,
-        'logs': [['stdio','https://build.webkit.org/builders/ABTest-iPad-RunBenchmark-Tests/builds/614/steps/shell/logs/stdio']],
-        'number': 614,
-        'properties': [
-            ['build_request_id', '16733', 'Force Build Form'],
-            ['buildername', 'ABTest-iPad-RunBenchmark-Tests', 'Builder'],
-            ['buildnumber', 614, 'Build'],
-            ['desired_image', '13A452', 'Force Build Form'],
-            ['owner', '<unknown>', 'Force Build Form'],
-            ['reason', 'force build', 'Force Build Form'],
-            ['scheduler', 'ABTest-iPad-RunBenchmark-Tests-ForceScheduler', 'Scheduler'],
-            ['slavename', slaveName || 'ABTest-iPad-0', 'BuildSlave'],
-        ],
-        'reason': 'A build was forced by \'<unknown>\': force build',
-        'results': null,
-        'slave': 'ABTest-iPad-0',
-        'sourceStamps': [{'branch': '', 'changes': [], 'codebase': 'compiler-rt', 'hasPatch': false, 'project': '', 'repository': '', 'revision': ''}],
-        'steps': [
-            {
-                'eta': null,
-                'expectations': [['output',2309,2309.0]],
-                'hidden': false,
-                'isFinished': true,
-                'isStarted': true,
-                'logs': [['stdio', 'https://build.webkit.org/builders/ABTest-iPad-RunBenchmark-Tests/builds/614/steps/shell/logs/stdio']],
-                'name': 'Finished step',
-                'results': [0, []],
-                'statistics': {},
-                'step_number': 0,
-                'text': [''],
-                'times': [1458718655.419865, 1458718655.453633],
-                'urls': {}
-            },
-            {
-                'eta': 0.26548067698460565,
-                'expectations': [['output', 845, 1315.0]],
-                'hidden': false,
-                'isFinished': false,
-                'isStarted': true,
-                'logs': [['stdio', 'https://build.webkit.org/builders/ABTest-iPad-RunBenchmark-Tests/builds/614/steps/Some%20step/logs/stdio']],
-                'name': 'Some step',
-                'results': [null,[]],
-                'statistics': {},
-                'step_number': 1,
-                'text': [''],
-                'times': [1458718657.581628, null],
-                'urls': {}
-            },
-            {
-                'eta': null,
-                'expectations': [['output', null, null]],
-                'hidden': false,
-                'isFinished': false,
-                'isStarted': false,
-                'logs': [],
-                'name': 'Some other step',
-                'results': [null, []],
-                'statistics': {},
-                'step_number': 2,
-                'text': [],
-                'times': [null, null],
-                'urls': {}
-            },
-        ],
-        'text': [],
-        'times': [1458718655.415821, null]
-    };
-}
-
-function sampleFinishedBuildDeprecated(buildRequestId, slaveName)
-{
-    return {
-        'blame': [],
-        'builderName': 'ABTest-iPad-RunBenchmark-Tests',
-        'currentStep': null,
-        'eta': null,
-        'logs': [['stdio','https://build.webkit.org/builders/ABTest-iPad-RunBenchmark-Tests/builds/1755/steps/shell/logs/stdio']],
-        'number': 1755,
-        'properties': [
-            ['build_request_id', buildRequestId || '18935', 'Force Build Form'],
-            ['buildername', 'ABTest-iPad-RunBenchmark-Tests', 'Builder'],
-            ['buildnumber', 1755, 'Build'],
-            ['desired_image', '13A452', 'Force Build Form'],
-            ['owner', '<unknown>', 'Force Build Form'],
-            ['reason', 'force build', 'Force Build Form'],
-            ['scheduler', 'ABTest-iPad-RunBenchmark-Tests-ForceScheduler', 'Scheduler'],
-            ['slavename', slaveName || 'ABTest-iPad-0', 'BuildSlave'],
-        ],
-        'reason': 'A build was forced by \'<unknown>\': force build',
-        'results': 2,
-        'slave': 'ABTest-iPad-0',
-        'sourceStamps': [{'branch': '', 'changes': [], 'codebase': 'compiler-rt', 'hasPatch': false, 'project': '', 'repository': '', 'revision': ''}],
-        'steps': [
-            {
-                'eta': null,
-                'expectations': [['output',2309,2309.0]],
-                'hidden': false,
-                'isFinished': true,
-                'isStarted': true,
-                'logs': [['stdio', 'https://build.webkit.org/builders/ABTest-iPad-RunBenchmark-Tests/builds/614/steps/shell/logs/stdio']],
-                'name': 'Finished step',
-                'results': [0, []],
-                'statistics': {},
-                'step_number': 0,
-                'text': [''],
-                'times': [1458718655.419865, 1458718655.453633],
-                'urls': {}
-            },
-            {
-                'eta': null,
-                'expectations': [['output', 845, 1315.0]],
-                'hidden': false,
-                'isFinished': true,
-                'isStarted': true,
-                'logs': [['stdio', 'https://build.webkit.org/builders/ABTest-iPad-RunBenchmark-Tests/builds/614/steps/Some%20step/logs/stdio']],
-                'name': 'Some step',
-                'results': [null,[]],
-                'statistics': {},
-                'step_number': 1,
-                'text': [''],
-                'times': [1458718657.581628, null],
-                'urls': {}
-            },
-            {
-                'eta': null,
-                'expectations': [['output', null, null]],
-                'hidden': false,
-                'isFinished': true,
-                'isStarted': true,
-                'logs': [],
-                'name': 'Some other step',
-                'results': [null, []],
-                'statistics': {},
-                'step_number': 2,
-                'text': [],
-                'times': [null, null],
-                'urls': {}
-            },
-        ],
-        'text': [],
-        'times': [1458937478.25837, 1458946147.173785]
-    };
-}
-
 describe('BuildbotSyncer', () => {
     MockModels.inject();
     let requests = MockRemoteAPI.inject('http://build.webkit.org');