Backend: Support disabling auto-cancel pipelines for certain branches
Problem to solve
I have a project that deploys automatically to production from the pipelines running for master branch.
I've recently added interruptible: true
for most of the jobs configured for the pipelines (build, test, etc), but I started having the problem of deployments being canceled because merge requests were being merged to master before the previous pipelines finished running.
I don't want the pipelines for master (i.e. the ones who deploy stuff) to be auto-canceled, I only want the pipelines for branches to be auto-canceled.
My first instinct to do was to use interruptible: $CI_COMMIT_REF_NAME != "master"
but this is not supported.
So it would be cool to either support variable expansion in interruptible
or to be able to disable auto-cancel for some branches (master, in my case).
Further details
To give context how other tools handle this: Circle CI has a feature to auto-cancel redundant builds, which is enabled only for development (non-master
) branches:
https://circleci.com/docs/2.0/skip-build/#auto-cancelling-a-redundant-build
Proposal
My idea was to support variable expansion for interruptible so that one could do things like interruptible: $CI_COMMIT_REF_NAME != "master"
as it sounds very flexible, but I imagine this can make things a lot more complex and I can't think of other use cases.