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 then adds a service account to the group with the Maintainer role, gives it a token, and adds a group webhook. It then revokes your 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. Polylane adds a group webhook and acts as the owner of the token.
How it works
Projects and code
Polylane syncs each project in the group and its subgroups, and links each project to the resources that it deploys. New, renamed, moved and removed projects follow within seconds through the group webhook. A push to the default branch of a project refreshes that project and its links. A daily resync corrects anything that a delivery missed. Agents read the group through the GitLab API, limited to the group, its subgroups and their projects.
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 @polylane in a note to run the review again. A project member with the Developer role or higher can ask.
Fix merge requests
Polylane opens merge requests with fixes 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.
When you connect, Polylane opens one merge request that adds a Polylane section to the agent instruction file, such as AGENTS.md, so that coding agents in the project know how to use Polylane.
Pipelines
When a pipeline fails on the default branch, Polylane receives an alert, and the alert becomes an issue. The next green pipeline recovers it. Polylane also watches the pipeline failure rate, duration and queue time for anomalies.
Upkeep
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 before it expires. A token that 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) |
Disconnecting
When you disconnect, Polylane revokes its service account token. A token that you pasted stays with its owner: revoke it in GitLab. The service account and the group webhook stay in the group until a group Owner removes them. Polylane refuses the deliveries of that webhook.
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.