Remove complicated `number_of_potential_approvers` calculation
At the moment, approvals works like this:
- You set a number of approvals required for MRs at the project level.
- You can optionally increase this number on the MR.
- You cannot approve your own MR.
- If you have set the number of required approvals to greater than the number of listed approvers (including group members when a group is allowed to approve), we allow project members to approve.
- If there are still not enough people to approve the MR, we reduce the number of approvals required to match the number of approvers available.
This is a problem for showing approval information in list views, because we have to do a (quite complicated) calculation for each MR.
Once we do https://gitlab.com/gitlab-org/gitlab-ee/issues/3349, we don't need to do this, because the main exception was when the author needed to approve.
In the case where someone has specified more individual people than can see the MR, that's just an error and you can fix that by editing the project settings.
So in calculating whether an MR is approved, we can always just use the approvals_required
field on the MR / project, without trying to reduce it through a calculation like the above.
Edited by Sean McGivern