Transition from only/except to rules
This MR replaces only/except
conditions with rules
. This change enables rpmci users to define more specific conditions for job execution (e.g. set koji_scratch
as auto job for protected branches and as manual job for feature branches, thus allowing koji specific variables to be protected).
Additionally:
From Gitlab Keyword Reference:
only and except are not being actively developed. rules is the preferred keyword to control when to add jobs to pipelines.
Rules offer more granularity and flexibility comparing to only/except
. However, rules
and only/except
cannot be mixed:
rules replaces only/except and they can’t be used together in the same job. If you configure one job to use both keywords, the GitLab returns a key may not be used with rules error.
Rules are defined as YAML arrays so they cannot be merged (in case of extending jobs). However, there are workarounds for this:
- Using native YAML anchors (https://stackoverflow.com/a/67012275)
Note: For testing, included yml
files in rpm-ci.yml
should be replaced with the corresponding ones for the feature branch instead of the master ones