Skip to content

GitLab Connection

The GitLab connection integrates your GitLab account with OpsTower, giving agents the ability to browse projects, read source files, search code, inspect commits and diffs, review merge requests, and monitor pipeline (CI/CD) status.

You need a GitLab.com account. The connection uses OAuth 2.0 with PKCE, so you authorize OpsTower to access your projects directly from the UI. GitLab’s code search uses project-scoped blob search.

  1. Go to Connections > Code > Add Connection.
  2. Select GitLab.
  3. Click Connect to GitLab.
  4. A popup opens to GitLab’s authorization page. Sign in and grant access.
  5. OpsTower automatically discovers your username and stores the connection.
  6. Optionally configure:
    • Default Branch — the default branch for browsing and commits (default: main)
    • Restrict to Project — limit agents to a single project (format: namespace/project or group/subgroup/project)

Once connected, agents have access to eight tools:

  • List Projects — discover all projects the connected user has access to, with visibility, default branch, and description
  • Browse Repository — explore directory structure at any path and branch
  • Read File — read file contents with line numbers, line range filtering, and binary detection (100KB limit)
  • Search Code — search for code patterns within a specific project (project-scoped blob search)
  • List Commits — view recent commits with author, date, and message, filtered by branch or path
  • Get Commit — inspect a specific commit’s details with changed files and diff stats
  • List Merge Requests — browse MRs by state (opened, closed, merged, all) with author, reviewers, draft status, and comment counts
  • List Pipelines — monitor CI/CD pipeline runs with status, branch, duration, source, and direct links
  • “Show me the most recent commits to the payments service”
  • “Find all usages of the processPayment function in our API project”
  • “What merge requests are currently open and waiting for review?”
  • “Read the src/services/billing.ts file in our backend project”
  • “What pipeline runs failed on the main branch today?”
  • “What changed in commit abc1234?”
  • OAuth popup blocked — allow popups for the OpsTower domain and try again
  • Code search returns no results — GitLab code search is project-scoped; make sure to specify the project path
  • Pipelines not found (404) — pipelines are not enabled for the project, or the project was not found
  • Token expired — click “Reconnect to GitLab” to refresh the OAuth tokens
  • Subgroups — GitLab supports nested groups; use the full path like group/subgroup/project when restricting access