Bug: Required approvals unclear when MR rule contains author as approver that cannot approve
Summary
There is currently a ~bug in Multiple Approval Rules where the approvals required are unclear if the author is the only member of one of the approver groups, yet cannot approve the MR. At a minimum this is a copy change to the Requires N approvals from M heading, but should likely require a change of behavior for more intuitive rule handling.
Steps to reproduce
- Create a project approver rule containing only a developer
- Create another project approval rule containing a separate developer
- Ensure
Prevent approval of merge requests by merge request authoris checked - Open MR by developer
- See MR has impossible approvals required
Example Project
https://gitlab.com/theoretick/approver_tests/merge_requests/10
What is the current bug behavior?
- Approvals copy should reflect approvals by groups accurately.
- MR is in an unapprovable state if an approval rule contains only the author and they cannot merge their own MRs
What is the expected correct behavior?
At a minimum, the copy must be updated to include all groups, regardless of membership: Requires 3 more approvals from Security => Requires 3 more approvals from Developers and Security
A couple options to address core scenario
- MR should be approvable with 1 approval from remaining rules, (
Securitygroup in example screenshot) - Approvals required should be validated to not exceed members of approval group
- ?
Relevant logs and/or screenshots
Output of checks
This bug happens on GitLab.com
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:env:info)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)(we will only investigate if the tests are passing)
Possible fixes
(If you can, link to the line of code that might be responsible for the problem)
