Workzone mandatory reviewers required approvals are not blocking a PR merge
Asked by Andy Palmer:

I have recently started to use the trial of Workzone to see if a particular feature would work. I am trying to add a particular reviewer to a particular path in the repository as a required approval. It looked like this would work. I attached 2 screens of the settings from under the Repo Settings -\> Workzone -\> Reviewers Tab:

Destination Branch: (main as an example)

Then under File/Path reviewer settings:

Mode: Simple pattern

Path pattern: foo/\*\*/\*

Mandatory Users: \<username\>

Require mandatory approvals: 1 (checked)

After saving the settings, if I open a new PR, the user specified under Mandatory Users is added to the review (message is something like: "User(s) \<username\> have been added automatically as predefined branch reviewers."), however, the review can be merged even without this user's approval. The Merge button is still active.

Note the screenshot with the red arrow, where it is pointing I would expect to see a yellow icon warning it can not be merged without an approval (similar if you set minimal approvers in the general bitbucket settings).

I've tried adding them also to the general User list in the plugin but no luck.

Am I missing some setting that is preventing it from blocking a merge without the mandatory user approval? Please let me know if any further information is needed.


Answers:
author: Andy Palmer
body: ![workzone_1.png](https://community.atlassian.com/t5/image/serverpage/image-id/264643iA541E289F03C9EC0/image-size/large?v=v2&px=999 "workzone_1.png")![workzone_2.png](https://community.atlassian.com/t5/image/serverpage/image-id/264642iD45B0CF8A37AC1AF/image-size/large?v=v2&px=999 "workzone_2.png")![workzone_3.png](https://community.atlassian.com/t5/image/serverpage/image-id/264641iE969E84A14A0CB99/image-size/large?v=v2&px=999 "workzone_3.png")

comments: author: Ulrich Kuhnhardt _IzymesCo_
body: Hello Andy,

Thanks for reaching out.

The solution to your problem is to make Workzone *enforce* merge checks. You can do this in either

* global Workzone settings (in the BB admin area) for the whole instance
* Project-wide in Workzone project settings \> Properties
* Repo-wide in Workzone repo settings \> Properties

Here is an example how to turn this on for the repo

![enforce merge check.png](https://community.atlassian.com/t5/image/serverpage/image-id/264647i4DFD698FEE205E7C/image-size/large?v=v2&px=999 "enforce merge check.png")

Once this is enabled, you should no longer see the merge button.

Let me know how you go.

Cheers, Ulrich

// Izymes - the makers of Workzone


author: Ulrich Kuhnhardt _IzymesCo_
body: My previous reply assumes you have a Workzone merge configuration in place for the 'main' branch.

Workzone needs to know what other merge checks it should perform. If you haven't already please create a minimal Workzone merge config for destination branch 'main'

* Destination branch: main
* Merge user: Leave blank if you want to manually merge when all merge conditions are met, or, add a user with destination branch write permission so the PR can be merged automatically
* You can add more conditions, but the file/path reviewer quota you have configured should be enough for starters.

![merge config.png](https://community.atlassian.com/t5/image/serverpage/image-id/264649i8861AD1F9214B56D/image-size/large?v=v2&px=999 "merge config.png")

Hope that gets you going. If you have any trouble please reach [out to our support](https://marketplace.atlassian.com/vendors/1210584/izymes-pty-ltd).


author: Andy Palmer
body: Ulrich, thanks for the quick response. This definitely worked, thank you.

One follow up question, in the merge issues (yellow icon by merge button), if the mandatory approver does not approve, I see the following:

Current value/(target) approvalQuota: 50/(0), mandatoryApprovalCount: 0/(1).

Is there a way to remove "approvalQuota: 50/0" so it just shows the mandatoryApprovalCount text? In the merge settings I changed:

Approval rate: 100%

Required Mandatory Approvers: 1

Looks like that approvalQuota is coming from Approval rate but I am unable to leave that field blank.


author: Ulrich Kuhnhardt _IzymesCo_
body: Hi Andy,

the Workzone approval rate or quota is a sort of fall-back option if no other merge-conditions are present. Defaults to 100% but you can set any count value or percentage. Clearly you have a required mandatory approval count - so there is not need to 'fall back' to a basic approval count or rate. Workzone *should* consider the complete context and not include the general approval count or quota! I have created a [ticket](https://bitbucket.org/izymesdev/workzone/issues/334/if-other-merge-conditions-are-present) to get this fixed.

Thanks for all the good feedback on Workzone!

Best, Ulrich


Tags: server