Route Duo Code Review to the advanced flow behind a feature flag

What does this MR do and why?

Routes Duo Code Review to the new advanced flow behind a default-off feature flag, without changing how review output is parsed.

  • Adds the beta flag duo_code_review_advanced_flow (user actor, off by default).
  • In the foundational flow resolver, routes code_review/v1 to advanced_code_review/v1 version 1.0.0 when the flag is enabled for the requesting user.
  • This check is placed before the existing duo_code_review_previous_discussions branch, so it takes precedence over it.

With the flag on, the advanced flow still delivers its review through the existing XML review_output transport, which the current parser already handles. This MR alone is functional and safe to merge and deploy: it only changes routing, not parsing.

The structured findings (JSON) transport is a stacked follow-up: !253794 (merged). It targets this MR's branch and depends on the flag defined here.

No changelog: behind a default-off flag.

Screenshots or screen recordings

N/A, backend-only change.

How to set up and validate locally

  1. Enable the flag in a Rails console: Feature.enable(:duo_code_review_advanced_flow, User.find_by_username('your-username'))
  2. Request a Duo Code Review on a merge request and confirm the advanced flow runs.
  3. Run the spec: bundle exec rspec ee/spec/lib/ai/duo_workflows/foundational_flow_start_params_resolver_spec.rb

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.

References

Edited by Kinshuk Singh

Merge request reports

Loading
Loading