# AI code review for Bitbucket pull requests

MergeHarbor reviews Bitbucket pull requests with the context of your whole codebase, posts verified findings as inline comments, and reports a build status you can require. It connects to Bitbucket Cloud and to Bitbucket Data Center.

[Start free trial](https://app.mergeharbor.com/signup) [Bitbucket Cloud setup](https://mergeharbor.com/docs/bitbucket)

14 days of the Team plan, no card needed.

.mergeharbor.yml

```
review:
  trigger: pushes
  tier: standard
  tier_rules:
    - name: Release branches
      conditions:
        - { field: base_branch, op: include, values: ["release/*"] }
      tier: deep
  status_check:
    enabled: true
```

## What MergeHarbor does on Bitbucket Cloud and Bitbucket Data Center

Inline comments and a summary

Findings land as inline comments on the changed lines, anchored on Data Center, with a summary comment that describes the change and lists what was found.

A build status you can require

Each review reports a build status. The merge gate reports its own, MergeHarbor / merge gate, which you can require before a pull request merges.

Pull requests from forks

On Bitbucket Cloud, pull requests opened from forks are reviewed like any other.

Commands without the people picker

Bitbucket turns @ into a people picker, so a comment that starts with mergeharbor review, without the @, is a command too. Questions still need the @mergeharbor mention.

Codebase-aware and verified

The reviewer reads callers, related code and history from the repository index, and a second pass tries to disprove each finding before anything is posted.

Feedback in the console

Bitbucket has no reactions API, so rate MergeHarbor's comments in the console. Fixes and dismissals feed learning on every code host.

## Connect Bitbucket

1.  ### Bitbucket Cloud

    Choose Bitbucket and authorize MergeHarbor for your workspace, or use a workspace, project or repository access token with Repositories: Read, Pull requests: Write and Webhooks: Read and write.

2.  ### Bitbucket Data Center

    Create a project or repository HTTP access token with write permission, choose Bitbucket Data Center, enter your instance URL and paste the token.

3.  ### Choose repositories

    Pick the repositories to review. MergeHarbor registers the webhooks itself and keeps one per repository, removing the hooks it added earlier when it registers again.

[Read the full bitbucket Cloud setup](https://mergeharbor.com/docs/bitbucket)

## Bitbucket Cloud and Data Center at a glance

<table class="w-full text-left text-sm" data-astro-cid-iw4wudoa=""><tbody class="divide-y divide-line" data-astro-cid-iw4wudoa=""><tr data-astro-cid-iw4wudoa=""><th scope="row" class="w-1/3 p-4 align-top font-medium text-ink" data-astro-cid-iw4wudoa="">Bitbucket Cloud</th><td class="p-4 leading-relaxed text-muted" data-astro-cid-iw4wudoa="">OAuth, or a workspace, project or repository access token. Workspace access tokens need Bitbucket Premium.</td></tr><tr data-astro-cid-iw4wudoa=""><th scope="row" class="w-1/3 p-4 align-top font-medium text-ink" data-astro-cid-iw4wudoa="">Bitbucket Data Center</th><td class="p-4 leading-relaxed text-muted" data-astro-cid-iw4wudoa="">Generally available. A project or repository HTTP access token with write permission.</td></tr><tr data-astro-cid-iw4wudoa=""><th scope="row" class="w-1/3 p-4 align-top font-medium text-ink" data-astro-cid-iw4wudoa="">Why write access</th><td class="p-4 leading-relaxed text-muted" data-astro-cid-iw4wudoa="">To post comments, approve pull requests and manage webhooks. Bitbucket Cloud requires repository write for pull request write.</td></tr><tr data-astro-cid-iw4wudoa=""><th scope="row" class="w-1/3 p-4 align-top font-medium text-ink" data-astro-cid-iw4wudoa="">Repository names</th><td class="p-4 leading-relaxed text-muted" data-astro-cid-iw4wudoa="">Data Center repositories are identified as PROJECT/repository</td></tr><tr data-astro-cid-iw4wudoa=""><th scope="row" class="w-1/3 p-4 align-top font-medium text-ink" data-astro-cid-iw4wudoa="">Private networks</th><td class="p-4 leading-relaxed text-muted" data-astro-cid-iw4wudoa="">Data Center instances on a private network need a self-hosted MergeHarbor deployment</td></tr></tbody></table>

Documentation: [Bitbucket Cloud](https://mergeharbor.com/docs/bitbucket) [Bitbucket Data Center](https://mergeharbor.com/docs/bitbucket-data-center) [Code host permissions](https://mergeharbor.com/docs/permissions) [Merge gate](https://mergeharbor.com/docs/merge-gate) [Learning and review quality](https://mergeharbor.com/docs/learning)

## Other code hosts

-   [GitLab and GitLab Self-Managed](https://mergeharbor.com/ai-code-review/gitlab)
-   [Azure DevOps Services and Server](https://mergeharbor.com/ai-code-review/azure-devops)
-   [GitHub and GitHub Enterprise Server](https://mergeharbor.com/ai-code-review/github)
-   [Gitea and Forgejo](https://mergeharbor.com/ai-code-review/gitea)
-   [Perforce Helix Core and Helix Swarm](https://mergeharbor.com/ai-code-review/perforce)
-   [All integrations](https://mergeharbor.com/integrations)

Running your code host on a private network? See [self-hosted AI code review](https://mergeharbor.com/ai-code-review/self-hosted).

## Further reading

[Guide · 8 min read How to reduce false positives in AI code review Why AI reviewers post wrong or unwanted comments, and the settings, rules and feedback loops that cut the noise without hiding real bugs. Read the guide](https://mergeharbor.com/guides/reduce-false-positives) [Guide · 8 min read Merge gates: safe-to-merge checks for pull requests What a merge gate is, how it turns findings, tests, risk and approvals into one safe-to-merge verdict, and how to roll one out on each code host. Read the guide](https://mergeharbor.com/guides/merge-gates)

## Frequently asked questions

Is Bitbucket Data Center supported?

Yes. Connect with a project or repository HTTP access token with write permission and your instance URL. Reviews appear as anchored inline comments with a build status. Instances on private networks need a self-hosted MergeHarbor deployment.

Is Bitbucket Cloud generally available?

On Bitbucket Cloud, MergeHarbor posts inline comments, a summary comment and a build status, and reviews pull requests from forks.

How do we stop a pull request from merging when the review finds a problem?

Require the MergeHarbor / merge gate build status. The merge gate starts in advisory mode, which reports without failing; switch it to enforce when you want a failing verdict to fail the status.

Why do my @mergeharbor comments open a people picker?

Bitbucket's editor does that for every @. Start the comment with mergeharbor review, mergeharbor remember or another command without the @, and MergeHarbor treats it as a command. Questions still need the @mergeharbor mention.

How does MergeHarbor learn on Bitbucket without reactions?

Rate comments in the MergeHarbor console. MergeHarbor also counts a comment as acted on when its lines change before the pull request merges, and learns from dismissals and their reasons.

How do we try it?

Sign up and connect a code host. Every new organization gets the Team plan free for 14 days with no card, including the Deep review tier and the merge gate. If no one subscribes, reviews pause when the trial ends and nothing is deleted.

Have another question? [Ask our support team](https://mergeharbor.com/contact?topic=support)

## Add AI review to your Bitbucket pull requests

Connect Bitbucket Cloud or Data Center in a few minutes. Reviews start on the next pull request.

[Start free trial](https://app.mergeharbor.com/signup) [Book a demo](https://mergeharbor.com/contact?topic=sales&source=demo)
