> ## Documentation Index
> Fetch the complete documentation index at: https://www.bugzy.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# GitLab

> Connect GitLab for repository access, webhook-driven test execution, and merge request comments.

GitLab integration gives Bugzy access to your repositories, enabling test generation from code changes, webhook-driven test execution, and merge request comments with test results.

## What GitLab enables

* **Repository access** — Bugzy reads your codebase to understand application structure and generate relevant tests
* **Webhook-driven execution** — Push events and merge request events trigger Bugzy test runs automatically
* **MR comments** — Test results are posted as comments on merge requests, surfacing regressions before merge
* **Branch-aware testing** — Bugzy tests the exact branch and commit, not just the default branch

## Setup

<Steps>
  <Step title="Navigate to connections">
    Go to **Dashboard > Projects > \[Your Project] > Connections**.
  </Step>

  <Step title="Connect GitLab">
    Click **Connect GitLab**. This opens the OAuth flow managed by Nango.
  </Step>

  <Step title="Authorize access">
    Grant access to the GitLab groups and projects Bugzy should monitor.
  </Step>

  <Step title="Select repository">
    After connecting, select the repository Bugzy should work with for this project.
  </Step>
</Steps>

## Webhook events

Once connected, Bugzy listens for the following GitLab webhook events:

| Event                        | Bugzy action                                                      |
| ---------------------------- | ----------------------------------------------------------------- |
| Push to default branch       | Runs full test suite, triages any new failures                    |
| Merge request opened/updated | Runs tests relevant to changed files, posts results as MR comment |
| Merge request merged         | Triggers post-merge verification if configured                    |

## Merge request comments

When tests complete for a merge request, Bugzy posts a summary comment:

* **Pass** — All tests passed, no regressions detected
* **Fail** — Lists failures with classification (product bug, test issue, flaky) and links to filed issues

## Permissions

Bugzy requests the following GitLab OAuth scopes:

| Scope             | Purpose                                           |
| ----------------- | ------------------------------------------------- |
| `read_repository` | Clone and read source code                        |
| `read_api`        | Access project metadata and merge request details |
| `api`             | Post merge request comments and manage webhooks   |

<Info>
  Bugzy only accesses repositories explicitly selected during setup. It does not scan or access other projects in your GitLab group.
</Info>
