Merge checks for a specific reviewer - Approve needed before merge

Dennis Bilouosv January 15, 2019

Hello,

I would like to have an option to specify a specific user as a reviewer for a repository where he/she needs definitely to approve a PR before a merge can happen.

Thank you in advance!

Kind regards,
Dennis

1 answer

1 vote
Julius Davies _bit-booster_com_
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 16, 2019

Repository --> Settings --> Default reviewers

Set the "Approvals Required" to 1, and put their name in the "Default reviewers" box.

I recommend setting this up so it only triggers on merges into 'master' and 'release/*'.  In other words:

Source Branch:  Any

Target Branch: master

(and then add another "Default Reviewers" config for Target Branch: release/*).

Meanwhile, you also need to configure things so that all changes into 'master' and 'release/*' must go through pull-requests (otherwise people can just directly push to master).  This "Default Reviewers" control only applies to pull-requests.  It does not apply to direct pushes.

My free Control Freak add-on is good for enforcing mandatory pull-requests against the major branches globally (e.g., master, release/*).

Dennis Bilouosv January 17, 2019

Thank you for the quick response!

The option you describe to achieve the goal would mean I have to define only one default reviewer. However I would like to have more than one default reviewer.

So it sounds to me like a workaround. Do I oversee something?

Kind regards
Dennis

Julius Davies _bit-booster_com_
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 17, 2019

 

I encourage to play with the "Default Reviewers" feature of Bitbucket Server in your local instance.  I think it will achieve everything you need.  Here is the documentation for the feature:  Add default reviewers to pull requests.

---

To your specific followup question:

You can put as many people as you like in the "Default reviewers" box for each reviewing rule you add.  The names in the box will all be automatically linked to all PR's that match the Source / Target branch patterns specified for that particular rule.

Note: if you set "Approvals Required" to 1 yet have two names in the "Default reviewers" box, then either one of the 2 people can click "Approved" before the PR can merge.

If you set "Approvals Required" to 2 and have exactly 2 names in the box, then both of those 2 default reviewers must approve every PR their reviewing rule matches against.  This can slow things down since it creates a bottleneck, especially in busy repositories.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events