Bug 167152 - 'buildbot-syncer.js' should be able to determine force build argument from a list of possible repositories.
Summary: 'buildbot-syncer.js' should be able to determine force build argument from a ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-17 20:28 PST by dewei_zhu
Modified: 2017-01-18 19:20 PST (History)
3 users (show)

See Also:


Attachments
Patch (9.40 KB, patch)
2017-01-17 20:28 PST, dewei_zhu
no flags Details | Formatted Diff | Diff
Patch for landing (10.69 KB, patch)
2017-01-18 18:43 PST, dewei_zhu
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description dewei_zhu 2017-01-17 20:28:16 PST
'buildbot-syncer.js' should be able to determine force build argument from a list of possible repositories.
Comment 1 dewei_zhu 2017-01-17 20:28:59 PST
Created attachment 299115 [details]
Patch
Comment 2 Ryosuke Niwa 2017-01-17 20:46:35 PST
Comment on attachment 299115 [details]
Patch

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

r=me assuming all the issues below are addressed.

> Websites/perf.webkit.org/tools/js/buildbot-syncer.js:231
> +                for (let rootCandidate of value['rootCandidates']) {
> +                    if(!(rootCandidate in repositoryByName))
> +                        continue;

We should just use filter instead.
e.g. const filteredOptions = value['rootOptions'].filter((option) => option in repositoryByName);
and then check that the filtered result is of length 1.

> Websites/perf.webkit.org/tools/js/buildbot-syncer.js:394
> +            case 'rootCandidates': //fallthrough

Nit: Capitalize f and there should be a space between // and f.

> Websites/perf.webkit.org/unit-tests/buildbot-syncer-tests.js:19
> +                    'opensource': {'rootCandidates': ['WebKit-SVN', 'WebKit-Git']},

I don't think the term "candidate" makes sense given we're picking one of them.
How about 'rootOptions' or 'rootChoices'?

> Websites/perf.webkit.org/unit-tests/resources/mock-v3-models.js:21
> +            MockModels.opensourceRepository = Repository.ensureSingleton(17, {name: 'WebKit-Git'});

I don't think we want to call this opensourceRepository. Probably something like webkitGit?
Comment 3 dewei_zhu 2017-01-18 18:43:23 PST
Created attachment 299214 [details]
Patch for landing
Comment 4 WebKit Commit Bot 2017-01-18 19:20:49 PST
Comment on attachment 299214 [details]
Patch for landing

Clearing flags on attachment: 299214

Committed r210909: <http://trac.webkit.org/changeset/210909>
Comment 5 WebKit Commit Bot 2017-01-18 19:20:54 PST
All reviewed patches have been landed.  Closing bug.