Fix implied branch matchers and tags
Adding an implied branch matcher to jobs on in-repo project defs
works great when an item *has* a branch. But some items, such as
tags, don't. With recent changes, it is now impossible for a
project to add a job in-repo that runs in a tag pipeline.
To correct this, we need to drop some of the optimizations which
assumed we could match the implied branch against existing branch
matchers, and instead, when adding a job in-repo, simply add a new
kind of branch matcher, an ImpliedBranchMatcher, that is evaluated
in a boolean 'and' with any existing branch matchers.
The ImpliedBranchMatcher only fails if the item has a branch, and
the branch doesn't match. If the item doesn't have a branch, it
always succeeds.
This means that when a project adds a job to a tag pipeline in-repo,
it will most likely only have the ImpliedBranchMatcher, which will
simply succeed.
It also means that the multiple project configurations present in
the project's multiple branches can all add jobs to tag pipelines,
and so to remove such a job, changes may need to be made to all
branches of a project. However, there's not much that can be done
about that at the moment.
Change-Id: Id51ddfce7ef0a6d5e3273da784e407ac72a669db
10 files changed