Child job `rules` should always take precedence over parent job's `only`/`except` (and vice-versa)
Currently, if I have the following CI config:
job-a: only: refs: - master except: refs: - merge_requests script: echo "foo" job-b: extends: job-a rules: - if: '$CI_MERGE_REQUEST_ID' script: echo "bar"
I get a validation error:
jobs:job-b config key may not be used with `rules`: only, except
Note that we get the same problem if
jobA is defined in a template.
While the error is preventing clashing conditions, it would be great if
rules from a child job could always take precedence over
except of its parent job so that we don't get the validation error (i.e.
except would be dropped for the
job-b job since it declare
That this proposal should work the same if
job-ais defined in a template.
The same thing should apply to rules (i.e.
ruleswould be dropped for the
job-bjob since it declare
job-a: rules: - if: '$CI_MERGE_REQUEST_ID' script: echo "foo" jobb: extends: job-a only: refs: - master except: refs: - merge_requests script: echo "bar"
This proposal would greatly ease the update of our
rules (&2300 (closed)) and allow to not make this update a breaking change.