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

# GitLab

> Connect GitLab to Steadwing so deployments, merge requests, commits, and CI/CD pipeline events are automatically correlated with production incidents during root cause analysis.

## What does the GitLab integration do?

The GitLab integration automatically correlates production incidents with recent code changes -- deployments, commits, merge requests, and CI/CD pipeline events -- so Steadwing can pinpoint which change likely caused the problem. Steadwing reads your GitLab repository data during root cause analysis to identify the responsible commit, merge request, or failed pipeline and propose code-level fixes.

## Why Use GitLab with Steadwing?

<CardGroup cols={2}>
  <Card title="Deployment Tracking" icon="rocket">
    Correlate incidents with recent deployments and releases
  </Card>

  <Card title="Code Change Analysis" icon="git-branch">
    Identify which commits and merge requests may have caused production issues
  </Card>

  <Card title="CI/CD Pipeline Insights" icon="workflow">
    Monitor pipeline failures and correlate them with incidents
  </Card>

  <Card title="Timeline Correlation" icon="clock">
    Link incidents to specific MRs, commits, and deployment times
  </Card>
</CardGroup>

## Benefits

* **Faster Root Cause Identification** - Quickly pinpoint which code change triggered an incident
* **Automated Code Analysis** - Steadwing reviews relevant code sections during RCA
* **Deployment Context** - Understand what was deployed when an incident occurred
* **Pipeline Failure Detection** - Identify CI/CD pipeline issues that may have contributed to incidents
* **Better Solution Proposals** - Get context-aware fixes based on your actual codebase
* **Historical Insights** - Track patterns between code changes and incidents over time

## How do I connect GitLab to Steadwing?

### Step 1: Connect GitLab OAuth

1. Navigate to [Steadwing Settings](https://app.steadwing.com/settings)
2. Find the **GitLab** integration card
3. Click the **Connect** button
4. You will be redirected to GitLab's authorization page
5. Click **Authorize** to complete OAuth

### Step 2: Grant Repository Access

After completing OAuth, configure which repositories Steadwing can access:

1. In GitLab, go to **Settings** → **Applications** → **Authorized Applications**
2. Find **Steadwing** in the list
3. Configure repository access permissions
4. Steadwing will now have access to track changes in your selected repositories

## What data does Steadwing pull from GitLab?

### Automatic Event Tracking

Steadwing automatically monitors and tracks:

* **Commits** - Every commit pushed to your repositories
* **Merge Requests** - MR merges and their associated changes
* **Releases** - Tagged releases and their deployment times
* **CI/CD Pipelines** - Pipeline runs, failures, and job statuses
* **Deployments** - Deployment events via GitLab CI/CD

### Code Analysis

Steadwing can:

* Review relevant files and functions
* Identify potentially problematic changes
* Suggest code-level fixes
* Link incidents to specific lines of code
* Analyze merge request diffs

## What permissions does the GitLab integration need?

### Required Permissions

The GitLab integration requires:

* **read\_api** - Read access to API endpoints
  * Read repository contents
  * Read commit history
  * Read merge request data
  * Read pipeline information
* **read\_repository** - Repository access
  * Clone and read repository contents
  * Access file contents and history

### Repository Access

You can control which repositories Steadwing can access:

1. Go to GitLab Settings → Applications → Authorized Applications
2. Find **Steadwing** in the list
3. Click **Edit** to modify permissions
4. Adjust repository access settings
5. Save changes

## Supported Features

### Code Investigation

* Fetch file contents from repositories
* Analyze commit history and diffs
* Review merge request changes
* Track code changes over time

### CI/CD Pipeline Monitoring

* Monitor pipeline runs and failures
* Identify failed jobs and stages
* Correlate pipeline failures with incidents
* Track deployment events

### Merge Request Analysis

* Review recent merge requests
* Analyze MR diffs and changes
* Identify potentially problematic merges
* Track MR approval and merge times

## FAQs

<AccordionGroup>
  <Accordion title="Does Steadwing work with self-hosted GitLab instances?">
    Currently, Steadwing supports GitLab.com (SaaS). Support for self-hosted GitLab instances is planned for a future release.
  </Accordion>

  <Accordion title="Can I limit Steadwing's access to specific repositories?">
    Yes, you can configure repository access permissions in GitLab's application settings. Steadwing will only access repositories you explicitly grant permission to.
  </Accordion>

  <Accordion title="Does Steadwing modify my code or create commits?">
    No, Steadwing only has read access. Steadwing analyzes your code but never modifies, commits, or pushes changes to your repositories.
  </Accordion>

  <Accordion title="What happens if I add new repositories later?">
    You can grant access to new repositories at any time by updating the application permissions in GitLab settings. Steadwing will automatically start tracking changes in newly authorized repositories.
  </Accordion>

  <Accordion title="Does Steadwing work with private repositories?">
    Yes, Steadwing works with both public and private repositories. The integration respects GitLab's permission model and only accesses repositories you explicitly authorize.
  </Accordion>

  <Accordion title="How does Steadwing handle nested groups and subgroups?">
    Steadwing supports GitLab's nested group structure. When analyzing repositories, it correctly handles project paths in the format `group/subgroup/project` and uses URL-encoded project IDs for API calls.
  </Accordion>

  <Accordion title="Can Steadwing analyze CI/CD pipeline failures?">
    Yes, Steadwing monitors CI/CD pipeline runs and can correlate pipeline failures with incidents. Pipeline monitoring helps identify whether a deployment or build issue contributed to production problems.
  </Accordion>

  <Accordion title="How do I disconnect the GitLab integration?">
    Go to [Settings](https://app.steadwing.com/settings), find the GitLab integration, and click **Disconnect**. You should also revoke access in GitLab Settings → Applications → Authorized Applications.
  </Accordion>
</AccordionGroup>

Need additional help? Please reach out to us at [hello@steadwing.com](mailto:hello@steadwing.com)
