Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

A newer Pipeline build should be able to cancel any currently running pipeline -Feature Request-

Tyler Jones
Contributor
October 21, 2022

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

Auto-cancel redundant pipelines

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:

  1. On the top bar, select Main menu > Projects and find your project.
  2. On the left sidebar, select Settings > CI/CD.
  3. Expand General Pipelines.
  4. Select the Auto-cancel redundant pipelines checkbox.
  5. Select Save changes

Azure also seems to support at least option #2 through batching

trigger:  
    batch: true

see https://stackoverflow.com/questions/56798943/azure-devops-disable-concurrent-runs-on-the-same-pipeline.

 

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?

2 comments

Keith Mason January 19, 2023

Yes, after migrating from TeamCity, we are also finding that this would be a useful feature.  This is a discussion forum; is there a feature request for this yet?  I haven't been able to find one.

Like Tyler Jones likes this
anton-plebanovich
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 17, 2023

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events