> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ironbee.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> IronBee (ironbee.ai) is an AI QA engineer: it verifies code changes against the running app and keeps the evidence. It is not related to the IronBee open-source web application firewall.
> The console is at https://console.ironbee.ai.
> Install the CLI with `npm install -g @ironbee-ai/cli`, sign in with `ironbee login`, and set up a project with `ironbee install`.
> In GitHub workflows, use the action as `ironbee-ai/ironbee-action@v1` and pass the `IRONBEE_API_KEY` secret as the `ironbee_api_key` input.
> In GitLab pipelines, include the component `gitlab.com/ironbee-ai/ironbee-gitlab/verify@v1`; it reads the `IRONBEE_API_KEY` CI/CD variable by default.
> In Bitbucket Pipelines, run the pipe `docker://ghcr.io/ironbee-ai/ironbee-bitbucket:v1` and pass `IRONBEE_API_KEY: $IRONBEE_API_KEY` and `BITBUCKET_OAUTH_TOKEN: $BITBUCKET_OAUTH_TOKEN` under its `variables:`.
> Console scenarios (https://docs.ironbee.ai/console/scenarios) and CLI saved scenarios (https://docs.ironbee.ai/cli/guides/scenarios) are separate features.
> For plans and prices, link to https://ironbee.ai/pricing; the website is the source of truth for them.

# Code review on GitLab merge requests

> What IronBee posts on a GitLab merge request, how the IronBee review pipeline status works, and how to steer reviews with commands, replies and reactions.

IronBee reviews the merge requests of a repository whose group is [connected to IronBee](https://docs.ironbee.ai/integrations/gitlab.md), once the repository is enabled and has code review turned on. It posts a review with inline comments, keeps a summary note on the merge request, and sets the **IronBee review** pipeline status. Everything it writes appears as the group's IronBee service account, `ironbee-<group path>`, or `ironbee-<group path>-<group id>` when that name was taken. To turn code review on, see [Code review](https://docs.ironbee.ai/code-review/overview.md).

A review on GitLab reads, decides and reports the same way as on GitHub, so this page covers what differs. For the parts it shares, it links to [Code review on GitHub](https://docs.ironbee.ai/code-review/on-github.md). The text IronBee writes on GitLab says "pull request", as it does on GitHub.

Each review also appears in the console, with its findings. See [Pull requests](https://docs.ironbee.ai/code-review/pull-requests.md). To review a branch before you open a merge request, use [`ironbee review`](https://docs.ironbee.ai/cli/guides/code-review) in the CLI.

***

## What starts a review

The same events and settings as on GitHub start or hold back a review: a merge request opened or reopened, a draft marked ready, and new commits pushed, filtered by **Automatic reviews**, **Draft pull requests**, **Pull requests opened by bots**, **Target branches**, **Skip by label** and **Skip by title**. See [What starts a review](https://docs.ironbee.ai/code-review/on-github.md#what-starts-a-review).

A merge request that was already open when its repository was enabled isn't reviewed on its own. The console lists it as **Not reviewed** until someone asks for a review, or it gets a push.

A merge request from a fork is reviewed too. Its **IronBee review** status never holds the merge.

***

## The review IronBee posts

IronBee publishes a review in one batch, so GitLab sends one round of notifications for it. The review is a comment: it never approves a merge request. Whether a finding holds a merge is up to [the pipeline status](#the-ironbee-review-pipeline-status).

**The review body** is a note on the merge request, with the same content as on GitHub: the **Open in IronBee** button, the head line with the counts by severity, the notes on how the review was made, the rules and memories it applied, the findings table and the map of where the findings sit. See [The review body](https://docs.ironbee.ai/code-review/on-github.md#the-review-body). The note can't be resolved.

**Inline comments** are diff threads on the merge request's **Changes**, one per finding, with the same parts as on GitHub. See [Inline comments](https://docs.ironbee.ai/code-review/on-github.md#inline-comments). They differ in two ways:

* A suggested fix is a GitLab suggestion, which you apply with **Apply suggestion**. A fix with a line that starts with `/` is a plain code block instead, with no one-click apply.
* IronBee puts a `\` in front of every line it writes that starts with `/`, so GitLab never runs it as a quick action. In text the line reads as `/`. In a code block, such as a fix that couldn't be a suggestion, it shows as `\/`, so remove the backslash when you copy it. The console shows the line without it.

The severity and kind marks are the same icons as on GitHub; the kind marks come in a solid style that reads on light and dark themes alike.

***

## The summary note

With **Pull request summary** on, IronBee keeps one summary note on the merge request and edits it in place when the merge request changes. It never writes in the merge request's description.

The note is headed **Summary of this pull request**, and its first line says where it comes from: "*Written by IronBee from the code at `abc1234`.*", or "*..., update 3.*" after it has been rewritten. Its sections are the same as on GitHub. See [The pull request summary](https://docs.ironbee.ai/code-review/on-github.md#the-pull-request-summary).

The console's pull request page shows the same summary in its **Summary** card. See [Pull requests](https://docs.ironbee.ai/code-review/pull-requests.md).

***

## Follow-up reviews

Follow-up reviews work as on GitHub: a push or a request reads what changed since the last review, and IronBee replies on the threads of its earlier findings. With **Close fixed threads** on **Resolve the thread**, it resolves the thread of a fixed finding. See [Follow-up reviews](https://docs.ironbee.ai/code-review/on-github.md#follow-up-reviews).

***

## The IronBee review pipeline status

A review sets a commit status named **IronBee review** on the commit it reviewed. It joins the merge request's pipeline. Its link opens the pull request in the console. On a project with **Pipelines must succeed** and **Block merges** off, the default, IronBee writes no status; see [Merges](#merges).

| GitHub check conclusion | GitLab status |
| - | - |
| In progress | Running |
| Success | Passed |
| Action required | Failed |
| Neutral | Passed |
| Cancelled | Passed |

The status's description is the check's title on GitHub, such as `3 findings · 1 high · 2 low`, `Nothing to add` or **IronBee review · too large to review**. See [When the review is done](https://docs.ironbee.ai/code-review/on-github.md#when-the-review-is-done) for the titles. A status that would read only **IronBee review** adds the first line of the review's summary, such as **IronBee review · retracted**. A running status shows no progress.

A neutral or cancelled outcome is passed on GitLab, so it never holds a merge. Only an open finding that reaches **Block merging when** turns the status to failed.

### Merges

What the status does to a merge depends on the project's **Pipelines must succeed** setting on GitLab and on the **Block merges** code review setting in IronBee:

| **Pipelines must succeed** | **Block merges** | What IronBee does |
| - | - | - |
| On | Off, the default | IronBee writes no new status, and releases any status of its own that is running or failed as passed, with the description **IronBee review · not holding this merge**. It never holds the merge. Its findings stay in the comments and the summary note |
| On | On | A running review or verification holds the merge until it ends, and a blocking result holds it until it's fixed. **Block merging when** set to **Never** lifts the result, but not the hold while a review runs |
| Off | Either | IronBee writes its statuses. They don't stop a manual merge, but a merge request set to auto-merge waits while a review runs and stops at a failed status. **Block merging when** set to **Never** lifts a review's result |

With **Block merges** off, on a project with **Pipelines must succeed**, a failed status from an earlier review clears at the next review, a reply under a finding, a resolved thread or a push. **Block merges** is on the account's **Code review** settings as **Block merges on GitLab**, and on each GitLab repository's. See [Code review settings](https://docs.ironbee.ai/code-review/settings.md).

> [!NOTE]
>
> On a project with **All threads must be resolved**, IronBee's open inline threads count like anyone else's, and a reply under one of IronBee's notes turns it into a thread too.

***

## Commands

Write a command in a comment on the merge request, mentioning IronBee. On GitLab the mention is the group's service account, `@ironbee-<group path>`, shown and copyable under **Mention** on [Integrations > GitLab](https://docs.ironbee.ai/integrations/gitlab.md#mention-ironbee). The short form `@ironbee-ai`, the same mention as on GitHub, works too.

The commands, their replies and the forms IronBee reads are the same as on GitHub: `review`, `full review`, `pause`, `resume` and `retract`. See [Commands](https://docs.ironbee.ai/code-review/on-github.md#commands). For example:

```
@ironbee-ai review
```

A reply under IronBee's review note counts as a comment on the merge request, so commands work there too.

Only the merge request's author and members of the project with the Owner, Maintainer or Developer role can give commands. `retract` needs one of those three roles: being the author isn't enough. IronBee doesn't act on commands or questions from Reporters, Guests or anyone else.

`retract` deletes IronBee's review note, its inline comments, its other notes and the summary note, and the status, where IronBee writes one, reads **IronBee review · retracted**. GitLab keeps nothing of the review.

***

## Replies, reactions and resolved threads

IronBee reads what people do with its comments, as on GitHub. See [Replies, reactions and resolved threads](https://docs.ironbee.ai/code-review/on-github.md#replies-reactions-and-resolved-threads). As with commands, only the author and members with the Owner, Maintainer or Developer role count. On GitLab:

* **Reactions** are GitLab's emoji reactions. A thumbs-up or a thumbs-down counts as on GitHub; heart, tada and rocket count as a thumbs-up, and confused as a thumbs-down.
* **Hiding a comment** has no counterpart on GitLab.
* **Resolving a thread.** GitLab tells IronBee nothing when a thread is resolved or unresolved, so IronBee checks the threads of open merge requests every few minutes. The recheck of the **IronBee review** status follows within minutes rather than right away.
* System notes and internal notes are ignored.

***

## Credits and when a review doesn't run

Credits, the situations in which no review runs, and what happens when the team's credits run out are the same as on GitHub, with the **IronBee review** status in place of the check. See [When a review doesn't run](https://docs.ironbee.ai/code-review/on-github.md#when-a-review-doesnt-run) and [Credits](https://docs.ironbee.ai/code-review/on-github.md#credits). On a project with **Pipelines must succeed** and **Block merges** off, IronBee writes no status, so a review refused for credits says so in a reply on the merge request. A review that's too large or already reviewed shows only in the console there.

***

## What's next?

> [card] [GitLab](https://docs.ironbee.ai/integrations/gitlab.md)
>
> Connect a group and pick its repositories.

> [card] [Code review settings](https://docs.ironbee.ai/code-review/settings.md)
>
> Triggers, depth, output, merge blocking and Block merges.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.