Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

how to exclude bamboo from branch permission rule

IanYifanChan November 10, 2016

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

1 accepted

2 votes
Answer accepted
Caterina Curti
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 18, 2018

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
IanYifanChan November 21, 2016

Hi guys, could anyone give me a response?

rsperafico
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 21, 2016

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.

IanYifanChan November 21, 2016

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...

rsperafico
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 21, 2016

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:

 

IanYifanChan November 27, 2016

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?

rsperafico
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 27, 2016

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

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

Ram April 10, 2018

Hi Rafael,
    I am using Atlassian Bamboo version 5.13.0.1 build 51314 and Atlassian Bitbucket v4.9.1. Unfortunately, exempting "Access Keys" in Branch Permissions doesn't work in the Bitbucket v4.9.1.  And the moment I restrict permissions to my branch for users, Bamboo cant merge to the branch - reports that the branch is read-only. Please let me know if there is way to fix this. 
Also , it would be great if you can re-attach the image as it seems missing now.

Thanks.
RamN
    

Caterina Curti
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 10, 2018

Hi @Ram,

Have you seen my reply above (it is the top one in this thread), there is also a screenshot there.

 

Note: this feature is available since Bitbucket Server 4.14.0.

 

Cheers,

Caterina - Atlassian

Ram April 11, 2018

Thanks Caterina Curti

0 votes
rsperafico
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 11, 2016

Hello Ian,

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

Kind regards,
Rafael P. Sperafico

IanYifanChan November 13, 2016

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.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events