Skip to content

Commit d484505

Browse files
Update self hosted onboarding guide
1 parent 7e2100f commit d484505

File tree

5 files changed

+38
-13
lines changed

5 files changed

+38
-13
lines changed
Loading
-161 KB
Binary file not shown.
126 KB
Loading
Loading

docs/integrations/self-hosted-gitlab.md

+38-13
Original file line numberDiff line numberDiff line change
@@ -22,32 +22,57 @@ select Self-Hosted GitLab
2222

2323
On this page, enter the URL of your self-managed GitLab instance and click
2424
submit. Once, you submit, we check our database for a record of your
25-
organization.
25+
organization and if we find an existing one, we are starting the login process.
2626

27-
![Untitled](./images/enter-url.png)
27+
![Untitled](./images/self-hosted-gitlab-host-url.png)
2828

29-
### **Step 3: Enter Admin Personal Access Token (First time only)**
29+
If the self-managed GitLab instance is not found, we initiate the onboarding process, which can be either manual or automated.
3030

31-
If this is the first time you are signing up with your instance, we need an
32-
admin access token for setting up the CodeRabbit.
31+
### **Step 3: Onboarding Manual or Automated**
32+
33+
#### 1. Automated onboarding
34+
![Untitled](./images/automated-onboarding.png)
3335

3436
#### **Why do we need the Admin Access Token?**
3537

3638
Admin access token is required to set up a new CodeRabbit bot user within your
3739
self-managed instance. The token is needed only once during the initial setup
38-
process and is not stored in our database. Once the token is generated, you can
39-
set its minimum expiration period. This is the standard approach used by other
40-
products in this category. This is not automatically installing the CodeRabbit
40+
process. Once the token is generated, you can set its minimum expiration period.
41+
This is the standard approach used by other products in this category.
42+
This is not automatically installing the CodeRabbit
4143
app across all projects. You will add CodeRabbit manually on the projects you
4244
wish, as the next step.
4345

44-
#### **Generating Admin Personal Access token**
46+
#### 2. Manual onboarding
47+
48+
For the manual onboarding process we need to create the [CodeRabbit user](#creating-coderabbit-user) and the [OAuth2 GitLab application](#creating-oauth2-application).
49+
![Untitled](./images/manual-onboarding.png)
50+
51+
#### **Creating CodeRabbit user**
52+
This feature will work with any user from your organization, but we strongly suggest creating a
53+
dedicated user called **CodeRabbitAI**. This ensures clarify about which user is used for our
54+
application and allows for better fine-grained access control.
55+
56+
To create users in GitLab, log in with an instance admin account and follow the steps provided in the [GitLab documentation](https://docs.gitlab.com/ee/user/profile/account/create_accounts.html#create-users-in-admin-area).
57+
After the user is created, you can retrieve the **User ID** from that user's profile and generate an [**access token**](#generating-personal-access-token).
58+
The access token is used to post reviews on merge requests.
59+
60+
#### **Creating OAuth2 application**
61+
For self-managed GitLab, we recommend creating an instance-wide application unless you want the reviews to be limited to a single group or user.
62+
63+
Please follow the steps outlined in the [GitLab documentation](https://docs.gitlab.com/ee/integration/oauth_provider.html#create-an-instance-wide-application) for creating the application.
64+
65+
Requirements:
66+
1. Scopes: `api read_user email`
67+
2. Callback URL: `https://app.coderabbit.ai/login`
68+
69+
#### **Generating Personal Access token**
4570

4671
GitLab offers an option to generate a personal access token for adding a new
4772
user and setting up the application in the self-managed instance. To generate
4873
the token, please follow the process outlined below:
4974

50-
1. Login to your self-hosted instance. Ensure sure you have admin rights.
75+
1. Login to your self-hosted instance. For [automated onboarding](#1-automated-onboarding) ensure you have admin rights.
5176
2. On the left sidebar, select your avatar.
5277
3. Select Edit profile.
5378
4. On the left sidebar, select Access Tokens.
@@ -56,15 +81,15 @@ the token, please follow the process outlined below:
5681
setup, so the minimum expiry time is sufficient.
5782
7. If you do not enter an expiry date, the expiry date is automatically set to
5883
365 days later than the current date.
59-
8. Make sure, you select the scope: `api`
84+
8. Make sure, you select the scopes: `api user email`
6085
9. Select Create personal access token.
6186
10. Please note down this token as this will be visible one time only
6287

6388
![Untitled](./images/admin-access-token.png)
6489

65-
### **Step 4: Paste the token and click submit**
90+
### **Step 4: Paste the details and click submit**
6691

67-
- Submit the access token.
92+
- Submit the form.
6893
- We will handle the setup process for you.
6994
- On subsequent visits, your setup will be automatically detected, allowing for
7095
direct login. ![Untitled](./images/self-hosted-page.png)

0 commit comments

Comments
 (0)