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

Extended Merge Checks in Bitbucket

Simon Hönscheid November 5, 2018

Hi community,

I would like to restrict merging on a repository

1. Only the creator of the PR is able to merge or users in group X

2. At least 2 reviewers, one has to be from from group X

How can I achieve this goal?

1 answer

1 accepted

1 vote
Answer accepted
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.
November 5, 2018

The paid ScriptRunner for Bitbucket add-on might have an ability to do this.  I'm not familiar enough with it to say for sure, but scan through the docs or try an evaluation and click around. It might work!

Otherwise write your own pre-receive plugin for Bitbucket Server.  YACC is a good starting point since it's open source - download Atlassian SDK, clone YACC,  type "atlas-run", and start hacking!  (Note: every time you type "atlas-package" afterwards, your local developer Bitbucket instance will reload to grab your latest logic).  The key call would be something like this in the hook:

if (thingsAreGood) {
return RepositoryHookResult.accepted();
} else {
return RepositoryHookResult.rejected("summaryRejectMessage", "detailedRejectMessage");
}

My own free Control Freak add-on cannot handle the scenario you described.

Simon Hönscheid November 21, 2018

This looks promising, thanks @Julius Davies _bit-booster_com_

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events