Jump to >

This documentation covers Review Board 2.5. You can see the latest Review Board documentation or all other versions.

Bitbucket Repositories

Review Board supports posting and reviewing code on Bitbucket repositories.

The following types of Bitbucket repositories are supported:

  • Git
  • Mercurial

To simplify posting changes to Review Board, we recommend using RBTools. This ensures that the diffs are in the correct format, and makes managing review requests much easier.

Adding the Repository

To configure a Bitbucket repository, first proceed to add the repository and select Bitbucket from the Hosting type field.

Step 2: Provide Repository Information

Next, you’ll need to specify the type of repository in the Repository type field. This can be either “Mercurial” or “Git”.

You’ll then choose the repository plan. This is one of the following choices:

Personal:
The repository is owned by the linked user account. You’ll need to provide the repository name, but nothing else.
Other User:

The repository is owned by another user account. You’ll need to provide the username of the user and the repository name.

Note that your user will need to have access to this repository.

This option was added in Review Board 2.5.8. If you’re using a previous version, you can select “Team” instead and provide the user’s username in place of the team name.

Team:

The repository is owned by a Bitbucket team. You’ll need to provide the team name and repository name.

Note that your user will need to have access to this team and repository.

For the Repository name field, use the name as shown in the URL. For example, if your repository URL is https://bitbucket.org/myteam/myrepo/, your repository name would be myrepo.

Step 3: Choose a Bug Tracker

If you’re using the issue tracking feature on this repository, you can simply check the Use hosting service’s bug tracker checkbox. All bug IDs will link to the appropriate issues for your repository.

If you’re using a separate bug tracker, or a separate repository on Bitbucket, you can leave the checkbox unchecked and choose a bug tracker from the list.

Learn more about bug tracker configuration.

Step 4: Manage Access Control

You can now choose who should have access to this repository (both posting against it and viewing review requests posted against it). This is separate from Bitbucket’s own access controls.

Learn more about access control.

Step 5: Save the Repository

At this point, you should be able to save the repository. If saving succeeds, you’re done! You can start posting changes for review.

Configuring Repository Hooks

Review Board can close review requests automatically when pushing commits to Bitbucket. This is done by configuring a WebHook and pointing it to your Review Board server, and then referencing the review request in your commit message (which is done for you when using rbt land).

Let’s go over how to set this up.

Note

Your Review Board server will need to be accessible over the Internet for this to work. Bitbucket will be performing HTTP/HTTPS requests to your server to notify Review Board of new commits.

Add the WebHook

On Review Board, view the list of repositories and locate the repository you want to configure hooks for. Beside the repository name, you’ll see a Hooks link. Click that and you’ll see instructions for configuring the hook.

../../../../_images/hooks.png

At the bottom of the instructions is a link for creating the WebHook. Click that and follow the instructions on the Bitbucket site.

Tag Your Commit Messages

To close a review request for a given commit, you’ll need to add some special text to your commit message that references the review request. This can be in the form of Reviewed at review_request_url or Review request #id. This must be on its own line, but can appear anywhere in the commit message.

For example:

Reviewed at https://reviewboard.example.com/r/123/

Or:

Review request #123

If you use rbt land, this will be automatically added for you when landing your changes.