Gate Duo Code Review deep reviews on beta features and the project setting
What does this MR do and why?
Deep Duo Code Review is going to beta. Today only the duo_code_review_deep_flow flag decides who gets it. This makes deep reviews available only when all three hold:
- The flag is on for the project's root group. It stays as the kill switch.
- The root group has beta features turned on (instance setting on self-managed).
- The project allows deep reviews (the cascading
duo_code_review_depth_allowedsetting).
The rule lives in Gitlab::Duo::CodeReview.deep_available?, and every place that picked deep or accepted a depth now uses it: the flow and model choice, the request review service, the depth param on MR create and update, the /request_review quick action, and the frontend flag on the MR page. Where deep isn't available, a requested depth is ignored and the review runs standard.
The depth settings also need beta features on now, so they stay hidden wherever deep isn't available. The deep model-settings row already needs the group's beta setting, so it doesn't change.
Stacked on !267803 (merged).
Local testing
Tested end to end on GDK, with the flag on only for the root group (not globally or for the user).
- Everything on:
/request_review @GitLabDuo -deepran the deep flow and posted a review. - Beta features off on the root group:
-deepfailed with "Failed to find users for '-deep'" and started no review.-standardand a deep request straight toReviewMergeRequestServiceboth ran the standard flow and posted reviews. - Each gate on its own (beta off, flag only on the user, project disallows deep) turned deep off everywhere: the flow's deep check, the request review and update services, the quick action, and the MR page's depth pickers. The depth settings hide when beta is off or the flag isn't on the root group.
How to set up and validate locally
- Enable the flag and set the project to default to deep:
Feature.enable(:duo_code_review_deep_flow) Project.find(<id>).update!(duo_code_review_default_depth: 'deep') - With beta features off for the root group (or instance), request a Duo review on an MR. It runs the standard flow.
- Turn beta features on and request a review again. It runs the deep flow.
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
- Epic: gitlab-org#23598
- Beta availability plan: gitlab-org#23598 (comment 4031232840)
- Rollout issue: #627796