Forums

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

Default reviewers approvals required matching multiple rules

Tom George
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 25, 2019

So we have an issue with bitbucket server, which I have not been able to figure out nor have I found any documentation.

In our workflow we want to have all branches being merged into our master branch to have a minimum 2 reviewers with the exceptions of hotfix/ prefixed branches. In the default reviewers configuration we have setup a "All Branch" source with a master target requiring 2 reviewers. We then setup a hotfix/ prefix source with a master target requiring 1 reviewer. The problem we are having now is hotfix/ branches are still requiring 2 reviewers.

I don't know how the hierarchical or merge structure is setup for branch permissions so I don't know my best path forward.

1 answer

0 votes
Marty
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 25, 2019

Hi Tom,

I am not on the Bitbucket team but I will try to help.

I assume you're using Bitbucket Cloud?

Let's tease apart some concepts because Default Reviewers only refers to the people automatically added as reviewers on any new Pull Requests. The in-product description says "The following users will be added as reviewers on new pull requests by default."

It looks like you can only setup one set of default reviewers for the entire repository.

You can set default reviewers via Repository Settings -> PULL REQUESTS (heading) -> Default Reviewers.

 

A separate concept is Branch Permissions.

Branch Permissions control who can write to a branch or merge a pull request and how many approvals are needed.  It sounds what you really want is to have 2 approvals required for master but only 1 approval required for hotfix/ ... is that right?

If so, you want to add 2 branch permissions - one for master and one for hotfix/

For example, here is what my branch permissions look like for one of my repositories.

Screen Shot 2019-02-26 at 9.15.09 am.png

You can set branch permissions via Repository Settings -> WORKFLOW (heading) -> Branch permissions.

I hope that helps!

Libor Nenadál May 6, 2020

Marty, your suggestion does not help in situation where I want to lower restrictions for master -> release PR but want to be more strict otherwise (any other branch -> release).

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events