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

add reviewers to a pull request based on git blame

Michelle Geppert February 21, 2022

Is there a way automatically add reviewers to a pull request based on git blame?

There is a listener that can add reviewers, but no examples on how to run a git command so you know who to add.  If there were, the git commands to find the answer is rather complicated.  It would be nice if there were built in way to do this.  It's an option on Gerrit.

 

addMandatoryUsers("user", "userB")
addDefaultUsers("userC")
addMandatoryGroups("mandatory")
addDefaultGroups("default", "defaultB")

1 answer

0 votes
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 23, 2022

Hello @Michelle Geppert ,

Thank you for reaching out to Atlassian Community.

If I understand your question correctly, you would like to explore ways on Bitbucket Cloud to manage the default reviewers/mandatory reviewers of your pull-request.

Default reviewers feature allow you to automatically add one or more users as reviewers when a pull request is created in your repository. Currently, the default reviewers can be configured at project or repository level, as following : 

Project level - Default reviewers :

Adding default reviewers to a project allows you to specify reviewers that Bitbucket will automatically add to any pull requests in any repositories in your project, unless otherwise specified in the repository’s settings.

  1. In the project, select project settings in the left sidebar.

  2. Select Default reviewers under Pull Requests on the left sidebar.

  3. Select the Add reviewers button.

  4. In the Add default reviewers dialog, add the names of any members of the workspace in which this project resides to add them as a default reviewer.

Repository level - Default reviewers :

Adding a default reviewers at the repository level, only apply the changes to that specific repository.

  1. In the repository, select Repository settings in the left sidebar.

  2. Select Default reviewers under Pull Requests on the left sidebar.

  3. Select the Add reviewers button.

  4. In the Add default reviewers dialog, add the names of any members of the workspace in which this repository resides to add them as a default reviewer.

 

In addition to default reviewers, you can also configure merge checks in your repository to specify, for example,  how many of the specified default reviewers should approve a pull request prior to merging to ensure that a minimum level of review occurs.Merge checks can be configure under Branch permissions, and you can refer to the following documentation on how to setup that :

Also, if your workspace is on a Premium plan, repository admins can prevent pull requests  with unresolved merge checks from being merged.

Hope that helps. Do let us know in case you have any questions.

Thanks, @Michelle Geppert .

Kind regards,

Patrik S

Michelle Geppert June 13, 2022

So the answer is no that's not possible.

 

We have a large code base with a large team and we'd like to make sure the last person to touch the code being modified is on the pull request.  But since that's not possible we'll make do.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events