GitLab
Connect
Connect GitLab from the terminal. Pass --help for the flags GitLab accepts.
polylane integration connect --type gitlabSign in to GitLab.com as a group Owner, or enter a self-managed instance URL and token.
Connect a GitLab group so Polylane reads its code, reviews its merge requests, opens merge requests with fixes, and links each project to the resources it deploys. One connection covers one group and all of its subgroups.
GitLab.com
- Click Connect GitLab, then Continue with GitLab.com.
- Sign in as an Owner of a top-level group and approve the Polylane application.
- Choose the group. Groups on the Free plan are not available, because group webhooks need GitLab Premium or Ultimate. Trials of either plan work.
- Polylane adds a service account to the group with the Maintainer role, gives it a token, and adds a group webhook. It then revokes the sign-in grant.
Polylane acts as the service account from then on, so its activity in GitLab shows under that account, not under your name.
Self-managed GitLab
- In the group, open Settings > Access tokens and create a group access token with the Owner role and the
apiscope. A service account token with the same access also works. - In Polylane, click Connect GitLab and enter the instance URL and the token.
- Click Find groups, choose the group, and click Connect group.
The instance must be reachable from the public internet with a valid TLS certificate.
What Polylane does in the group
- Merge request reviews. When a merge request to the default branch opens, gets new commits, or leaves draft, Polylane assesses it against the live infrastructure. It writes one summary note that it updates on each run, adds discussions on the changed lines that need attention, and sets a commit status. Write
@polylanein a note to run the review again. - Fixes. Polylane opens merge requests with fixes from the service account, on branches that start with
polylane/. A note on one of these merge requests starts a follow-up change, and Polylane reacts with 👀 when it gets the note. When a pipeline fails on one of these merge requests, Polylane reads the job logs and pushes a fix. - First merge request. When you connect, Polylane opens one merge request that adds a Polylane section to
AGENTS.md, so that coding agents in the project know how to use Polylane. - Pipelines. Polylane raises an issue when a pipeline fails on the default branch. It also watches the pipeline failure rate, duration and queue time for anomalies.
What Polylane keeps up to date
- New, renamed, moved and removed projects follow within seconds through the group webhook, and a daily resync corrects anything a delivery missed.
- A push to a project's default branch refreshes that project and its links to deployed resources.
- Once a day, Polylane checks the group webhook. GitLab turns a webhook off after failed deliveries. If the connection token can manage webhooks, Polylane turns the webhook on again, or creates it again if it was deleted. If Polylane cannot fix it, it tells the workspace owners and admins what to do.
- Polylane renews the service account token it creates before it expires. A token you paste stays yours: renew it in GitLab before it expires, then connect again with the new token.
Permissions
| Access | Why |
|---|---|
api | Read projects, files, merge requests and pipelines. Open merge requests, write review notes and commit statuses. Manage the group webhook when the token has the Owner role |
read_repository, write_repository | Clone the code and push the branches of fix merge requests |
self_rotate | Renew the service account token before it expires (GitLab.com sign-in only) |
When you disconnect, Polylane revokes its service account token. The service account and the group webhook stay in the group until a group Owner removes them.
Disconnect
Disconnecting stops every sync and check and deletes the credentials Polylane held. Polylane removes what GitLab's API lets it remove. The following stays until you remove it yourself:
- Polylane service account in the group (its token is revoked)
- Polylane group webhook
polylane integration disconnect <id>Tools
9Operations agents can perform in threads.