Make file matchers overridable

Files and irrelevant-files don't behave in the way people intuitively
expect.  If a job or template has an irrelevant-files matcher, it's not
possible to alter its set of irrelevant-files in a project-pipeline
variant.

This changes them to be treated as overwriteable attributes and evaluated
after branch-matching variants are combined.

* Files and irrelevant-files are overwritten, so the last value
  encountered when combining all the matching variants (looking only at
  branches) wins.
* It's possible to both reduce and expand the scope of jobs, but the
  user may need to manually copy values from a parent or other variant
  in order to do so.
* It will no longer be possible to alter a job attribute by adding a
  variant with only a files matcher -- in all cases files and
  irrelevant-files are used solely to determine whether the job is run,
  not to determine whether to apply a variant.

See http://lists.openstack.org/pipermail/openstack-dev/2018-May/130074.html
and http://lists.zuul-ci.org/pipermail/zuul-discuss/2018-May/000397.html
for further context.

Change-Id: I7b619df10c0896e696e065cb093d4e11911d3ce1
This commit is contained in:
James E. Blair
2018-06-01 12:28:44 -07:00
parent 9022b1e562
commit b48cdf46de
6 changed files with 169 additions and 41 deletions

View File

@@ -0,0 +1,8 @@
features:
- |
Files (and irrelevant-files) matchers are now overridable. Zuul
now uses only branch matchers to collect job variants. Once those
variants are collected, they are combined, and the files and
irrelevant-files attributes are inherited and overridden as any
other job attribute. The final values are used to determine
whether the job should ultimately run.