Skip automatic Duo Code Review for AI-generated code across all GitLab AI features
Problem Statement
When automatic Duo Code Review is enabled at the group level, it reviews and critiques code generated by other GitLab AI features (such as "Convert to GitLab CI", "Issue to MR", etc.), creating an unproductive AI-to-AI feedback loop that confuses users and undermines confidence in GitLab Duo as a whole.
Current Behavior
- User triggers an AI-powered flow (e.g., "Convert to GitLab CI")
- AI generates code and creates a merge request
- Duo Code Review automatically reviews the MR
- Duo leaves comments suggesting the AI-generated code "isn't quite right"
- Users are confused about which AI to trust and question the quality of GitLab's AI features
Example
In the "Convert to GitLab CI" flow:
- Users expect a clean, production-ready CI file from the conversion
- Immediate review comments suggest the generated code has issues
- Some review suggestions are questionable or incorrect (e.g., flagging
${VERSION}when this is actually the more robust approach in CI files) - See example MR: https://gitlab.com/gl-demo-ultimate-adess/demo/DAP/Convert-To-GitLab-CI/-/merge_requests/4
Current State
- "Issue to MR" flow - automatic review is skipped (see example) from what I see
- "Convert to GitLab CI" flow
- Other Duo Agent Platform flows that generate MRs
- Future AI code generation features
Proposed Solution
Short-term: Apply the same skip-review logic from "Issue to MR" to other AI code generation features, starting with "Convert to GitLab CI"
Long-term: Implement a general mechanism to skip automatic Duo Code Review for all AI-generated MRs across GitLab
Implementation approach:
- Add a mechanism to identify and tag AI-generated MRs (similar to "Issue to MR")
- Extend automatic review skip logic to all identified AI-generated MRs
- Ensure skip logic is applied consistently across all Duo features
- Allow users to manually trigger reviews if desired (preserve user choice)
Why This Matters
- User Confidence: AI-to-AI critique undermines trust in the entire Duo ecosystem
- Consistency: Users expect production-ready output from AI generation flows
- Quality: Some automatic review suggestions on AI-generated code are questionable or incorrect
- Product Integrity: Conflicting AI feedback damages GitLab Duo's perceived reliability
Related Work
- Epic for integrating Duo Code Review into Duo Agent Platform: &18645
- This integration should help ensure more consistent context and quality across AI agents, but won't fully eliminate the AI-to-AI loop issue due to LLM non-determinism
Acceptance Criteria
-
Automatic Duo Code Review is skipped for MRs created by "Convert to GitLab CI" -
Automatic Duo Code Review is skipped for MRs created by other AI code generation features -
Users can still manually request Duo Code Review on AI-generated MRs if desired (eg assign duo as reviewer) -
Documentation is updated to explain when automatic review is actually skipped - this is very important as well
Additional Context
This issue was created based on feedback from @alex-dess and discussion with @bastirehm @timzallmann @jordanjanes @Basti