Ingest GitLab merge requests, issues, commits, pipelines, and releases into CortexDB.

GitLab Connector

Captures merge requests, issues, commits, comments, pipeline statuses, and releases from your GitLab group / projects as CortexDB experiences. System hooks for low-latency; cursor-based polling as a fallback.

Info

Two ways to run this connector:

  • Run it yourself (Free + paid) — pip install 'cortexdb-connectors[gitlab]' then cortexdb-sync sync gitlab. The connector reads your token from ~/.cortexdb/state.json (written by cortexdb init) or from env vars.
  • Managed sync (Starter and up) — CortexDB runs the connector as a worker on its infrastructure. Configure it once from your dashboard; CortexDB handles webhook registration, retries, backfill, and idempotency.

1. Prepare credentials in GitLab

Settings → Access Tokens (group level recommended). Scopes: read_api, read_repository. Copy the token (glpat-…).

2. Configure in your CortexDB dashboard

  1. Sign in at cortexdb.ai/login.
  2. Settings → Connectors → Add Connector → GitLab.
  3. Paste the GitLab URL (https://gitlab.com or your self-hosted URL) and access token.
  4. Pick the groups / projects to sync.
  5. Set the scope template. Default: org:<your-org>/source:gitlab/project:{project_path}.
  6. Pick sync mode: Real-time (system hook — the dashboard provisions the delivery URL automatically) or Polling.
  7. Click Start sync.

What gets written

EventModalityNotes
Merge request opened/updateddocumentTitle + description
Merge request commentconversationrole=user; preceded_by links thread
Issue created/updateddocumentTitle + description
Pipeline statusobservationsuccess/fail with duration metadata
ReleasedocumentTag + release notes

idempotency_key shape: gl:<event_type>:<project_id>/<id>.

Run it yourself

If you'd rather host the connector yourself instead of using CortexDB's managed worker, every connector ships in the cortexdb-connectors PyPI package:

pip install 'cortexdb-connectors[gitlab]'

# Step 1: get a CortexDB token + actor (one-time, free tier)
pip install cortexdb-cli
cortexdb init

# Step 2: supply the connector's third-party credentials
export GITLAB_TOKEN=...                # required

# Step 3: one-shot sync, or `watch` for a poll loop
cortexdb-sync sync gitlab
cortexdb-sync watch gitlab --interval 60

cortexdb-sync reads your CortexDB token + actor from ~/.cortexdb/state.json automatically. Cursor state is persisted in ~/.cortexdb/connectors-state.json, so re-running picks up where the last cycle left off.

See also