# AI code review for Perforce Helix Swarm reviews

MergeHarbor reviews shelved Perforce Helix Core changes through Helix Swarm. It reads the shelved files of a Swarm review, posts a summary and inline comments, and reports its result on a Swarm test.

[Start free trial](https://app.mergeharbor.com/signup) [Perforce setup guide](https://mergeharbor.com/docs/perforce)

14 days of the Team plan, no card needed.

Swarm test: POST body

```
{
  "review": "{review}",
  "version": "{version}",
  "change": "{change}",
  "status": "{status}",
  "project": "{project}",
  "branch": "{branch}",
  "testRunId": "{testRunId}",
  "token": "<webhook secret>"
}
```

## What MergeHarbor does on Perforce Helix Core and Helix Swarm

Reviews of shelved changes

For each review version, MergeHarbor reads the shelved files and the revisions they were opened at, so the diff it reviews is exactly the shelf's change, even if the branch moved on.

Comments and a test result in Swarm

One summary comment, inline comments on the changed lines, and the result on the MergeHarbor test run (Swarm API v10 and later).

Votes, if you want them

With auto-approve, an up vote on reviews that pass. With Vote down reviews that fail the gate, a down vote that is cleared when a later review passes.

Codebase context through Git Fusion

With Git Fusion or Helix4Git, MergeHarbor mirrors and indexes the depot so reviews use search, symbols, callers and history. Without it, reviews see only the files the change touches.

## Connect Helix Swarm

1.  ### Connect

    Under Integrations → Code hosts, choose Perforce Helix Core (Swarm) and enter the Swarm URL, a Helix user, and a long-lived ticket or password.

2.  ### Map depot paths

    Add the depot paths or streams to review, such as //depot/main/... Each one becomes a repository in MergeHarbor.

3.  ### Add a Swarm test

    Add a test that runs when a review is updated and POSTs to the webhook URL shown in the console, with the secret. Name it mergeharbor so MergeHarbor can mark its run.

[Read the full perforce setup guide](https://mergeharbor.com/docs/perforce)

## Requirements and limits

<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="">Helix Swarm</th><td class="p-4 leading-relaxed text-muted" data-astro-cid-iw4wudoa="">REST API v9 or later; votes, test results and the review file list need v10 or later</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="">Helix user</th><td class="p-4 leading-relaxed text-muted" data-astro-cid-iw4wudoa="">Read access to the mapped depot paths, and permission to comment and vote in Swarm</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="">Limits per review</th><td class="p-4 leading-relaxed text-muted" data-astro-cid-iw4wudoa="">Up to 1,000 files, 4 MB per file and 64 MB in total; larger files are left out</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="">Not supported yet</th><td class="p-4 leading-relaxed text-muted" data-astro-cid-iw4wudoa="">Replies to @mergeharbor mentions, description updates, merging from the console, fix pull requests, incremental reviews</td></tr></tbody></table>

Documentation: [Perforce Helix Core](https://mergeharbor.com/docs/perforce) [Supported languages](https://mergeharbor.com/docs/languages) [Self-hosting](https://mergeharbor.com/docs/self-hosting)

## Other code hosts

-   [GitLab and GitLab Self-Managed](https://mergeharbor.com/ai-code-review/gitlab)
-   [Bitbucket Cloud and Bitbucket Data Center](https://mergeharbor.com/ai-code-review/bitbucket)
-   [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)
-   [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 · 9 min read How AI code review works, step by step What happens between opening a pull request and the first AI review comment, from the webhook and the code index to verification, posting and learning. Read the guide](https://mergeharbor.com/guides/how-ai-code-review-works) [Guide · 8 min read AI code review for monorepos and large repositories How AI code review handles monorepos and very large repositories: folder-level configuration, indexing at scale, large pull requests and the limits. Read the guide](https://mergeharbor.com/guides/monorepos-and-large-repositories)

## Frequently asked questions

Does MergeHarbor need Git Fusion?

No, but it helps. Without Git Fusion or Helix4Git, reviews work and see only the files the change touches. With it, MergeHarbor mirrors and indexes the repository, so reviews can search the codebase and follow callers and history.

How does Swarm tell MergeHarbor about a review?

Through a Swarm test that runs when a review is updated and POSTs the review details and a secret to MergeHarbor's webhook URL. Deliveries without the right secret are rejected.

What if our Swarm does not allow file downloads?

Set P4PORT, and the server fingerprint for ssl: servers, so MergeHarbor reads shelved files with the p4 client installed on its workers. MergeHarbor never trusts an unknown SSL fingerprint.

Is each new version reviewed in full?

Yes. Incremental reviews are not supported on Perforce yet, so each new version of a Swarm review is reviewed in full.

How does learning work in Swarm?

Likes on MergeHarbor's comments count as positive feedback. Swarm has no dislike, so rate comments in the console.

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)

## Review Perforce changes before they are submitted

Connect Helix Swarm, map your depot paths and add the test. The next updated review gets MergeHarbor's comments.

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