API Project-level MR approvals: response incorrect
<!--- Please read this! Before opening a new issue, make sure to search for keywords in the issues filtered by the "regression" or "bug" label: - https://gitlab.com/gitlab-org/gitlab/issues?label_name%5B%5D=regression - https://gitlab.com/gitlab-org/gitlab/issues?label_name%5B%5D=bug and verify the issue you're about to submit isn't a duplicate. ---> ### Summary [API responds with](https://gitlab.com/api/v4/projects/15364121/approvals) `approvals_before_merge: 0`, even though there are approvers in the project. ### Steps to reproduce 1. [Create project](https://gitlab.com/nelbacha/merge-requests-approvals-api/) 1. [Add members to project](https://gitlab.com/nelbacha/merge-requests-approvals-api/-/project_members) 1. Create approval rule with `> 0` approvals 1. [Use the API](https://gitlab.com/api/v4/projects/15364121/approvals) to GET [Project-level MR approvals](https://docs.gitlab.com/ee/api/merge_request_approvals.html#project-level-mr-approvals) ### Example Project https://gitlab.com/nelbacha/merge-requests-approvals-api ### What is the current *bug* behavior? API responds with 0 ### What is the expected *correct* behavior? API responds with amount of approvals required ### Relevant logs and/or screenshots ![image](/uploads/9ed93056780a7423425ee25667c95f08/image.png) ### Output of checks This bug happens on GitLab.com https://gitlab.com/api/v4/projects/15364121/approvals ```json { approvers: [ ], approver_groups: [ ], approvals_before_merge: 0, reset_approvals_on_push: true, disable_overriding_approvers_per_merge_request: null, merge_requests_author_approval: null, merge_requests_disable_committers_approval: null } ``` https://gitlab.com/api/v4/projects/15364121/approval_rules ```json [ { id: 105908, name: "test", rule_type: "regular", eligible_approvers: [ { id: 1786152, name: "🤖 GitLab Bot 🤖", username: "gitlab-bot", state: "active", avatar_url: "https://assets.gitlab-static.net/uploads/-/system/user/avatar/1786152/avatar.png", web_url: "https://gitlab.com/gitlab-bot" } ], approvals_required: 1, users: [ { id: 1786152, name: "🤖 GitLab Bot 🤖", username: "gitlab-bot", state: "active", avatar_url: "https://assets.gitlab-static.net/uploads/-/system/user/avatar/1786152/avatar.png", web_url: "https://gitlab.com/gitlab-bot" } ], groups: [ ], contains_hidden_groups: false } ] ``` [ZD#138851](https://gitlab.zendesk.com/agent/tickets/138851) (GitLab Internal)
issue