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/v1toadvanced_code_review/v1version1.0.0when the flag is enabled for the requesting user. - This check is placed before the existing
duo_code_review_previous_discussionsbranch, 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
- Enable the flag in a Rails console:
Feature.enable(:duo_code_review_advanced_flow, User.find_by_username('your-username')) - Request a Duo Code Review on a merge request and confirm the advanced flow runs.
- 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
- Tracking work item: #627566
- Parent epic: gitlab-org#21524
- Benchmark results: https://gitlab.com/gitlab-org/gitlab/-/work_items/618672#note_3770841977
- Companion ai-assist MR: gitlab-org/modelops/applied-ml/code-suggestions/ai-assist!6773 (merged)
- Rollout issue: #627796
- Stacked follow-up: !253794 (merged)