Skip to content

Commit 1d6e0b5

Browse files
Update Bitbucket docs with latest api token changes (#426)
1 parent b296a2f commit 1d6e0b5

File tree

1 file changed

+56
-54
lines changed

1 file changed

+56
-54
lines changed

docs/platforms/bitbucket-cloud.md

Lines changed: 56 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -13,90 +13,90 @@ CodeRabbit integrates with Bitbucket Cloud to enhance code review and collaborat
1313

1414
This guide will assist you in effectively integrating CodeRabbit with Bitbucket Cloud.
1515

16-
## Configure App Password
16+
## Configure API Token
1717

18-
To enable CodeRabbit to interact with your Bitbucket repositories, an app password 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 Bitbucket merge request and discussion 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-
4. Generate an App Password to enable seamless integration between CodeRabbit and your Bitbucket repositories.
23+
3. If your Bitbucket workspace requires two-step verification, then you must also enable two-step verification on this
24+
new account.
25+
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 app password to allow access. During the installation process, CodeRabbit will automatically configure the required webhook for seamless integration.
26-
27-
<div class="center-image">
28-
<img
29-
src="/img/integrations/bitbucket-app-password-modal.png"
30-
alt="Bitbucket user modal"
31-
width="1000"
32-
/>
33-
</div>
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.
3430

3531
:::note
3632

37-
If you wish to change the review user, you must provide the app password 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.
3836

3937
:::
4038

4139
### Recommendations
4240

43-
- **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.
4443
- **Use "CodeRabbit" as the username** - This makes the user easily recognizable for future reference.
4544
- **Use a dedicated email address** - This helps in easy identification and management.
46-
- **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").
47-
- **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.
4849

4950
#### Key Points to Remember
5051

51-
- Code reviews will be attributed to the owner of the app password.
52+
- Code reviews will be attributed to the owner of the API token.
5253

53-
#### Generating an App password
54+
#### Generating an API token
5455

55-
Bitbucket provides an option to generate an app password for a new user. Follow these steps to generate the password:
56+
Bitbucket provides an option to generate an API token for a new user. Follow these steps to generate the token:
5657

57-
1. Log in using the user designated for CodeRabbit reviews. This user serves as a service account for managing reviews and related activities.
58-
2. Go to "Personal Bitbucket Settings".
59-
3. Choose **App passwords**.
60-
4. Click **Create app password**.
61-
5. Enter a label easily recognizable for this app passwords usage.
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.
60+
2. Go to [API Tokens](https://id.atlassian.com/manage-profile/security/api-tokens).
61+
3. Click **Create API token with scopes**.
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.
64+
5. On next step select **Bitbucket**
6265
6. Ensure the following scopes are selected:
63-
1. Account - Read
64-
2. Issues - Write
65-
3. Workspace membership - Read
66-
4. Projects - Write
67-
5. Repositories - Write
68-
6. Pull requests - Write
69-
7. Webhooks - Read and write
70-
8. Pipelines - Read
71-
9. Runners - Read
66+
- read:account
67+
- read:user:bitbucket
68+
- write:issue:bitbucket
69+
- read:issue:bitbucket
70+
- read:workspace:bitbucket
71+
- admin:project:bitbucket
72+
- write:webhook:bitbucket
73+
- read:webhook:bitbucket
74+
- read:pipeline:bitbucket
75+
- read:runner:bitbucket
76+
- read:repository:bitbucket
77+
- write:repository:bitbucket
78+
- read:pullrequest:bitbucket
79+
- write:pullrequest:bitbucket
7280
7. Click **Create**
73-
8. Note down the app password as it will only be displayed once.
74-
75-
<div class="center-image">
76-
<img
77-
src="/img/integrations/bitbucket-app-password-page.png"
78-
alt="Bitbucket app password configuration page"
79-
/>
80-
</div>
81-
<div class="center-image">
82-
<img
83-
src="/img/integrations/bitbucket-app-password-permissions.png"
84-
alt="Bitbucket app password permissions"
85-
/>
86-
</div>
81+
8. Note down the API token as it will only be displayed once.
8782

88-
### Where to Provide CodeRabbit the App Password
83+
### Where to Provide CodeRabbit the API Token
8984

90-
By default, if no app password 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 app password, the password will be validated and saved for future use.
85+
By default, if no API token is provided, CodeRabbit will prompt you to provide one during the installation process.
86+
However, if you wish to provide the token beforehand, you can do so by navigating to the **Organization Settings** tab,
87+
and selecting the **Bitbucket User** tab on the sidebar. Once entering the API token, the token will be validated and
88+
saved for future use.
9189

92-
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.
90+
You can confirm the correct user is being selected by verifying the user ID shown on the UI with the user ID of the
91+
service account user you created.
9392

9493
---
9594

9695
### Installing CodeRabbit into your Bitbucket Repositories
9796

9897
1. Go to the [Repositories page](https://app.coderabbit.ai/settings/repositories) in the CodeRabbit app.
99-
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.
98+
2. Select the checkbox next to the repositories where you want to install CodeRabbit. To install it on all repositories
99+
at once, select the checkbox at the top.
100100
3. Select **Install Repositories**.
101101

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

122122
:::note
123123

124-
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.
124+
If you are experiencing issues with the webhook, such as CodeRabbit not being able to access the repository, or not
125+
reviewing pull requests, you can manually delete the webhook to the repository.
125126

126127
Then refresh the repository page in the CodeRabbit app and you can reinstall the webhook.
127128

128-
If you cannot install the webhook please check that your Bitbucket user has the necessary permissions to install the webhook and the App Password is properly configured.
129+
If you cannot install the webhook please check that your Bitbucket user has the necessary permissions to install the
130+
webhook and the API Token is properly configured.
129131

130132
:::

0 commit comments

Comments
 (0)