Add reviewers and recommended reviewers to the replacement MR overview
Fourth of five. Adds the sidebar column to the replacement overview and fills it with the reviewers of the merge request: avatar, name (linked to the user's profile), and state - approved, requested changes, commented, review started, or awaiting review - with an approved count in the card header. Below them sit the AI-recommended reviewers for the merge request, each with a profile-linked avatar and name, the model's reason behind a help icon, and a button to add them. The readiness hero also names the current user's review as the blocker when they are a reviewer who has not approved and approvals are what holds the merge up.
Chain, each part building on the one above:
- !252481 (merged) - flag, toggle, empty container (merged)
- !255057 (merged) - data layer: mount point, Apollo provider, query and subscription (merged)
- !252997 (merged) - layout shell and merge readiness panel (merged)
- !252998 (merged) - reviewers panel (this MR)
- !252999 (merged) - description, labels and milestone
Detailed context for AI agents
What this MR does
- Adds a sidebar column to the overview: a two-column grid (
1fr 356px,align-items: start) added as.ai-overview-bodyinee/app/assets/stylesheets/page_bundles/merge_request.scss, because Vue components in this codebase must not carry<style>blocks. - Fills that column with a reviewers card: each reviewer's avatar, name (a
GlLinkto the user'swebPath, with thejs-user-linkclass anddata-user-id/data-usernameso the standard user popover works), and state (Approved / Requested changes / Commented / Review started / Awaiting review), an "N of M approved" count in the card header, and a "No reviewers yet" empty state. - Extends the readiness hero from part 3 with one addition: when the current user is a reviewer who has not approved, and the approvals merge check is the one failing, the hero title becomes "Your review is the blocker" and a "Viewing as reviewer"
GlBadge(variantinfo) appears next to it. It does not fire when approvals are not what blocks the merge (for example, only the pipeline is failing), and does not fire on a merged, closed, or locked merge request. - The original version of this logic fired whenever the MR was not ready. The approvals-check condition was added during the rebase so the title can never say something false, such as telling a reviewer they are the blocker when the pipeline is red.
- Reviewer state comes from
mergeRequestInteraction.reviewState; theapprovedflag takes precedence over it, as in the reviewer sidebar, because the state can lag behind an approval.UNAPPROVED, or a null interaction, renders as Awaiting review. Icons follow the sidebar'sREVIEW_STATE_ICONS. - The reviewer and suggestion fields live in a new
MrAiOverviewReviewersfragment (queries/mr_ai_overview_reviewers.fragment.graphql), used by the main query and by a newmergeRequestReviewersUpdatedsubscription (queries/mr_ai_overview_reviewers.subscription.graphql).app.vuenow runs twosubscribeToMoreentries, one for merge status and one for reviewers. Each payload is the same merge request by id, so Apollo's cache update re-renders the panel without a refetch, whether the change came from this tab or another user. Approving triggers the reviewers subscription too, viaUpdateReviewerStateService. No backend changes. - The current user is read from
window.gon.current_username.
Recommended reviewers
- The panel lists the
aiSuggestedReviewersconnection that the DAP recommend-reviewers flow writes (see theph/suggestedReviewers/*MRs merged in 19.4), under a "Recommended" heading. Each row shows the avatar, name, the approval rule the suggestion was made for (Any eligible userfor an any-approver rule, matching the sidebar component), and a help popover with the model's reason, the same treatment the sidebar gives it. aiSuggestedReviewersis part of the reviewers fragment, so the reviewers subscription payload carries the remaining suggestions, and an added reviewer drops out of the recommended list from the same update.userPermissions.updateMergeRequeststays in the query only.- The field is
nullwhen the flow is off for the project, and the resolver already drops anyone who is a reviewer, so the section renders only while there is something to suggest. - Anyone with
updateMergeRequestgets a plus button that runs the existingsetReviewersmutation inAPPENDmode; the mutation runs withoutrefetchQueries, and the reviewers subscription moves the user from the recommended list into the reviewer rows. A failure raises the same alert the sidebar uses and leaves the suggestion in place. - The panel's strings dropped the
AiOverview|namespace, so the labels are generic: Reviewers, No reviewers yet, Approved, Requested changes, Commented, Review started, Awaiting review. ThebuildReviewershelper no longer adds a derivedstatefield; callers readmergeRequestInteraction.approveddirectly.
After adding a recommended reviewer on GDK:
Files touched
ee/app/assets/javascripts/merge_requests/ai_overview/components/reviewers_panel.vue(new; reviewer rows, recommended reviewers, add action)components/app.vue(adds the sidebar column)components/merge_readiness.vue(blocker title and badge)constants.js(newREVIEWER_STATUSmap: icon,GlIconvariant, text class, label)utils.js(newbuildReviewers,buildSuggestedReviewers,isViewerBlockingReviewer)queries/mr_ai_overview_fields.fragment.graphql(lost the reviewer fields),queries/mr_ai_overview.query.graphql(now spreads both fragments),queries/mr_ai_overview_reviewers.fragment.graphql(new; reviewer and suggestion fields), andqueries/mr_ai_overview_reviewers.subscription.graphql(new;mergeRequestReviewersUpdated)- the page bundle scss
- specs under
ee/spec/frontend/merge_requests/ai_overview/:reviewers_panel_spec.js(new), plus additions toapp_spec.js,merge_readiness_spec.js, andmock_data.js ee/spec/features/merge_request/user_toggles_ai_overview_spec.rb(two examples: reviewer rows, blocker hero)locale/gitlab.pot
Rebase note
This MR was originally a single commit stacked on the pre-review version of part 3, when everything lived in app.vue. Part 3 merged with the readiness panel split out into merge_readiness.vue and readiness_row.vue, backed by constants.js and utils.js. Because the shape changed, this MR was rebuilt from scratch on top of that structure rather than replayed.
Verification
ee/spec/frontend/merge_requests/ai_overview: 4 suites, 63 examples, passing under jest.- Prettier and eslint are clean, including the GraphQL documents, validated against a fresh
gitlab:graphql:schema:dump. ee/spec/features/merge_request/user_toggles_ai_overview_spec.rb: 11 examples pass (one example, the opt-in toggle, failed once on a cold Vite start and passed on re-run). The blocker example needsstub_licensed_features(merge_request_approvers: true)and an any-approver rule: without the licence the approvals check isINACTIVE, and a regular rule with no approvers counts as an invalid rule that allows the merge, so neither makes the check fail.- Checked on GDK (project with the recommend-reviewers flow enabled, suggestions seeded directly into
ai_suggested_reviewers): the screenshots above, and the roughly two-second add-reviewer timing, are from the earlier refetch version. The subscription-driven update has not been re-checked live on GDK yet.
Changes after review
- Reviewers update via a new
mergeRequestReviewersUpdatedsubscription instead of a query refetch after adding a recommended reviewer. - Dropped the
AiOverview|namespace on the panel's strings. - Reviewer and recommended-reviewer avatars and names link to the user's profile.
- Requested changes (and review started) now render via
mergeRequestInteraction.reviewState, not just approved/commented/awaiting. - Removed the derived
statefield frombuildReviewers; callers readmergeRequestInteraction.approveddirectly. - Reviewer and recommended-reviewer user fields come from the shared
Userfragment (~/graphql_shared/fragments/user.fragment.graphql) instead of a hand-written field list, which also fetcheswebUrl. Dropped two comments inapp.vueandreviewers_panel.vuethat restated the code. Checked the fragment against the GDK GraphQL endpoint and the ai_overview Jest specs (63 pass).
Out of scope
The author variant of the badge, and the author field on the fragment, land in part 5 (!252999 (merged)). That MR still stacks on the old commits of this branch and needs the same rebuild.


