Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Pipelines - Pull Request triggers - merges

Andy Rouse
Contributor
February 8, 2024

The Documentation states that the destination branch is merged into the working branch before it begins: 

https://support.atlassian.com/bitbucket-cloud/docs/pipeline-start-conditions/

This is very helpful, but I'd like to check the behaviour in a multi-step pipeline.

When the documentation says "before it runs" - Does it mean "before it runs, for the first step" or "before it runs each step"?

The reason I ask is that I have a pipeline where the second step is manual and may not happen for a while. In that time, there may be additional commits to the destination branch and I've seen some odd discrepancies in diffs that happen in the different steps. I'd like to understand whether this merge might have any impact or not. 

I'm attempting to run some automated validations and deployments into Salesforce using sfdx and a very useful plugin called sfdx-git-delta. It's been very useful, but due to some differences in behaviour between the steps, I'm cautious.

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 12, 2024

Hi Andy,

I see that you created a support ticket for this issue, but I wanted to leave a reply here for any other users who may come across your question:

For every step of your build, a Docker container starts (the build container) using the image you have specified in your bitbucket-pipelines.yml file. The repo is cloned in this container, the merge occurs (for pull-requests pipelines) and then the commands of the step's script get executed. When the step is finished, the container gets destroyed.

This process occurs for every step, so it will also occur for a manual step that you trigger later. If there are any additional commits in the destination branch by the time you trigger the manual step, they will not be taken into account. The pipeline will merge the same commit of the destination branch that it used in the first step of the same pipeline. You can see that if you expand the Build Setup part of the build log for each step.

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events