Skip to content

Flatten CI config rules

Matija Čupić requested to merge mc/feature/flatten-ci-config-rules into master

What does this MR do?

Changes rules to flatten its elements. This makes it possible to nest arrays of rules in the rules CI config section anywhere. This is useful when using !reference to compose rules out of several arrays of rules.

This means that

.no_schedule:
  rules:
    - if: $CI_PIPELINE_SOURCE == "schedule"
      when: never
    - when: on_success

job1:
  image: alpine:latest
  rules:
    - !reference [.no_schedule, rules]
  script:
      - echo "run except schedules and tags"

used to be invalid CI config but is now valid.

Related #322992 (closed)

How to setup and validate locally (strongly suggested)

Does this MR meet the acceptance criteria?

Conformity

Edited by Alex Kalderimis

Merge request reports