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.
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:
Halted This pipeline was halted because another pipeline was deploying to devops-test. I tried setting a global concurrency group (e.g., concurrency-group: vlocity-deployment) instead of using ${BITBUCKET_BRANCH}, but the problem persists.
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!
Thanks for reaching out to the community.
By default, you won't be able to run builds simultaneously on the same deployment environment.
Note: you can only have one in-progress deployment in each environment. Any later pipelines that deploy to the same environment will be automatically paused. You can manually resume the paused deployment step once the in-progress deployment completes.
May I know why you'd need to deploy using PR trigger?
Regards,
Mark C
Hi @Mark C ,
Whenever our PR is open it always run Salesforce Validation, Salesforce Deployment is triggered when our PR is merged to target branch i.e. any changed being merged to target branch triggeres deployment as we want to deploy only delta changes which were part of PR.
I want to understand best practices or suggestion to tackle my scenario, where build shouldn't go into queue. Will concurrency group not help?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Additional context:
1. Branch deployments target the same environment (devops-test) and use stages, which seem to lock the environment per pipeline. This causes merged PRs to halt instead of queueing automatically.
2. We tried global concurrency groups, splitting stages into multiple steps, and manual triggers, but the problem persists.
3. Is there any way to configure branch deployments so that if another deployment is already running on the same deployment environment, the new deployment automatically goes into a queue and resumes when the previous one finishes? If not, are there any recommended workarounds to achieve this behavior?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.