Skip to content

Commit 27b244a

Browse files
Update Bitbucket docs with latest api token changes
1 parent 7bfeea9 commit 27b244a

File tree

1 file changed

+48
-30
lines changed

1 file changed

+48
-30
lines changed

docs/platforms/bitbucket-cloud.md

Lines changed: 48 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,37 @@ This guide will assist you in effectively integrating CodeRabbit with Bitbucket
1515

1616
## Configure Api Token
1717

18-
To enable CodeRabbit to interact with your Bitbucket repositories, an api token is required. This token grants the necessary permissions for interacting with the Merge Requests and Discussions APIs.
18+
To enable CodeRabbit to interact with your Bitbucket repositories, an api token is required. This token grants the
19+
necessary permissions for interacting with the Merge Requests and Discussions APIs.
1920

2021
1. Create a new Bitbucket account specifically for CodeRabbit and treat it as a service account.
2122
2. Name the account "CodeRabbit".
22-
3. If your Bitbucket workspace requires two-step verification, then you must also enable two-step verification on this new account.
23+
3. If your Bitbucket workspace requires two-step verification, then you must also enable two-step verification on this
24+
new account.
2325
4. Generate an Api Token to enable seamless integration between CodeRabbit and your Bitbucket repositories.
2426

25-
We recommend creating a new user as a service account, associating this user to the workspace you'd like to install CodeRabbit on, and providing CodeRabbit with the api token to allow access. During the installation process, CodeRabbit will automatically configure the required webhook for seamless integration.
27+
We recommend creating a new user as a service account, associating this user to the workspace you'd like to install
28+
CodeRabbit on, and providing CodeRabbit with the api token to allow access. During the installation process, CodeRabbit
29+
will automatically configure the required webhook for seamless integration.
2630

2731
:::note
2832

29-
If you wish to change the review user, you must provide the api token for the new user who will post reviews and comments. However, this requires manually removing the previous user from the projects and associated webhooks. Once this is done, you will need to reinstall the CodeRabbit app for each project.
33+
If you wish to change the review user, you must provide the api token for the new user who will post reviews and
34+
comments. However, this requires manually removing the previous user from the projects and associated webhooks. Once
35+
this is done, you will need to reinstall the CodeRabbit app for each project.
3036

3137
:::
3238

3339
### Recommendations
3440

35-
- **Create a dedicated user for CodeRabbit** - This ensures the user is exclusively for CodeRabbit, allowing better access control.
41+
- **Create a dedicated user for CodeRabbit** - This ensures the user is exclusively for CodeRabbit, allowing better
42+
access control.
3643
- **Use "CodeRabbit" as the username** - This makes the user easily recognizable for future reference.
3744
- **Use a dedicated email address** - This helps in easy identification and management.
38-
- **Use the CodeRabbit logo as the profile picture** - This further ensures easy recognition. You can download our logo from [here](/img/integrations/logo.svg "download").
39-
- **Developer Access** Ensure the service account user has developer access to the projects that you wish to install CodeRabbit on.
45+
- **Use the CodeRabbit logo as the profile picture** - This further ensures easy recognition. You can download our logo
46+
from [here](/img/integrations/logo.svg "download").
47+
- **Developer Access** Ensure the service account user has developer access to the projects that you wish to install
48+
CodeRabbit on.
4049

4150
#### Key Points to Remember
4251

@@ -46,28 +55,30 @@ If you wish to change the review user, you must provide the api token for the ne
4655

4756
Bitbucket provides an option to generate an api token for a new user. Follow these steps to generate the token:
4857

