Record the review decision as the action of review to-do items
What does this MR do and why?
When a reviewer submits a review, the merge request author gets a review_submitted to-do. Today that to-do only says that a review happened, not whether the reviewer approved or asked for changes. After this MR, the decision is part of the to-do.
Before: the To-Do List page and the push notification say "Jane Doe reviewed your merge request."
After: both say "Jane Doe approved your merge request." or "Jane Doe requested changes to your merge request." A plain review keeps the old sentence.
This replaces !263206 (closed), which recorded the decision in a separate todo_review_decisions table. Following !263206 (comment 4096124914), the decision is the to-do item's action instead: review_approved and review_changes_requested join review_submitted. No table, no migrations, no batch loader, and the decision is filterable through the existing action filters.
How the decision is recorded
- Submit flow. The state the reviewer picked in the submit form is applied first (approval or reviewer state update) and, only when that succeeded, travels with the publish request into
MergeRequests::DraftNotePublishedEventand on toTodoService#new_review. Previously the state was applied after publishing, so the approval system note and its notification now precede the review notes in the merge request timeline. A review submitted without a state (API, Duo reviews, quick actions) raises a plainreview_submittedto-do: the stored reviewer state is not the decision of that review. - Model and service.
Todo::REVIEW_ACTIONSgroups the three actions.ACTIONS_UNIQUE_PER_AUTHORspans all three, so a reviewer's next review still supersedes their earlier to-do whatever its decision.TodoService#create_review_submitted_todopicks the action from the state; the supersede and dedupe queries match any review action. - Consumers. The push payload and
todo_item_body.vuephrase the sentence from the action. The To-Do List "Review submitted" reason and the homepage widget tab send all three actions, so existingreview_submittedrows keep showing up. Separate "Approved" and "Requested changes" reasons would be one option each if wanted later. - API surface.
TodoActionEnumand the RESTactionparameter gain the two values (automatic fromACTION_NAMES);doc/api/todos.md, the OpenAPI spec and the two telemetry event definitions list them.
Rollout
Todo.action is null: false and maps through ACTION_NAMES, so a web node that predates the new values fails to serialize a to-do carrying one. That is why the new actions are written only behind review_decision_todo_actions (gitlab_com_derisk, default off):
- This MR deploys the enum values, the readers (To-Do List, homepage widget, push payload) and the flag-gated writer together. With the flag off nothing writes the new values, and the To-Do List "Review submitted" reason and the homepage widget send the two new values only while the flag is on for the viewing user, so old web nodes never receive them during the rolling deploy.
- Once the deploy has reached every environment, the flag is enabled for everyone at once, not per project: the writer checks it per project, the readers per user. From then on new review to-dos carry the decision. Existing
review_submittedrows are left as they are. - The flag becomes
default_enabled: trueand is removed no earlier than the following milestone. Self-managed zero-downtime upgrades move one minor version at a time, so a release that writes the new values by default must never be the one that introduces them. - Rollback. Disabling the flag stops new writes. Rows already written stay readable as long as this code is deployed. Before a code revert, they must be rewritten to
review_submitted, otherwise older code cannot serialize them. The rollout issue has the step: #636546.
Clients with a strict copy of TodoActionEnum, such as the mobile app, need the two values before the flag is enabled.
Screenshots or screen recordings
To-Do List page, filtered to Reason = Review submitted, with one approval, one change request and one plain review:
| Before | After |
|---|---|
![]() |
![]() |
How to set up and validate locally
-
In the Rails console, enable the flag:
Feature.enable(:review_decision_todo_actions) -
As user A, open a merge request and add user B as a reviewer.
-
As user B, leave a draft comment and submit the review with Approve.
-
As user A, open Your work > To-Do List: the item reads "B approved your merge request." Filter by Reason = Review submitted: it is still listed.
-
In GraphiQL,
{ currentUser { todos(action: [review_approved]) { nodes { id action } } } }returns that item;todos(action: [review_submitted])does not. -
Submit another review as B with Request changes: a new item reads "B requested changes to your merge request." Click Approve as B afterwards: the item keeps its action, because it names the review that raised it.
-
Disable the flag and submit another review as B: the new item is a plain
review_submitted. -
Optional, in the Rails console:
todo = User.find_by(username: 'a').todos.pending.last Gitlab::MobilePush::Payload.new(todo).body # => "B requested changes to your merge request."
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

