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

# GitLab

> Configure the mAItion GitLab connector to ingest repository files and issues from GitLab into the knowledge base.

Use the GitLab Connector to ingest repository files and, optionally, issues from a GitLab project into the mAItion knowledge base.

## What It Does

* fetches files from a GitLab project's repository at a given branch, tag, or commit
* optionally limits ingestion to a sub-directory or a single file
* optionally ingests the project's issues, with filtering by state, labels, assignee, author, milestone, and more
* runs ingestion on configurable schedules

## Authentication

Authenticate with a GitLab Personal Access Token scoped to `read_api`. Supports both GitLab.com and self-hosted GitLab instances via `gitlab_url`.

## Known Limitation

The underlying reader re-downloads all repository file content from the GitLab API on every scheduled
run. The vector store's checksum-based deduplication still prevents re-embedding unchanged files, but it
does not reduce GitLab API calls for the files connector.

## Required Environment Variables

Set these in `.env.rag`:

* `GITLAB1_URL`: base URL of your GitLab instance (example: `https://gitlab.com`)
* `GITLAB1_TOKEN`: Personal Access Token with `read_api` scope
* `GITLAB1_SCHEDULES`: ingestion interval in seconds (default: `3600`)

## `config.yaml` Example

```yaml theme={null}
sources:
  - type: "gitlab"
    name: "gitlab1"
    enabled: true  # optional, default: true
    config:
      gitlab_url: "${GITLAB1_URL}"
      personal_token: "${GITLAB1_TOKEN}"
      project_id: 12345678              # integer project ID, required
      ref: "main"                       # optional, branch/tag/commit, default "main"
      #path: "docs"                     # optional, limit to sub-directory
      #file_path: "README.md"           # optional, single file only
      recursive: true                   # optional, default true
      files_iterator: true              # optional, use iterator pagination to fetch all files (default true); set to false to limit to 20 files (GitLab API default page size)
      include_issues: false             # optional, default false
      #issues_state: "opened"           # optional: opened/closed/all, default "opened"
      #issues_labels: "bug,docs"        # optional, comma-separated
      #issues_assignee: "username"      # optional
      #issues_author: "username"        # optional
      #issues_milestone: "v1.0"         # optional
      #issues_search: "keyword"         # optional
      #issues_get_all: true             # optional, fetch all pages, default true; set to false to limit to 20 issues (GitLab API default page size)
      #issues_scope: "created_by_me"    # optional: created_by_me/assigned_to_me/all
      #issues_type: "issue"             # optional: issue/incident/test_case/task
      #issues_confidential: false       # optional
      #issues_non_archived: true        # optional
      #issues_iids: [1, 2, 3]           # optional, filter by specific issue IDs
      #issues_created_after: "2024-01-01T00:00:00Z"   # optional, ISO-8601
      #issues_created_before: "2024-12-31T23:59:59Z"  # optional, ISO-8601
      #issues_updated_after: "2024-01-01T00:00:00Z"   # optional, ISO-8601
      #issues_updated_before: "2024-12-31T23:59:59Z"  # optional, ISO-8601
      schedules: "${GITLAB1_SCHEDULES}"
```

## `.env.rag` Example

```dotenv theme={null}
GITLAB1_URL=https://gitlab.com
GITLAB1_TOKEN=glpat-xxxxxxxxxxxxxxxxxxxx
GITLAB1_SCHEDULES=3600
```

## Configuration Reference

| Field | Required | Default | Description |
| - | - | - | - |
| `enabled` | no | `true` | Set to `false` to skip this source entirely |
| `gitlab_url` | yes | — | Base URL of the GitLab instance |
| `personal_token` | yes | — | Personal Access Token with `read_api` scope |
| `project_id` | yes | — | Integer project ID to ingest files (and optionally issues) from |
| `ref` | no | `main` | Branch, tag, or commit to read files from |
| `path` | no | — | Limit file ingestion to a sub-directory |
| `file_path` | no | — | Limit file ingestion to a single file |
| `recursive` | no | `true` | Recurse into sub-directories when listing repository files |
| `files_iterator` | no | `true` | Use iterator pagination to fetch all files; set `false` to limit to 20 files (GitLab API default page size) |
| `include_issues` | no | `false` | Set to `true` to also ingest issues |
| `issues_state` | no | `opened` | `opened`, `closed`, or `all` |
| `issues_labels` | no | — | Comma-separated label filter |
| `issues_assignee` | no | — | Filter by assignee username |
| `issues_author` | no | — | Filter by author username |
| `issues_milestone` | no | — | Filter by milestone title |
| `issues_search` | no | — | Free-text search filter |
| `issues_get_all` | no | `true` | Fetch all pages of results; set `false` to limit to 20 issues (GitLab API default page size) |
| `issues_scope` | no | — | `created_by_me`, `assigned_to_me`, or `all` |
| `issues_type` | no | — | `issue`, `incident`, `test_case`, or `task` |
| `issues_confidential` | no | — | Filter by confidential flag |
| `issues_non_archived` | no | `true` | Exclude issues from archived projects |
| `issues_iids` | no | — | List of specific issue IIDs to fetch |
| `issues_created_after` / `issues_created_before` | no | — | ISO-8601 date bounds on issue creation |
| `issues_updated_after` / `issues_updated_before` | no | — | ISO-8601 date bounds on issue updates |
| `schedules` | no | `3600` | Ingestion interval in seconds |

## Multiple GitLab Sources

Add more `sources` entries (`gitlab2`, `gitlab3`, etc) with separate env vars per source.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.