Bug 167152

Summary: 'buildbot-syncer.js' should be able to determine force build argument from a list of possible repositories.
Product: WebKit Reporter: dewei_zhu
Component: New BugsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, dewei_zhu, rniwa
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch for landing none

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.