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

  1. Create a project approver rule containing only a developer
  2. Create another project approval rule containing a separate developer
  3. Ensure Prevent approval of merge requests by merge request author is checked
  4. Open MR by developer
  5. 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

  1. MR should be approvable with 1 approval from remaining rules, (Security group in example screenshot)
  2. Approvals required should be validated to not exceed members of approval group
  3. ?

Relevant logs and/or screenshots

Image_2019-06-17_at_15.41.49

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)

Edited Jun 17, 2019 by Lucas Charles
Assignee Loading
Time tracking Loading