Someone please explain "Branch merging" and whether I should be using it

Jonas Gucu March 26, 2024

Hello,

We are currently migrating to a new Bamboo version and I'm remaking our pipelines.

One thing I noticed is, on every pipeline, Branch Merging is enabled with the "Branch Updater" option.

Everything is fine with it, I think.

A couple of builds for projects with development and master branches are failing. For some reason when building development branch on new Bamboo, it tries to merge itself with master branch and it fails due to conflicts. I don't understand why this is happening?

 

P.S. I noticed that the same projects have Branch Merging disabled for development branch in old Bamboo. I'm guessing someone ran into the same problem as I am currently.

 

What to do?

 

Thank you.

 

Update: I found a post on SO that says "The "Branch Updater" feature is to merge the code from master branch into feature branch after a successful build of the master branch.".

Is this only valid for branches that start with "feature/"?

1 answer

1 accepted

2 votes
Answer accepted
Ayrijit Swain
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 27, 2024

Hello Jonas,

Welcome to Atlassian community.

When Branch merging is enabled with Branch Updater option, current branch(feature branch) is checked out followed by merge from the master branch. Upon successful merge, build is run against the plan branch.

Optionally on successful build, bamboo can push the changes to the to the current branch in the source repository.

You can refer to the pictorial representation of what happens in the background.

image.png

With regards to your query,

Is this only valid for branches that start with "feature/"?

Branch merging can be configured for all the plan branches in Bamboo and not necessarily with branches that start with "feature/"

 

Regards,

Ayrijit Swain

**please don't forget to Accept the answer if your query was answered**

Jonas Gucu March 27, 2024

Hello,

 

Image is not showing.

 

Can you explain why this happens?

 

dev master fail.png

 

And this is only happens for a few projects.

 

Why is it trying to merge dev with master when building development branch?

Ayrijit Swain
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 27, 2024

Hello Jona,

 

I am sorry that the image is not loading for you. You may refer to the documentation which has more details regarding the Branch update merging statergy in Bamboo https://confluence.atlassian.com/display/bamboo/using+plan+branches#:~:text=Under%20Merging%20select%20Branch%20merging,Select%20Save

With regards to your query below,

Why is it trying to merge dev with master when building development branch?

For Branch updater  merge, it merges the master with the feature branch. If you are saying its the other way around, please check if  Gatekeeper branch merging is enabled for the plan. You can find more details on how Gatekeeper works in the same article posted above.

For any build failure that happens due to merge conflict, needs to be resolved by the developer outside in the source code repository.

 

Regards,

Ayrijit Swain

Jonas Gucu March 29, 2024

Okay, but it's normal that development and master branches are different and there will be conflicts.

 

So should I just disable branch merging for development branch?

Ayrijit Swain
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 1, 2024

HI Jonas,

If the conflicts are very common for your development branch, you may disable the branch merging for the build to pass.

However, this feature is helpful to detect conflicts for each change and resolve it when build failures are detected which will be much easier for the development team as compared to resolving conflicts for multiple changes at once.

You may discuss this with your development team and decide if disabling branch merging would be a better option for the team.

Regards,

Ayrijit Swain

**please don't forget to Accept the answer if your query was answered**

Jonas Gucu April 2, 2024

Thanks.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events