Automatic branch merging despite branch restrictions

Tim Habermann
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!
January 31, 2025

I am working on an atlassian forge app that is supposed to merge changes through the release versions as in this discontinued feature https://confluence.atlassian.com/bitbucketserver0721/automatic-branch-merging-1115665735.html.

As far as I am concerned there is no way to merge anything without the use of pullrequests.
That's where the branch restrictions are coming in to play. Our workspace is configured in a way that only a few people are allowed to merge an pull request. 

I was not able to find a way to get around the branch restrictions or add the app to the designated users. The only workaround i could think of was to delete the restriction and add it again after the merge is done.

Is there a better way to do this that i am not thinking of?

1 answer

1 accepted

1 vote
Answer accepted
Saxea _Flowie_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 31, 2025

 Hi @Tim Habermann

As far as I am concerned there is no way to merge anything without the use of pullrequests.

You can perform git operations using Forge, so you can perform a branch merge. However this is also subject to branch restrictions.

I was not able to find a way to get around the branch restrictions or add the app to the designated users. 

While you can't add the app to the group, you might be able to add it to the branch restrictions. We do it on our app. It is not a Forge app, but it might work the same.

The only workaround i could think of was to delete the restriction and add it again after the merge is done.

You likely aware, but this has the side effect that for a few seconds users will be able to interact without the restrictions in place. The PR merge can take a while and you will likely only want to restore permissions once it is completed. Then you have multiple merges happening at the same time... it can get complicated fiddling with the restrictions.

Is there a better way to do this that i am not thinking of?

We provide a Bitbucket Cloud app, Flowie, which available via Atlassian marketplace and implements the automatic branch merging. The app manages the branch restrictions, has the cascade logic, which can be tweaked, and can also track the cascades - something that is not available in the original feature from Bitbucket. 

If you have any questions get in touch via support@flowie.app and we will be glad to assist you!

 

Tim Habermann
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!
February 2, 2025

Hi @Saxea _Flowie_
Thanks for the quick response.

I am not able to figure out how to add the app to a branch restriction.
Is there a special way to do that or should it be done the same way it is done for users? 

If the second one is the case it might not be possible.

Saxea _Flowie_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 3, 2025

Yeah, same as users. I think you are right, and this is possibly related to BCLOUD-22400.

Like Tim Habermann likes this

Suggest an answer

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

Atlassian Community Events