CODEOWNERS approvers not displayed as required on protected branches
Summary
When enabling CODEOWNERS approval on protected branches the approvals by code owners on merge requests are being displayed as optional, not required.
Steps to reproduce
- Create a group, subgroup, and project hierarchy similar to:
group/subgroup/subgroup/project
- Create a
CODEOWNERS
file in the project with* @group/subgroup
as a default global code owner. - Modify the project's merge request approvals settings to require at least 1 approval.
- Enable CODEOWNERS approvals on protected branches.
- Commit a change to the repository and create a merge request against master.
- Observe that CODEOWNERS approvals are recognized but none are required.
Example Project
What is the current bug behavior?
CODEOWNERS approvals in merge requests are listed as optional approvers when a merge request is opened against a protected branch.
What is the expected correct behavior?
With 1 approval required by the project's settings, CODEOWNERS approvals should be listed as required when merge requests to protected branches are made.
Output of checks
This bug happens on GitLab.com: 12.7.0-pre 3598338b27b
ZD: https://gitlab.zendesk.com/agent/tickets/146783 (GitLab Internal)