bitbucket "Check for at least X approval" never works.

SH
Contributor
December 11, 2024

We have many repos and many developers.

All repos have a branch restriction for our develop and master branch which is:

  1. Check for at least 2 approval
  2. Check for at least 1 approval from default reviewers
  3. deleting this branch not allowed
  4. rewriting branch history not allowed
  5. check for unresolved pull request tasks.
  6. Merge access via pull requests: everyone with access to the repo has merge access

 

The problem is any developer, who only has write permission (not admin), can merge their own pull requests with no reviewers.

Because we cannot enforce that at least one person has reviewed a given PR, we end up with unreviewed and unchecked code being merged.

Why does "check for at least X approval" not work?  How can we enforce that PRs cant be merged to a given branch without approval?

 

 

1 answer

0 votes
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 12, 2024

Hello @SH ,

Thanks for reaching out.

This happens because, by default, the merge checks are just a suggestion for the developer, meaning that the developer can still merge the changes even though not all the merge checks were met (see Suggest or require checks before a merge)

The ability to enforce that each and every merge check is satisfied before a developer has access to merge is part of the Premium plan, where you would need to enable the option "Prevent a merge with unresolved merge checks" in the branch restriction :

Screenshot 2024-12-12 at 5.43.43 PM.png

This would enforce that all the merge checks configured in that branch restrictions will be mandatory before the users are able to complete the merge. Even though they see the merge button, with that option enabled, they wouldn't be able to complete the merge and a warning message will be shown.

I'm sharing below the instructions to upgrade your plan in case you decide to upgrade to Premium to use the merge check enforce feature : 

Hope that helps! Should you have any questions, feel free to ask.

Thank you, @SH !
Patrik S

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events