"interruptible" jobs should only be interrupted with fully similar pipelines
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Summary
When a pipeline is made of interruptible jobs, it should not be interrupted by a new pipeline on the same branch, yet running different jobs.
Steps to reproduce
- Create a
.gitlab-ci.yml
with some jobs which are interruptible and run only when a given variable is set; then other jobs which run on each commits, yet don't run the jobs which are run with the variable set. - Go to
CI/CD > Pipelines
and hit the "Run pipeline" button, prepare a new pipeline with the variable. The variable-triggered jobs will start in a new pipeline. - Now push to your branch. A new pipeline is triggered with different jobs.
Example Project
For instance in GIMP, we have the jobs flatpak
and flatpak-nightly
which are run in sequence only when $GIMP_CI_FLATPAK
is set and would respectively build then publish the nightly flatpak package to the GNOME nightly repository.
This is how I discovered this issue, because I was wondering why a triggered pipeline to build our flatpak was marked canceled (this was not the first time I noticed this happening). I even wondered if I clicked on the Cancel button by mistake. Actually I had just pushed some commit which triggered a new pipeline, canceling the flatpak pipeline.
What is the current bug behavior?
Since a new pipeline is run for the same branch, and that the currently running pipeline has interruptible jobs, it gets canceled.
The problem is that it makes no sense, because the new pipeline does not even contain the canceled jobs. The interruptible
state is meaningful when the new pipeline would anyway do the same thing based on more recent code and you are fine with only this last build. Here this new pipeline doesn't do the same thing at all.
What is the expected correct behavior?
The new rule for the interruptible flag should be:
When enabled, a pipeline is immediately canceled when a new pipeline starts on the same branch if either of the following is true:
- All jobs in the pipeline are set as interruptible.
- Any uninterruptible jobs have not started yet.
And all the jobs (currently running or which would run later) in the running pipelines would also be run in the new pipeline.
Results of GitLab environment info
Whatever is on GNOME's Gitlab instance.
Results of GitLab application Check
Whatever is on GNOME's Gitlab instance.