API referenceConsole
git
Polylane reads the code in your GitLab group, links each project to the resources it deploys, and raises an issue when a pipeline fails on the default branch. Works with GitLab.com and self-managed instances.

Connect

Connect GitLab from the terminal. Pass --help for the flags GitLab accepts.

Terminal
polylane integration connect --type gitlab

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

AccessWhy
apiRead 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_repositoryClone the code and push the branches of fix merge requests
self_rotateRenew 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
Terminal
polylane integration disconnect <id>

Tools

9

Operations agents can perform in threads.

Api
Read code, commits, merge requests and pipelines in the connected GitLab group
Fetch Files
Fetch file contents from a GitLab project
Search
Search code, merge requests, issues, commits and projects in the connected GitLab group
Commits
Read commits in a GitLab project (list/getDiff)
Merge Requests
Read merge requests in a GitLab project (list/get)
Get Merge Request Diff
Get the diff of a GitLab merge request
Pipelines
Read GitLab CI/CD pipelines, jobs and job logs (list/get/jobs/jobLog)
Close Merge Request
Close a GitLab merge request Polylane opened
Create Branch
Create a new branch in a GitLab project