Code review

GitLab

Set up automatic Hull reviews on GitLab merge requests.

Hull reviews GitLab merge requests and posts its feedback on the MR as a summary note and inline discussion comments. It works with GitLab.com, and with self-hosted GitLab on the Enterprise plan.

Code review is included on Starter and higher plans. See Code review.

Before you start

You need the Maintainer role (or higher) on each project you want reviewed. Hull uses it to create the project webhook and a project access token for its review bot, so comments come from the bot and not from your personal account.

Set up

Connect GitLab. On the Integrations page, open GitLab and connect with OAuth or a personal access token. See Connect GitLab.

Configure the reviewer. Open Code Reviews (personal, or your organization's sidebar), turn on Enable AI Code Review, choose your model, style, focus areas and projects, and click Save Configuration. See Settings.

Open a merge request. Hull creates the webhook for each selected project and reviews new merge requests automatically.

When reviews run

Merge request eventReview
MR openedYes
New commits pushedYes
MR reopenedYes
Draft MR opened or updatedSkipped
MR closed or mergedNo

What you see on the merge request

  1. An 👀 reaction that shows Hull is reviewing.
  2. Inline discussion comments on specific lines, with severity and suggested fixes.
  3. A summary note with the overall findings.

When you push new commits, Hull cancels the review of the older commit, starts a new one, and updates the existing summary note.

The review bot

Comments are posted by a project access token named Hull Code Review Bot.

  • Hull creates it the first time it reviews a project.
  • It's valid for 365 days, and Hull rotates it before it expires.
  • If you revoke it in GitLab, Hull creates a new one on the next review.

Webhooks

Hull creates a webhook on each project you add to code review and removes it when you remove the project or turn reviews off.

If Hull can't create the webhook, add it yourself in GitLab > Project > Settings > Webhooks:

  • URL: the webhook URL shown in the Code Reviews webhook settings (https://app.withhull.com/api/webhooks/gitlab)
  • Secret token: the secret shown in the same place
  • Trigger: Merge request events

Disconnect

Click Disconnect on the GitLab integration page. Hull clears your tokens but keeps your webhook configuration, so reconnecting restores your setup.

Disconnecting doesn't revoke the OAuth grant on GitLab. Revoke it in GitLab > User Settings > Applications > Authorized applications.

Troubleshooting

Reviews don't start.

  1. Check that the GitLab integration is connected.
  2. Check that Enable AI Code Review is on and the project is selected.
  3. Make sure the MR isn't a draft.
  4. Check that the project has the Hull webhook (Settings > Webhooks).

"Permission denied" or the bot token can't be created. You need the Maintainer role on the project.

A review failed. Open the review on the Code Reviews page to see the error. Check that you have AI allowance left on your plan.

No projects are listed. Click refresh to sync projects from GitLab, and check that your GitLab account is a member of them.

Token expired. OAuth tokens refresh automatically; if refresh fails, reconnect. Personal access tokens can't be refreshed, so create a new one and reconnect.

Self-hosted connection problems. Check that your instance is reachable from the internet over HTTPS, that your OAuth application has the required scopes, and that its redirect URI is https://app.withhull.com/api/integrations/gitlab/callback.

On this page