49-
1. Log in using the user designated for CodeRabbit reviews. This user serves as a service account for managing reviews and related activities.
58+
1. Log in using the user designated for CodeRabbit reviews. This user serves as a service account for managing reviews
59+
and related activities.
5060
2. Go to ["API Tokens Settings"](https://id.atlassian.com/manage-profile/security/api-tokens).
5161
3. Click **Create API token with scopes**.
52-
4. Enter a name easily recognizable for this api token usage and an expiration date based on your plan of using the product.
62+
4. Enter a name easily recognizable for this api token usage and an expiration date based on your plan of using the
63+
product.
5364
5. On next step select **Bitbucket**
5465
6. Ensure the following scopes are selected:
55-
1. read:account
56-
2. read:user:bitbucket
57-
3. write:issue:bitbucket
58-
4. read:issue:bitbucket
59-
5. read:workspace:bitbucket
60-
6. admin:project:bitbucket
61-
7. write:webhook:bitbucket
62-
8. read:webhook:bitbucket
63-
9. read:pipeline:bitbucket
64-
10. read:runner:bitbucket
65-
11. read:repository:bitbucket
66-
12. write:repository:bitbucket
67-
13. read:pullrequest:bitbucket
68-
14. write:pullrequest:bitbucket
69-
7. Click **Create**
70-
8. Note down the api token as it will only be displayed once.
66+
7. read:account
67+
8. read:user:bitbucket
68+
9. write:issue:bitbucket
69+
10. read:issue:bitbucket
70+
11. read:workspace:bitbucket
71+
12. admin:project:bitbucket
72+
13. write:webhook:bitbucket
73+
14. read:webhook:bitbucket
74+
15. read:pipeline:bitbucket
75+
16. read:runner:bitbucket
76+
17. read:repository:bitbucket
77+
18. write:repository:bitbucket
78+
19. read:pullrequest:bitbucket
79+
20. write:pullrequest:bitbucket
80+
21. Click **Create**
81+
22. Note down the api token as it will only be displayed once.
7182

7283
<div class="center-image">
7384
<img
@@ -79,16 +90,21 @@ Bitbucket provides an option to generate an api token for a new user. Follow the
7990

8091
### Where to Provide CodeRabbit the Api Token
8192

82-
By default, if no api token is provided, CodeRabbit will prompt you to provide one during the installation process. However, if you wish to provide the token beforehand, you can do so by navigating to the **Organization Settings** tab, and selecting the **Bitbucket User** tab on the sidebar. Once entering the api token, the token will be validated and saved for future use.
93+
By default, if no api token is provided, CodeRabbit will prompt you to provide one during the installation process.
94+
However, if you wish to provide the token beforehand, you can do so by navigating to the **Organization Settings** tab,
95+
and selecting the **Bitbucket User** tab on the sidebar. Once entering the api token, the token will be validated and
96+
saved for future use.
8397

84-
You can confirm the correct user is being selected by verifying the user ID shown on the UI with the user ID of the service account user you created.
98+
You can confirm the correct user is being selected by verifying the user ID shown on the UI with the user ID of the
99+
service account user you created.
85100

86101
---
87102

88103
### Installing CodeRabbit into your Bitbucket Repositories
89104

90105
1. Go to the [Repositories page](https://app.coderabbit.ai/settings/repositories) in the CodeRabbit app.
91-
2. Select the checkbox next to the repositories where you want to install CodeRabbit. To install it on all repositories at once, select the checkbox at the top.
106+
2. Select the checkbox next to the repositories where you want to install CodeRabbit. To install it on all repositories
107+
at once, select the checkbox at the top.
92108
3. Select **Install Repositories**.
93109

94110
<div class="center-image">
@@ -113,10 +129,12 @@ The webhook `https://coderabbit.ai/bitbucketHandler` will now be installed for t
113129

114130
:::note
115131

116-
If you are experiencing issues with the webhook, such as CodeRabbit not being able to access the repository, or not reviewing pull requests, you can manually delete the webhook to the repository.
132+
If you are experiencing issues with the webhook, such as CodeRabbit not being able to access the repository, or not
133+
reviewing pull requests, you can manually delete the webhook to the repository.
117134

118135
Then refresh the repository page in the CodeRabbit app and you can reinstall the webhook.
119136

120-
If you cannot install the webhook please check that your Bitbucket user has the necessary permissions to install the webhook and the Api Token is properly configured.
137+
If you cannot install the webhook please check that your Bitbucket user has the necessary permissions to install the
138+
webhook and the Api Token is properly configured.
121139

122140
:::

0 commit comments

Comments
 (0)