only: changes: ... auto-cancels not matched jobs
Summary
When using the "only: changes: ..." policy for multiple jobs any matched job will cancel all pending jobs from previous push.
Steps to reproduce
- Use a .gitlab-ci.yml like:
build app 1:
stage: build
only:
changes:
- app1/**/*
script:
- ./build.sh app1
build app 2:
stage: build
only:
changes:
- app2/**/*
script:
- ./build.sh app2
- Change any files in both app1 and app2 directories
- Push and wait for the pipeline to be created in pending state
- Change any file in app1 directory
- Push changes again and wait for the pipeline to be created
Example Project
https://gitlab.com/wwfranczyk/mono-test
See pipeline 3 (changes inside all directories) and pipeline 4 (change in app1 only).
What is the current bug behavior?
- A new pipeline with build app 1 job is created.
- Old pipeline with both build app 1 and build app 2 jobs is cancelled.
What is the expected correct behavior?
- A new pipeline with build app 1 job is created.
- build app 1 job is cancelled in old pipeline.
- build app 2 job is continued in old pipeline.
Output of checks
This bug happens on GitLab.com