95097565e6
When specifying job.override-checkout, we apply job variants from that match the specified branch. The mechanism we use to do that is to create a synthetic Ref object to pass to the branch matcher instead of the real branch of the Change (since the real branch is likely different -- that's why override-checkout was specified). However, branch matching behavior has gottes slightly more sophisticated and Ref objects don't match in the same way that Change objects do. In particular, implied branch matchers match Ref subclasses that have a branch attribute iff the match is exact. This means that if a user constructed two branches: * testbranch * testbranch2 and used override-checkout to favor a job definition from testbranch2, the implied branch matcher for the variant in testbranch would match since the matcher behaved as if it were matching a Ref not a Change or Branch. To correct this, we update the simulated change object used in the override-checkout variant matching routine to be a Branch (which unsurprisingly has a branch attribute) instead of a Ref. The test test_implied_branch_matcher_similar_override_checkout is added to cover this test case. Additionally, the test test_implied_branch_matcher_similar is added for good measure (it tests implied branch matchers in the same way but without specifying override-checkout), though its behavior is already correct. A release note is included since this may have an effect on job behavior. Change-Id: I1104eaf02f752e8a73e9b04939f03a4888763b27
14 lines
549 B
YAML
14 lines
549 B
YAML
---
|
|
fixes:
|
|
- |
|
|
The use of implied branch matchers in jobs where
|
|
`override-checkout` was specified could cause some jobs to include
|
|
unintended variants. Specifically: job variants with implied
|
|
branch matchers on branches which are substring matches of a
|
|
branch specified in the `override-checkout` job attribute may have
|
|
been used when not intended.
|
|
|
|
This has been corrected so that the same job variant matching
|
|
process happens whether the change's branch or the branch
|
|
specified by override-checkout is used.
|