Hi Bitbucket team / Community,
I am facing an issue with my Bitbucket pipelines where branch deployments halt when multiple PRs are merged, even though concurrency groups are configured.
Here’s my scenario:
I have PR pipelines that run Salesforce validation . These pipelines run per PR branch, and concurrency works perfectly — if multiple PRs trigger validation at the same time, they queue and auto-resume once previous builds finish.
I also have branch pipelines for deployments (Salesforce + Vlocity) on a branch called ankit_vlocity.
definitions:
steps:
- step: &sf-validate
name: Validate Salesforce (Delta)
script:
- ./cicd-scripts/validateDeployment.sh
concurrency-group: salesforce-validation-${BITBUCKET_BRANCH}
- step: &sf-deploy
name: Deploy Salesforce (Delta)
script:
- ./cicd-scripts/deploySalesforce.sh
concurrency-group: salesforce-deployment
- step: &vlocity-deploy
name: Deploy Vlocity (Delta)
script:
- ./cicd-scripts/deployVlocityDelta.sh
concurrency-group: vlocity-deployment
pipelines:
pull-requests:
"**"
- step:
<<: *sf-validate
name: Salesforce Validation
deployment: devops-test
branches:
ankit_vlocity:
- stage:
name: Deploy to DevOps-Test
deployment: devops-test
steps:
- step:
<<: *sf-deploy
name: Salesforce Deployment
- step:
<<: *vlocity-deploy
name: Vlocity Deployment
Problem:
When multiple PRs are merged to ankit_vlocity, the branch pipeline triggers multiple deployments for the same branch.
The pipeline initially shows as waiting, then moves to Halted stage with this message:
<span>Halted This pipeline was halted because another pipeline was deploying to devops-test. </span>
Observations:
PR validation pipelines queue and auto-resume properly, likely because each PR has its own branch concurrency queue.
Branch deployments halt because multiple pipelines are triggered for the same target branch/org, and Bitbucket seems to queue the entire stage, which blocks the pipeline from auto-resuming.
Questions:
Why does the branch deployment halt even when a global concurrency group is used?
Is there a recommended way to configure concurrency so that multiple merged PRs deploying to the same branch/org queue properly and auto-resume?
Would splitting stages or changing concurrency behavior fix this issue, or is this expected Bitbucket behavior for branch pipelines?
Any guidance or best practices would be greatly appreciated.
Thanks in advance!