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.duoWorkflows field, filtered to recommend_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/v1 workflow is ACTIVE
    • 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.md and 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. FailStuckWorkflowsWorker fails runs that are stuck in created or running after 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: duoWorkflows is paginated. A merge request with a very large number of workflows could miss the run.

References

None.

Screenshots or screen recordings

Before After
CleanShot_2026-10-08_at_8.27.18_PM_2x CleanShot_2026-10-08_at_9.01.33_PM_2x

How to set up and validate locally

  1. 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.
  2. Open a merge request created before you turned on the flow. Under Reviewers, the Recommended row shows an enabled Fetch button.
  3. Select Fetch. The button stays disabled until recommendations appear, and then the list replaces the row.
  4. Create a new merge request. Fetch is disabled until the automatic run delivers recommendations.
  5. 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

Merge request reports

Loading
Loading