Loading
Add fetch prompt for recommended reviewers
What does this MR do and why?
The Recommend Reviewers flow only runs when a merge request is created, so merge requests that existed before the flow was turned on have no way to get recommendations. The Recommended section in the reviewers sidebar only renders when there are suggestions, so the existing ⋮ > Refresh action isn't reachable either.
This MR shows a Recommended row with a Fetch button when the flow has never run on the merge request. It's a frontend-only change.
- "Has run" comes from the existing
MergeRequest.duoWorkflowsfield, filtered torecommend_reviewers/v1. Both the flow trigger and the manual trigger link the workflow to the merge request. - Fetch is shown only to users who can update the merge request, and only when there are no suggestions.
- Fetch is disabled while a run is in progress:
- after a click
- while a
recommend_reviewers/v1workflow isACTIVE - for the first 2 minutes of a new merge request with no workflow yet, because the automatic run starts from a background job. When the 2 minutes are up, the query is refetched.
- When suggestions arrive through the existing subscription, the list replaces the row. Reviewer changes also fire that subscription, so an empty update triggers a refetch, and the workflow status decides what to show.
- Docs: added a task to
automatic_reviewer_assignment.mdand corrected when the Recommended section appears.
Accepted trade-offs
- No live status: workflow status isn't pushed. If a run fails after a click, the button stays disabled until reload. After reload the row is hidden, because a run now exists.
FailStuckWorkflowsWorkerfails runs that are stuck increatedorrunningafter 30 minutes. - Automatic trigger turned off: if a project turns off the automatic trigger, new merge requests show a disabled button for up to 2 minutes.
- Pagination:
duoWorkflowsis paginated. A merge request with a very large number of workflows could miss the run.
References
None.
Screenshots or screen recordings
| Before | After |
|---|---|
![]() |
![]() |
How to set up and validate locally
- In a GDK group with GitLab Duo Agent Platform available, turn on Allow flow execution, Allow foundational flows, and Recommend Reviewers for the top-level group.
- Open a merge request created before you turned on the flow. Under Reviewers, the Recommended row shows an enabled Fetch button.
- Select Fetch. The button stays disabled until recommendations appear, and then the list replaces the row.
- Create a new merge request. Fetch is disabled until the automatic run delivers recommendations.
- Sign in as a user without permission to update the merge request. The row doesn't appear.
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.
Edited by Austin Regnery

