Integrating CodeRabbit for Self-Managed GitLab
This page guides you through the process of integrating your Self-Managed GitLab with CodeRabbit.
To initiate the integration, we require specific information. This is essential for the initial setup of CodeRabbit within your domain. Once this setup is complete, you can log in directly using the OAuth2 flow.
CodeRabbit supports GitLab 16.x
and above. Version 15.x
may experience
unexpected issues such as review comments not being posted or the sign-up
process not working at all. While we won't block the integration, we recommend
upgrading your GitLab instance to obtain the intended experience.
Step 1: Getting Started
Visit CodeRabbit: Visit our Login page and select Self-Hosted GitLab
Step 2: Enter your Self-Managed GitLab URL
On this page, enter the URL of your self-managed GitLab instance and click submit. Once, you submit, we check our database for a record of your organization and if we find an existing one, we are starting the login process.
If the self-managed GitLab instance is not found, we initiate the onboarding process, which can be either manual or automated.
Step 3: Onboarding Manual or Automated
1. Automated onboarding
Why do we need the Admin Access Token?
Admin access token is required to set up a new CodeRabbit bot user within your self-managed instance. The token is needed only once during the initial setup process. Once the token is generated, you can set its minimum expiration period. This is the standard approach used by other products in this category. This is not automatically installing the CodeRabbit app across all projects. You will add CodeRabbit manually on the projects you wish, as the next step.
2. Manual onboarding
For the manual onboarding process we need to create the
CodeRabbit user and the
OAuth2 GitLab application.
Creating CodeRabbit user
This feature will work with any user from your organization, but we strongly suggest creating a dedicated user called CodeRabbitAI. This ensures clarify about which user is used for our application and allows for better fine-grained access control.
To create users in GitLab, log in with an instance admin account and follow the steps provided in the GitLab documentation. After the user is created, you can retrieve the User ID from that user's profile and generate an access token. The access token is used to post reviews on merge requests.