Prerequisites
Before you begin, gather the following:- GitLab base URL —
https://gitlab.comfor GitLab SaaS, or your private instance address (e.g.https://gitlab.example.com). - Access token — A GitLab personal access token or project access token.
- Webhook secret — A secret string you choose; it will be used to verify that webhook payloads come from GitLab.
Setup
Add a platform configuration
In the AI Review dashboard, go to Platform Configs and click Add.Fill in the fields:
Save the configuration. The platform config will appear in the list with its status.
| Field | Value |
|---|---|
| Name | A label for this connection (e.g. GitLab SaaS) |
| Platform type | GitLab |
| Base URL | Your GitLab instance URL |
| Access token | Your GitLab access token |
| Webhook secret | The secret string you chose |
Sync projects
Go to Project Management and click Sync.Select the platform configuration you just created and start the sync. AI Review will fetch all accessible projects from your GitLab instance and import them into the project list.
If the sync fails, verify that the base URL is reachable from the AI Review server and that the access token has the correct permissions.
Enable auto-review on a project
In Project Management, locate the project you want to enable and open its settings.Turn on Auto Review. You can also configure:
- The AI configuration to use for this project.
- Review templates.
- Default reviewers and assignees.
Supported events
AI Review processes the following GitLab webhook events:object_kind | action | Behavior |
|---|---|---|
merge_request | open | Triggers auto-review and applies auto-assignments |
merge_request | reopen | Triggers auto-review and applies auto-assignments |
merge_request | update | Triggers auto-review (see filtering note below) |
note | — | Triggers manual review when the comment body starts with /ai-review |
Assignment-only update filtering
Forupdate events, AI Review inspects the changes field of the payload. If the only changed keys are assignee_id, assignee_ids, assignees, reviewer_ids, updated_at, or updated_by_id, the event is ignored. This prevents a review from being re-triggered every time an assignee or reviewer is changed.
Review gate
Receiving a webhook event does not unconditionally start a review. Before queuing a review job, AI Review checks:- The project exists in the system (was synced).
- The project has review enabled.
- Auto-review is turned on for the project (for automatic triggers).
- An AI configuration is available for the project.
- The platform configuration is complete and enabled.
Troubleshooting
Webhook delivers but no review is triggered
Webhook delivers but no review is triggered
Check the following in order:
- Webhook token mismatch — The
X-Gitlab-Tokenheader sent by GitLab must exactly match the webhook secret stored in the platform configuration. Re-enter the secret on both sides if you are unsure. - Project not synced — The project must appear in Project Management. Run a sync if you recently added the project to GitLab.
- Project disabled — Open the project settings in AI Review and confirm that Auto Review is enabled.
- AI configuration missing — The project must have an AI configuration assigned. Go to the project settings and select or create an AI config.
- Platform configuration disabled — In Platform Configs, verify that the configuration is enabled.
Project sync fails
Project sync fails
- Confirm the base URL is correct and the GitLab instance is reachable from the AI Review server.
- Verify the access token has the
apiscope and has not expired. - Check that the token grants access to the projects you expect to import.
GitLab reports a webhook delivery failure
GitLab reports a webhook delivery failure
- Confirm the webhook URL is reachable from GitLab (no firewall blocking outbound requests).
- Check that the URL path is exactly
/api/webhook/gitlabwith no trailing slash. - Review the AI Review server logs for any errors returned during processing.
Review is triggered but no comment appears on the MR
Review is triggered but no comment appears on the MR
- Verify the access token has permission to post notes on merge requests.
- Check the AI Review server logs for errors from the GitLab API response.
- Confirm the project’s AI configuration points to a working AI provider.