Bug 182218 - Add support for submitting build request to Buildbot 0.9 server in BuildbotSyncer
Summary: Add support for submitting build request to Buildbot 0.9 server in BuildbotSy...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Aakash Jain
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-01-27 11:54 PST by Aakash Jain
Modified: 2018-02-05 09:15 PST (History)
6 users (show)

See Also:


Attachments
Proposed patch (7.63 KB, patch)
2018-01-27 12:01 PST, Aakash Jain
rniwa: review-
Details | Formatted Diff | Diff
Updated patch with unit-test (15.93 KB, patch)
2018-02-02 14:09 PST, Aakash Jain
rniwa: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Aakash Jain 2018-01-27 11:54:26 PST
As part of supporting Buildbot 0.9, BuildbotSyncer should be able to submit build request to Buildbot 0.9 server.
Comment 1 Aakash Jain 2018-01-27 12:01:24 PST
Created attachment 332479 [details]
Proposed patch

Created new scheduleRequest method and moved previous one to scheduleRequestDeprecated. Have some code duplication as scheduleRequestDeprecated will be simply deleted later on.
Comment 2 Ryosuke Niwa 2018-01-31 12:23:02 PST
Comment on attachment 332479 [details]
Proposed patch

View in context: https://bugs.webkit.org/attachment.cgi?id=332479&action=review

r- due to lack of testing.

> Websites/perf.webkit.org/tools/js/buildbot-syncer.js:75
> +        if (object.properties)
> +            this._forceScheduler = object.properties.forcescheduler;

We need a test for this code change.

> Websites/perf.webkit.org/tools/js/buildbot-syncer.js:138
> +        const data = {jsonrpc: '2.0', method: 'force', id: properties[this._buildRequestPropertyName], params: properties};
> +        return this._remote.postJSON(this.pathForForceBuild(), data);

Ditto.
Comment 3 Aakash Jain 2018-02-02 14:09:33 PST
Created attachment 332999 [details]
Updated patch with unit-test

Added unit-tests.

Also added assert to ensure forcescheduler property is always defined.
Comment 4 Ryosuke Niwa 2018-02-02 19:30:33 PST
Comment on attachment 332999 [details]
Updated patch with unit-test

View in context: https://bugs.webkit.org/attachment.cgi?id=332999&action=review

> Websites/perf.webkit.org/tools/js/buildbot-syncer.js:143
> +        assert(properties['forcescheduler'], "forcescheduler must be defined for builder: " + this._builderName + " in order to post a build request to Buildbot.")

This is not an accurate error message. We must specify a forcebuilder for a given request, not a builder.
Revise this to:
`forcescheduler was not specified in buildbot properties for build request ${newRequest.id()} on platform "${newRequest.platform().name()}" for builder "${this.builderName()}"`;

> Websites/perf.webkit.org/tools/js/buildbot-syncer.js:262
> +    pathForForceBuild(scheduler) { return `/api/v2/forceschedulers/${scheduler}`; }

This argument should be named schedulerName to signify the fact it's a string.

> Websites/perf.webkit.org/unit-tests/buildbot-syncer-tests.js:1620
> +        it('should schedule a build request on Buildbot', () => {

Use async.

> Websites/perf.webkit.org/unit-tests/buildbot-syncer-tests.js:1621
> +            let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[0];

Use const.

> Websites/perf.webkit.org/unit-tests/buildbot-syncer-tests.js:1627
> +            return waitForRequest.then(() => {

Use await.
Comment 5 Aakash Jain 2018-02-05 09:15:01 PST
Committed r228099: <https://trac.webkit.org/changeset/228099>
Comment 6 Radar WebKit Bug Importer 2018-02-05 09:15:32 PST
<rdar://problem/37238974>