how to exclude bamboo from branch permission rule

Hi all,

I have configured branch permission for my repo, which will  prevent pushes to master branch, meanwhile I added some service users like the Bitbucket user it uses to merge changes into master...

The issue is:

when bamboo completed tests on master branch which has merged in some auto upgrades in bamboo server, it will try to push the updated master branch back to repo's master branch, but it is blocked by branch permission.

My question is:

What is the user name the bamboo is using to push back to master branch, as long as I get the name, I can add it to exclusion list, but I can't find it. Anyone can show me how to get this Please?

3 answers

2 votes

In Bitbucket Server, it is possible to configure Bamboo as an exception to the branch permission rules.

This can be done using the Access Key that Bamboo adds to Bitbucket Server when a repository or a branch is added to a plan.

For example, if you want want Bamboo to be able to write to the master branch directly while all other users can only do that via a pull request, you can define the Branch Permissions in this way in Bitbucket Server:

SSP27050_branchPermissions.png

 

The value in the "except by" field corresponds to the Access Key that you can find in the repository settings in Bitbucket Server:

SSP27050_accessKeys.png

This feature is available since Bitbucket Server 4.14.0 as announced in the Add access keys to branch permissions blog post.

 

Caterina - Atlassian Support

0 votes

Hello Ian,

Please, go to Bamboo and in your plan branch uncheck push from merging option.

Kind regards,
Rafael P. Sperafico

Hi Rafael,

But we need bamboo to push the branch back to repo after a successful run, it is our auto_upgrade process which will pull merge the upgrade parts into master in bamboo and push the new master branch back to repo.

Hi guys, could anyone give me a response?

You cannot whitelist this event, the checkbox mentioned in the merge option is what allows Bamboo to communicate with Bitbucket server and for the push to be made. Alternatively, you can run a Script task to do the merge, providing the user who is going to to the merge.

Is there anyway to define a Bitbucket user specifically for Bamboo to use to push? So that I can add the user name into exclusion list...

Without unchecking the [ ] push checkbox in Bamboo, no. As already mentioned, this event is internal to both application and by checking the push checkbox you are allowing Bamboo to push against Bitbucket and this is the only moment Bamboo will push against your repositories as a security measure.

So if you want to prevent push from happening, uncheck the [ ] push checkbox and create a script task to communicate with your repository and do the merge.

Please, refer to the following for further information:

 

the weird thing is that:

in the past the bamboo pusher in Bitbucket will be shown as "access key user ..."

but after a reinstallation, the pusher name changed to "Bitbucket student account", which is just one of our normal user account.

We do not know how it was changed to this account, by the way, the bamboo branch updater is also using this account to update our review branches.

 

SO, I really need to know how and where the user bamboo is using to push is configured, there must be somewhere right?

Under this location you can find the committer Bamboo will use for the merging branch.

image2016-11-28 0:25:59.png

Suggest an answer

Log in or Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

682 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot