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
- The AI Gateway
3.0.0config is already merged: gitlab-org/modelops/applied-ml/code-suggestions/ai-assist!7326 (merged) - Merge this MR. The flag is off, so behavior does not change.
- Enable the flag by following the steps in the rollout issue.
How to set up and test locally
- Pull this branch. Make sure your
gitlab-ai-gatewaycheckout includes gitlab-org/modelops/applied-ml/code-suggestions/ai-assist!7326 (merged). - Restart
duo-workflow-serviceso it serves the3.0.0config (it does not hot-reload):gdk restart duo-workflow-service - Enable the flag in a Rails console:
Feature.enable(:duo_code_review_resource_context). - Request a Duo code review on a merge request in a project where the flow is enabled, for example by assigning the Duo reviewer.
- The review should complete and post its comments, now reading the merge request IID from
agent_platform_resource_contextrather thangoal.
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.