Skip to main content
Connect GitLab so Enclave can read your projects, review merge requests, and comment with verified findings. Works with GitLab.com and with GitLab Self-Managed 14 or newer.

Before you start

  • You need the Owner or Admin role in Enclave.
  • Enclave lists the GitLab groups where you have the Developer role or higher.
  • Enclave adds its webhook with the GitLab account you connect, or with the GitLab Self-Managed token. It adds a group webhook to each top-level group where that account has the Owner role and GitLab Premium or Ultimate. It adds a project webhook to every other project where the account has the Maintainer role.
  • For GitLab Self-Managed, the access token needs the api scope and the Maintainer role.
Without the webhook, Enclave can’t see new commits or merge requests, and the connection stays pending.

Connect GitLab

GitLab.com and GitLab Self-Managed are separate integrations in Settings → Integrations. Both work the same way once connected.
1

Open the integration

Open Settings → Integrations in app.enclave.ai. Click Connect next to GitLab for GitLab.com, or next to GitLab Self-Managed for your own instance.
2

Connect your account or instance

Click Connect GitLab, sign in to your GitLab account, and authorize the Enclave application.
GitLab’s OAuth grants Enclave the api scope. GitLab has no narrower scope that allows posting MR comments and managing webhooks. Enclave uses it to read projects and merge requests, post MR comments, and receive webhook events.
3

Check the webhook

After you connect, Enclave adds its webhook to your groups and projects. The integration’s page shows Webhook added for your account when every project is covered.If Enclave couldn’t add it everywhere, it lists the projects that still need the webhook, with the reason:
  • needs a Maintainer: the connected account has less than the Maintainer role on the project.
  • GitLab refused: GitLab denied the request.
  • over 100 projects, add a group webhook: Enclave adds up to 100 project webhooks. Add a group webhook for the rest.
  • GitLab error: GitLab returned an error.
For those projects, ask someone with the Maintainer role to add the webhook by hand. Click Configure webhook and copy the URL and Secret token. In GitLab, open the project or group and go to Settings → Webhooks. Paste the URL and secret token, enable Push events, Merge request events, and Comments, and click Add webhook. Click Test to send a delivery.The connection stays pending until the first event arrives. PR reviews start after the first push or merge request.
4

Choose which projects get MR reviews

Automatic reviews are off for a newly connected GitLab project. To turn them on, use its PR reviews switch in Repositories. See PR and dependency analysis.

Tips

  • Create a dedicated GitLab account for Enclave so MR comments are clearly attributed. For GitLab Self-Managed, a service-account token is best, then a group access token. A personal token works, but every comment appears under your name.
  • Connect every project in a system. Enclave finds cross-service issues only when it can see both the service and the APIs it calls.

Troubleshooting

For GitLab Self-Managed, Enclave checks the URL as you type it:
  • That address is on a private network Enclave can’t reach: the hostname resolved to a private or internal address. Enclave doesn’t connect to those.
  • Couldn’t reach it: check the URL, your firewall rules, and the CA bundle if your instance uses a private certificate authority.
  • Something answered, but not a GitLab API: check that the URL points to your GitLab instance.
Validate & connect then checks your URL and token.
  • Enclave requires GitLab 14 or newer: upgrade your instance.
  • GitLab rejected the token or The token must include the ‘api’ scope: issue a new token with the api scope.
  • The token authenticated but cannot see any projects: add the token to a group or project first.
  • We refused to call that URL: the hostname resolved to a private or internal address. Enclave doesn’t connect to those.
  • We could not reach your GitLab instance: check the URL and your firewall rules.
To rotate a GitLab Self-Managed token, click Add instance and connect the same instance with a new token. Enclave updates the existing connection, keeps your webhook working, and confirms the update. Revoke the old token in GitLab afterward.

Manage the webhook

Open the connection in Settings → Integrations → GitLab or GitLab Self-Managed. The Webhook section on the General tab shows when the last event arrived. Click Configure to see the URL and secret token.
  • Rotate secret replaces the secret token. The old one stops working immediately, including in the webhooks Enclave added. Update the secret in each webhook in GitLab. On GitLab.com, you can connect again instead, and Enclave updates the webhooks it added.
  • Uninstall removes the connection, and Enclave deletes the webhooks it added.