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

  1. 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
  1. Change any files in both app1 and app2 directories
  2. Push and wait for the pipeline to be created in pending state
  3. Change any file in app1 directory
  4. 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?

  1. A new pipeline with build app 1 job is created.
  2. Old pipeline with both build app 1 and build app 2 jobs is cancelled.

What is the expected correct behavior?

  1. A new pipeline with build app 1 job is created.
  2. build app 1 job is cancelled in old pipeline.
  3. build app 2 job is continued in old pipeline.

Output of checks

This bug happens on GitLab.com

Assignee Loading
Time tracking Loading