Add 'Resolve with Duo' button to MR conflict widget

Summary

Adds a "Resolve with Duo" button to the merge request conflict resolution page and the MR widget merge checks. When clicked, it triggers the developer/v1 foundational flow with a simple goal: resolve the conflicts, push, and post a summary comment.

Implementation

EE component (ee/app/assets/javascripts/merge_conflicts/components/resolve_with_duo_button.vue):

  • Wraps the existing DuoWorkflowAction widget which handles all enablement/license checks
  • Builds a simple goal string with the MR path and IID
  • Checks mr_ai_resolve_conflicts feature flag via glFeatures mixin
  • Uses ee_component pattern (no CE stub needed)

Backend (ee/app/helpers/ee/merge_requests_helper.rb, ee/app/controllers/ee/projects/merge_requests/conflicts_controller.rb):

  • can_resolve_with_ai? checks: MR has conflicts, user can push
  • EE conflicts controller pushes the feature flag to the frontend

Conflicts page integration (ee/app/views/projects/merge_requests/conflicts/_resolve_with_ai.html.haml):

  • Renders Vue mount point with MR data attributes when can_resolve_with_ai? is true
  • initResolveWithDuo() mounts the button with Apollo provider

MR widget (app/assets/javascripts/vue_merge_request_widget/components/checks/conflicts.vue):

  • Dynamically imports EE button via ee_component pattern
  • Shows button alongside conflict action buttons when check is failed

DuoWorkflowAction (ee/app/assets/javascripts/ai/shared/widgets/duo_workflow_action.vue):

  • Added category prop passthrough (was hardcoded to primary)

Feature flag: mr_ai_resolve_conflicts (wip, disabled by default)

  • Pushed to frontend in EE conflicts controller and EE MR controller
  • Checked client-side in Vue component via glFeatures

How it works

Uses the existing Duo Developer flow (developer/v1) with a concise goal:

  1. Resolve the merge conflicts in merge request <project>!<iid>
  2. Directly commit and push to the MR
  3. Post a summary comment listing what was resolved

The agent determines the right approach autonomously — no tool names or step-by-step instructions are included in the goal (per reviewer feedback).

Test plan

  • Enable feature flag: Feature.enable(:mr_ai_resolve_conflicts)
  • Create MR with merge conflicts
  • Navigate to conflict resolution page (Resolve conflicts button)
  • Verify "Resolve with Duo" button appears
  • Click button → Duo workflow session starts
  • Verify agent resolves conflicts and pushes to source branch
  • Verify button hidden when: feature flag off, no conflicts, user lacks permission, Duo disabled
  • Verify button also appears in MR widget merge checks (conflict check row)
Edited by Marc Shaw

Merge request reports

Loading