Skip to content

Quickstart on self-hosted GitLab

Documentation Index

Fetch the complete documentation index at: https://docs.sourcery.ai/llms.txt

Use this file to discover all available pages before exploring further.

Sourcery reviews every merge request on the projects you connect. Connect your self-hosted GitLab instance one of two ways: an automatic path that uses an admin token, or a manual one where you create the OAuth application and review user yourself.

Allow Sourcery’s static egress IPs so Sourcery’s API can reach the self-hosted instance. See Network requirements for the addresses to allowlist.

  1. Enter your GitLab URL

    Go to /login/gitlab-self-hosted, enter your GitLab URL (for example, https://gitlab.example.com), and click Login. If the instance isn’t connected yet, Sourcery shows the setup view with Automatic and Manual tabs.

  2. Set up the connection

    The automatic path is the easier one: hand Sourcery an admin token and it does the setup for you. Pick manual if your policy requires you to create the OAuth application and review user yourself.

    On the Automatic tab, paste an admin personal access token with the api scope, then click Setup. Sourcery uses the token to create the sourcery-ai review user and an instance-wide OAuth application on your GitLab. You can delete the admin token afterward.

  3. Choose projects

    Sourcery signs you in and the account dashboard opens. Enable Sourcery on each project you want reviewed. That’s it for setup: Sourcery installs a webhook on each selected project, so it sees merge requests and comments as they happen.

Open a merge request on any connected project and Sourcery reviews it. You’ll see:

  • A summary in the merge request description covering the change’s purpose and risk.
  • A reviewer’s guide comment with the code paths that changed and how to verify them.
  • Inline comments on the specific lines they’re about.

Push more commits and Sourcery reviews the new changes. To talk to it, comment @sourcery-ai on the merge request.

Billing is handled per seat. See Billing for how to manage it.