Let reviewers below Developer set their review state
What does this MR do and why?
Reviewers with the Guest, Planner, Reporter, or Security Manager role can comment, and sometimes approve, but their reviewer state never changes. Submitting a review publishes the comments, but the reviewer still shows as Awaiting review and gets no re-request icon. The API returns 204 and the UI 200, so nothing tells them it failed.
This MR lets any project member set their own reviewer state to reviewed, and be added as a reviewer when they submit. Approvals by eligible Planners and Reporters now show as approved. Request changes still needs Developer or higher, as it does today; letting approvers below Developer request changes is a follow-up MR. Non-members still can't set any reviewer state.
When a reviewer picks Request changes or Approve but isn't allowed to, the review is still submitted, their state is set to reviewed, and the review drawer and /submit_review say why.
Screenshots
| Before | After |
|---|---|
A Reporter submits a Comment review and still shows as Awaiting review: ![]() |
After a Comment review, the Reporter shows as reviewed and the author gets the re-request icon: ![]() |
Root cause, changes, and verification
Root cause
MergeRequests::UpdateReviewerStateService returned early unless the user had update_merge_request, which only Developer and above (or the author or assignee) hold. Every path into it was affected: POST .../draft_notes/bulk_publish with reviewer_state, the review drawer (DraftsController#publish), /submit_review, approvals through ApprovalService, and the review_started transition when a draft is created.
Changes
- New
create_merge_request_reviewpermission, granted inconfig/authz/roles/guest.ymlso every higher role inherits it. Non-members get nothing (public_authenticatedhascreate_notebut not this). - Prevented wherever sibling merge request permissions are:
merge_requests_disabled | repository_disabled, the archived and pending-deletion permission groups,~read_merge_requestand hidden merge requests, EE namespaceread_only, andimport_sync_read_only. UpdateReviewerStateServicechecks it for every state exceptrequested_changes, which keepsupdate_merge_request.approvedalso requiresapprove_merge_request.- Review submissions fall back to
reviewedwhen the requested state is refused for permissions:UpdateReviewerStateServicetakesfall_back_to_reviewed:and returns the reason aswarning. The drafts controller returns it asreviewer_state_error, which the drawer shows, and/submit_reviewappends it to its message. An approval refused as:not_eligiblealso falls back, and/submit_review approvesays so.bulk_publishfalls back and still returns204, so API callers get no warning; the docs say so./request_changes,mergeRequestRequestChanges, and the REST approve endpoint still return their errors. - EE: members of a group in a protected-branch approval rule can approve without being project members, so
merge_request_group_approveralso enablescreate_merge_request_review. Their approvals now show as approved.role_enables_admin_merge_requestdoes the same for custom roles with Approve merge request, which covers the Minimal Access base. All prevents still apply. - Granular tokens:
create_merge_request_reviewjoins theupdate_merge_requestassignable permission, so existing tokens keep working. /submit_review <state>now sets onlyreviewedorrequested_changesdirectly. It previously passed any reviewer state through, so with the wider gate a Guest could have marked themselvesapprovedwithout approving./submit_review approvestill goes throughApprovalService.- Docs: new Comment and Request changes rows in the merge request permissions table, and the
reviewedfallback onbulk_publish.
Behavior changes
- Guest, Planner, Reporter, and Security Manager members can set their own reviewer state with Comment, and their approvals now show as approved.
- A refused Request changes or Approve now records reviewed and shows a warning, instead of silently leaving the state unchanged.
- Non-member authors and assignees on public projects previously passed through
update_merge_requestand no longer can setreviewed. - GitLab Duo Code Review (classic and Code Review Flow) is unaffected. Both publish as
duo_code_review_bot, which EE treats as a Developer on every project regardless of membership or license (lookup_access_level!), so it passescreate_merge_request_review. Code Review Flow sends its output toPOST /ai/duo_workflows/code_review/add_comments, andPublishCommentsWorkerpublishes it as the bot. - Other agent flows that call
bulk_publishthrough composite identity (for example the Security Review flow'ssubmit_mr_reviewtool) are checked as the human they act for, so a non-member requester no longer getsreviewedrecorded for themselves. The flow's own reviewer state is still set byupdate_composite_identity_reviewer_stateon every call, as on master:reviewedafter a fallback, otherwise the requested state. It isn't skipped when the human's state is refused, because an author-triggered review has no reviewer row for the human and always returns an error. - Custom roles: every base role except Minimal Access inherits Guest, so none of them lose access. Minimal Access never had
update_merge_request, so it loses nothing either.
Not in this MR
- Letting approvers below Developer request changes, and the GraphQL mutations and review drawer changes that go with it.
- The review drawer's "you'll be added as a reviewer" hint is still keyed on
userPermissions.updateMergeRequest. Fixing it needs a newMergeRequestPermissionsfield first.
Verification
- New specs failed before the fix, then passed: service, REST
bulk_publishas a Reporter, policy prevents, and the/submit_review approvedguard. Fallback specs for the service, drafts controller,bulk_publish,/submit_review, and the drawer warning. - Existing caller specs pass: drafts controller, draft notes API (CE and EE), quick actions, approval service, request changes mutations, and
DestroyRequestedChangesService. bin/rake gitlab:permissions:validateandee/spec/lib/authz/role_definitions_spec.rbpass.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist.

