all 'interruptible' jobs in a pipeline should be cancellable
Summary
As discussed in !17639 (comment 221826708) - if you have:
stages:
- stage1
- stage2
- stage3
step-1:
stage: stage1
script:
- echo "Can be canceled"
interruptible: true
step-2:
stage: stage2
script:
- echo "Can not be canceled"
step-3:
stage: stage3
script:
- echo "should be cancellable"
interruptible: true
step-3 should always be cancellable.
What is the current bug behavior?
Currently if 'step-2' has started running, 'step-3' will never be cancelled by gitlab, even though it is marked interruptible and 'Auto-cancel redundant, pending pipelines' is enabled.
This is particularly an issue for us, where 'step-3' is actually a very long post-deployment test that interfere with each other if multiple pipelines are running on the same branch - we very much want those tests to be cancelled, instead of both the old and the new tests failing.
What is the expected correct behavior?
'step-3' should be cancelled if the pipeline is redundant, regardless of whether 'step-2' started running or not. (step-2 itself should, of course, never be cancelled once it has started running.)