Behaviour of except:changes is unexpected

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

The issue #24830 (closed) documents that the expectations of except:changes are not well aligned with the implementation.

except:changes seems to be implemented as an inverted only:changes. The behaviour is neither documented nor reasonable, in my opinion.

Imaginary repo

  • README.md
  • app.js
  • gitlab-ci.yml

The CI is configured to not run a pipeline, when README.md is changes (except:changes - README.md)

Current behaviour

When a commit changes README.md and app.js, no pipeline is triggered

Expected behaviour

If a commit only changes files in except:changes, no pipeline should be triggered. When a commit changes README.md and app.js, a pipeline should be triggered

Discussion

Changing this would be a breaking change and should be carefully considered. While thinking through this, I have not come across a use-case, where the current behaviour made sense for me though. Looking at the commit: Why would a commit, that changes a few files trigger a pipeline, while a commit with the same files plus one additional file should not trigger a pipeline? Is there a valid case for this?

Please see this as an honest question - I have not been able to come up with such a case.

If a breaking change is not acceptable, this could maybe be incorporated into #198688

Edited by 🤖 GitLab Bot 🤖