Skip to content

Flexible Rules for CI Build config

drew stachon requested to merge drew/gitlab-ce:ci-config-on-policy into master

What does this MR do?

This merge request introduces a new job inclusion config syntax to replace only/except, outlined in #60085 (moved).

So far, this new structure only supports a list of rules with if:, changes: and when: keys.

"run if $DEFINED_VARIABLE matches /present/, otherwise do not"

rspec:
  rules:
    - if: '$DEFINED_VARIBLE =~ /present/'
      when: 'always'
    - when: 'never'

"run unless $DEFINED_VARIABLE == 'skip'"

rspec:
  rules:
    - if: '$DEFINED_VARIABLE == 'skip'"
      when: 'never'
    - when: 'always'

"run if $DEFINED_VARIABLE == 'skip' and previous stage succeeds, otherwise do not"

rspec:
  rules:
    - if: '$DEFINED_VARIABLE == 'skip'"
      when: 'on_success'
    - when: 'never'

I stole the milestone and all the labels from #60085 (moved) except Deliverable. Feel free to adjust.

Does this MR meet the acceptance criteria?

EE compatibility MR: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/15434

Conformity

Performance and testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by drew stachon

Merge request reports