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.
Before you start
Section titled “Before you start”Allow Sourcery’s static egress IPs so Sourcery’s API can reach the self-hosted instance. See Network requirements for the addresses to allowlist.
Install Sourcery
Section titled “Install Sourcery”-
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. -
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
apiscope, then click Setup. Sourcery uses the token to create thesourcery-aireview user and an instance-wide OAuth application on your GitLab. You can delete the admin token afterward.On the Manual tab, first create an instance-wide OAuth application at
Admin > Applicationsnamedsourcery-ai, with the redirect URIshttps://auth.sourcery.ai/login/callbackandhttps://sourcery.eu.auth0.com/login/callback, and the scopesapi,openid, andemail. Then create asourcery-aireview user and a personal access token with theapiscope. Paste the OAuth application ID and secret and the review user’s token into the form, then click Setup. -
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.
Your first review
Section titled “Your first review”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.