Bug 179743 - Add support for fetching recent builds in Buildbot 0.9 format in BuildbotSyncer
Summary: Add support for fetching recent builds in Buildbot 0.9 format in BuildbotSyncer
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: 2017-11-15 13:48 PST by Aakash Jain
Modified: 2018-02-05 08:55 PST (History)
9 users (show)

See Also:


Attachments
Proposed patch (2.80 KB, patch)
2017-11-15 13:52 PST, Aakash Jain
no flags Details | Formatted Diff | Diff
Proposed patch (3.41 KB, patch)
2018-01-22 21:11 PST, Aakash Jain
rniwa: review-
Details | Formatted Diff | Diff
Updated patch (3.34 KB, patch)
2018-01-30 23:12 PST, Aakash Jain
rniwa: review-
Details | Formatted Diff | Diff
Updated patch with unit-tests (7.82 KB, patch)
2018-02-02 11:09 PST, Aakash Jain
rniwa: review+
Details | Formatted Diff | Diff
Archive of layout-test-results from ews101 for mac-sierra (2.32 MB, application/zip)
2018-02-02 11:51 PST, EWS Watchlist
no flags Details
Patch for landing (7.70 KB, patch)
2018-02-05 07:50 PST, Aakash Jain
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Aakash Jain 2017-11-15 13:48:16 PST
As part of supporting Buildbot 0.9, BuildbotSyncer should be able to fetch recent builds from Buildbot 0.9 server. We should add support to handle this in existing perf syncing scripts without breaking any of the current functionality.
Comment 1 Aakash Jain 2017-11-15 13:52:22 PST
Created attachment 327021 [details]
Proposed patch
Comment 2 Aakash Jain 2018-01-22 21:11:20 PST
Created attachment 332004 [details]
Proposed patch
Comment 3 Ryosuke Niwa 2018-01-30 00:22:12 PST
Comment on attachment 332004 [details]
Proposed patch

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

We need tests for this. r- due to the lack of tests.

> Websites/perf.webkit.org/tools/js/buildbot-syncer.js:219
> +            const entries = [];
> +            for (let build of content.builds)
> +                entries.push(new BuildbotBuildEntry(this, build));
> +            return entries;

There is no point in manually pushing. Just do:
return content.builds.map((build) => new BuildbotBuildEntry(this, build));

> Websites/perf.webkit.org/tools/js/buildbot-syncer.js:224
> +    pathForRecentBuilds(count) { return `/api/v2/builders/${this._builderID}/builds?` + `limit=${count}&order=-number&property=*`; }

What why `+ ` between "builds?" and "limit="? Please concatenate them instead.
Comment 4 Aakash Jain 2018-01-30 23:12:38 PST
Created attachment 332744 [details]
Updated patch

> There is no point in manually pushing. Just do:
> return content.builds.map((build) => new BuildbotBuildEntry(this, build));
Done. Thanks for the suggestion.

> What why `+ ` between "builds?" and "limit="? Please concatenate them instead.
Done

> We need tests for this.

I have tried to break down overall changes into smaller patches. For e.g. this patch add code to just fetch the recent builds (but does not enable this code path yet). Final patch in https://bugs.webkit.org/show_bug.cgi?id=175969 start using all this code and all the test-cases (unit-tests and server-tests) are updated in that.
Comment 5 Ryosuke Niwa 2018-01-31 12:21:51 PST
(In reply to Aakash Jain from comment #4)
> Created attachment 332744 [details]
> Updated patch
> 
> > There is no point in manually pushing. Just do:
> > return content.builds.map((build) => new BuildbotBuildEntry(this, build));
> Done. Thanks for the suggestion.
> 
> > What why `+ ` between "builds?" and "limit="? Please concatenate them instead.
> Done
> 
> > We need tests for this.
> 
> I have tried to break down overall changes into smaller patches. For e.g.
> this patch add code to just fetch the recent builds (but does not enable
> this code path yet). Final patch in
> https://bugs.webkit.org/show_bug.cgi?id=175969 start using all this code and
> all the test-cases (unit-tests and server-tests) are updated in that.

We need to start testing this code right now, not in the final patch. The whole point of breaking down patches was to make each patch reviewable. And that includes tests for those broken up pieces.
Comment 6 Ryosuke Niwa 2018-01-31 12:22:05 PST
Comment on attachment 332744 [details]
Updated patch

Again, we need a test for this. r-
Comment 7 Aakash Jain 2018-02-02 11:09:04 PST
Created attachment 332983 [details]
Updated patch with unit-tests

Added unit-tests as discussed.
Comment 8 EWS Watchlist 2018-02-02 11:51:06 PST Comment hidden (obsolete)
Comment 9 EWS Watchlist 2018-02-02 11:51:07 PST Comment hidden (obsolete)
Comment 10 Ryosuke Niwa 2018-02-02 18:36:08 PST
Comment on attachment 332983 [details]
Updated patch with unit-tests

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

> Websites/perf.webkit.org/unit-tests/buildbot-syncer-tests.js:1356
> +        it('should not fetch recent builds when count is zero', () => {

Use async "() => {" here

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

Use const.

> Websites/perf.webkit.org/unit-tests/buildbot-syncer-tests.js:1362
> +            return promise.then((content) => {
> +                assert.deepEqual(content, []);
> +            });

and do:
await promise;
assert.deepEqual(content, []);

i.e.
async () => {
    const syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
    const promise = syncer._pullRecentBuilds(0);
    assert.equal(requests.length, 0);
    await promise;
    assert.deepEqual(content, []);
}

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

Use const.

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

Use const.

> Websites/perf.webkit.org/unit-tests/buildbot-syncer-tests.js:1380
> +            return promise.then((content) => {
> +                assert.deepEqual(content, []);
> +            });

Ditto about using async await.

> Websites/perf.webkit.org/unit-tests/buildbot-syncer-tests.js:1383
> +        it('should create BuildbotBuildEntry after fetching recent builds', () => {

Use async

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

use const.

> Websites/perf.webkit.org/unit-tests/buildbot-syncer-tests.js:1391
> +            return promise.then((entries) => {
> +                assert.deepEqual(entries.length, 2);

Use await.
Comment 11 Aakash Jain 2018-02-05 07:50:20 PST
Created attachment 333081 [details]
Patch for landing

Incorporated review comments.
Comment 12 Aakash Jain 2018-02-05 08:54:35 PST
Committed r228098: <https://trac.webkit.org/changeset/228098>
Comment 13 Radar WebKit Bug Importer 2018-02-05 08:55:28 PST
<rdar://problem/37238352>