feat: Roll out code_review flow version ^3.0.0 behind a feature flag

What does this MR do and why?

Routes code_review to flow version ^3.0.0 when the duo_code_review_resource_context feature flag is enabled for the project. Other projects stay on ^2.0.0. The 3.0.0 config reads the merge request IID from agent_platform_resource_context instead of goal.

The flag lets us roll out gradually and roll back by disabling it, with no revert or deploy. Rollout issue: #632852

Rails still sends the merge request IID in goal and in the envelope, so both versions keep working. deep_code_review is unchanged. It stays on 1.0.0 and takes precedence when duo_code_review_deep_flow is on.

Related to #608242 (closed)

Rollout order

  1. The AI Gateway 3.0.0 config is already merged: gitlab-org/modelops/applied-ml/code-suggestions/ai-assist!7326 (merged)
  2. Merge this MR. The flag is off, so behavior does not change.
  3. Enable the flag by following the steps in the rollout issue.

How to set up and test locally

  1. Pull this branch. Make sure your gitlab-ai-gateway checkout includes gitlab-org/modelops/applied-ml/code-suggestions/ai-assist!7326 (merged).
  2. Restart duo-workflow-service so it serves the 3.0.0 config (it does not hot-reload):
    gdk restart duo-workflow-service
  3. Enable the flag in a Rails console: Feature.enable(:duo_code_review_resource_context).
  4. Request a Duo code review on a merge request in a project where the flow is enabled, for example by assigning the Duo reviewer.
  5. The review should complete and post its comments, now reading the merge request IID from agent_platform_resource_context rather than goal.

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 Tim Morriss

Merge request reports

Loading
Loading