In the
Gitlab settings
Show archive.org snapshot
the flag Auto-cancel redundant pipelines is enabled by default. This auto-cancels pipelines with jobs that have the interruptible setting set to true (defaults to false e.g. to not cancel deploys by accident).
Consider setting the interruptible flag for test jobs to reduce the load on your runners like in the following example .gitlab-ci.yml:
rubocop:
interruptible: true
script:
- 'bundle exec rubocop'
rspec:
interruptible: true
script:
- 'bundle exec rspec'
Afterwards new pushes to your MR will cancel pending and interruptible running pipelines and start a new pipeline with the current commit.
Note
Running pipelines are only canceled if all running jobs are configured with
interruptible: trueor no jobs configured withinterruptible: falsehave started at any time. After a job withinterruptible: falsestarts, the entire pipeline is no longer considered interruptible.
Tip
Instead of configuring jobs to be interruptible by default, you can also setup your
.gitlab-ci.ymlso commit messages with a string likeno-cidon't start a new CI pipeline.