Skip to content

Fix when include has rules with invalid rule

Furkan Ayhan requested to merge 341488-fix-error-for-include-rules into master

What does this MR do and why?

Bug description: #341488 (closed)

The include:rules keyword only supports if conditions. When you use other conditions, like exists, the GitLab CI config file show page returns 500. Also, the created pipeline raises an undefined error.

This MR fixes that error and raises a proper message.

Screenshots or screen recordings

Before

Screen_Shot_2021-09-23_at_11.22.17

After

Screen_Shot_2021-09-23_at_11.22.41

How to set up and validate locally

include:
  - local: configs/builds.yml
    rules:
      - exists:
        - '$INCLUDE_BUILDS'

test:
  stage: test
  script: exit 0

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports

Loading