workflow:rules:changes no longer trigger pipelines

Update - workaround

Until we'll fix this regression there is a workaround by adding path key to changes

Summary

Pipelines are no longer triggered when the block workflow:rules:changes is present in the .gitlab-ci.yml file. This is a regression. The sample project used in "steps to reproduce" is just a simplified version of the issue we are encountering in our projects, containing more complex .gitlab-ci.yml workflows.

Tickets

Steps to reproduce

  1. Create blank project in GitLab
  2. Go to CI/CD > Pipelines and use "Try test template"
  3. New pipeline is created
  4. Modify the .gitlab-ci.yml file and add the following block. Commit.
workflow:
  rules:
    - if: $CI_COMMIT_BRANCH =~ /^(main)$/i
      changes:
        - .gitlab-ci.yml
      when: always
    - when: never
  1. New pipeline is not created
  2. Modify the .gitlab-ci.yml file and comment the changes block. Commit
workflow:
  rules:
    - if: $CI_COMMIT_BRANCH =~ /^(main)$/i
      #changes:
      #  - .gitlab-ci.yml
      when: always
    - when: never
  1. New pipeline is created

Example Project

Use the above steps on a blank GitLab project

What is the current bug behaviour?

Pipeline is not triggered when files that should trigger it are modified

What is the expected correct behaviour?

Pipeline should be triggered when files that should trigger it are modified

Relevant logs and/or screenshots

N/A

Output of checks

GitLab.com, GitLab Enterprise Edition 15.2.0-pre 9d9a7c86

Workarounds

  1. Temporarily comment out or remove workflow:rules:changes
  2. Running the pipeline manually from CI/CD > Pipeline. This does not apply when pipeline should be triggered on merge requests, in this case we have a merge request that waits for the pipeline indefinitely.
Edited by Dov Hershkovitch