Troubleshoot GitLab Duo Code Review not working on self-managed
Description
GitLab Duo Code Review automatically helps review merge requests by providing AI-powered code suggestions and feedback. Some self-managed customers have reported problems with Duo Code Review functionality if they previously used experimental feature flags on their instance before upgrading to GitLab 17.10 or later. The most common symptom is that assigning @GitLabDuo
as a reviewer doesn't trigger any code review actions. This can happen regardless of how the reviewer is assigned (UI, quick actions, API, or automation).
Environment
Impacted offerings:
- GitLab Self-Managed
Impacted versions:
- 17.10 and later
Resolution
Prerequisites
Confirm the following:
- Your self-managed instance is running GitLab version 17.10 or later
- You have an active GitLab Duo Enterprise subscription
- Other Duo features are functioning properly
- The
@GitLabDuo
user exists on your instance
Solution
If assigning @GitLabDuo
as a reviewer does nothing, check if certain feature flags were enabled on your instance prior to upgrading to 17.10.
Run the following commands in the Rails console:
Feature.enabled?(:ai_review_merge_request)
Feature.enabled?(:duo_code_review_chat)
If both of these return false, you need to remove these feature flags by running:
Feature.remove(:ai_review_merge_request)
Feature.remove(:duo_code_review_chat)
After removing these feature flags, GitLab Duo Code Review should begin working correctly on your self-managed instance.
Cause
When GitLab Duo Code Review doesn't work on self-managed instances, it can occur because previously enabled feature flags are preventing the functionality from working correctly after upgrading to 17.10 onwards.