Merge request auto approves when minimum approvals are not met

Summary

When GitLab.com user has a minimum approvals number of approvals set at the project level and adds a approval group without enough eligible approvers, the MR auto approves rather than throwing an error/warning.

Steps to reproduce

  1. On GitLab.com, create a test group with a nested subgroup named "approval group", and a nested project
  2. From within the Project's Settings>General>Merge request approvals set:
    • add an approval group of 2 users, 1 being yourself
    • set the No. approvals required = "2"
    • check: Prevent approval of merge requests by merge request author
  3. Create an MR on the project (you are the author)
  4. Observe that the MR auto approves

What is the expected correct behavior?

MR should not auto approve, but rather give error or warning which needs to be reviewed prior to approving and offering the Merge option.

/cc @jramsay

Edited by 🤖 GitLab Bot 🤖