GitLab integration

Connect GitLab for repository context, CI pipeline data, and governed issue publishing.

Connect GitLab for repository context, CI pipeline data, and governed issue publishing.

GitLab connected in Premortem Integrations settings
Connected Providers with GitLab OAuth scopes.

What GitLab provides

Repository files, merge request context, CI pipeline configuration, and issue APIs for structured publish and reconciliation workflows.

OAuth setup

  • Create GitLab OAuth application with redirect URI: {NEXT_PUBLIC_APP_URL}/api/integrations/callback/gitlab.
  • Scopes: read_user, api, read_repository (as shown in Settings UI).
  • Set GITLAB_CLIENT_ID and GITLAB_CLIENT_SECRET in .env.local / production secrets.
  • Use 127.0.0.1 consistently in local dev to avoid redirect loops.
Connect URL (browser)
GET /api/integrations/connect/gitlab?next=/app%3Ftab%3Dprojects

MCP and API

Premortem uses GitLab MCP for agent context and REST APIs for publish flows. Cursor IDE connects to gitlab.com/api/v4/mcp with OAuth; server-side publish uses PAT or OAuth token.

Official documentation

Reviewer path

After an audit completes, reviewers approve issue candidates in /app before sync. Publish confirmation and reconciliation keep GitLab issues aligned with audit output.

GitLab issue synthesis and approve button
Approve & Create GitLab Issue after synthesis edit.

Reconciliation

  • POST /api/issues/reconcile compares local snapshot vs remote GitLab issue.
  • Drift fields: title, labels, state when remote issue edited outside Premortem.
  • PREMORTEM_RECONCILE_DRY_RUN=1 logs comparison without writes.

View source on GitHub

Related links

Announcement updates version release today!

ReleasesPrivacy
Terms