Conflict between merge request change request and author approval disallowed

Summary

The settings "prevent approval by author" and "change requests must be completed or resolved" have a conflict based on an author's action. In a merge request with both these options enabled, if the author adds a comment to the review and selects "request changes" in the finish review dialog, there is no way for the author to approve that change request.

Steps to reproduce

In a project:

  1. Verify (or set) "prevent approval by author" is checked:
    • Settings -> Merge Requests
    • Merge request approval -> Approval settings -> [x] Prevent approval by author

In a merge request, as the author of that request:

  1. Add a comment to any file, click "Start review"
  2. Click "Finish review", select "Request changes"

Example Project

https://gitlab.com/me462040/bug-report/-/merge_requests/1

What is the current bug behavior?

After following the reproduction steps

  1. Go to the merge request "overview"
  2. Observe the merge is blocked with "The change requests must be completed or resolved."
  3. Observe that no "approve" button is available

The request by the author to make changes can only be bypassed for the merge request to become unblocked.

What is the expected correct behavior?

Either the author should be able to make approvals as the requestor of changes or should be blocked from requesting changes.!

Relevant logs and/or screenshots

mr_approval_bug

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

Edited by Kevin Quigley