In a resource constrained environment, it is inefficient to have multiple pipelines running at the same time for the same branch. (For example if you commit a change to a branch & push the change, a pipeline starts. If you then fix some formatting, modify a line of code or two, and push the new change, a second pipeline starts and they both run to completion). Not only is this a waste of build minutes, but it causes an actual problem when dealing with limited resources. (Use Case: Our company uses a program called IAR to run builds for embedded systems. Running this program requires a license. There are a limited number of seats for that license. Every time a pipeline is triggered, the bitbucket runner pulls a seat on our license to run the build. At the completion of the build the seat is released. These builds can take upwards of 30 minutes each. If a developer pushes a change and then pushes additional changes to the branch in that 30 minute build window, additional seats will be taken. If several changes are pushed the the seats will run out and subsequent builds will fail.) There should be 1)An option to have the latest version of a pipeline build automatically cancel any out-of-date pipelines on the same branch or 2)An option to Queue the pipelines and only run the latest version when the queue is started (or scheduled)
Similar functionality exists for other pipelines:
https://docs.semaphoreci.com/essentials/auto-cancel-previous-pipelines-on-a-new-push/
https://docs.gitlab.com/ee/ci/pipelines/settings.html
You can set pending or running pipelines to cancel automatically when a new pipeline runs on the same branch. You can enable this in the project settings:
Azure also seems to support at least option #2 through batching
trigger:
batch: true
Adding this feature I believe is necessary to make bitbucket pipelines more feature-complete and to keep it on-par with its competitors.
What do you guys think?