feat: add GitLab integration
What & why
Closes #7017.
Adds GitLab merge-request support to the workspace Review pane via glab, paralleling the existing GitHub gh integration. GitLab repositories can now discover their current merge request, see status/checks/comments/diff discussions, copy CI job logs, resolve discussions, open GitLab, and merge.
The initial scope is same-repository merge requests on GitLab.com and authenticated GitLab Self-Managed instances, including subgroup projects. Forked merge requests are intentionally deferred.
Images
How I tested it
- Added focused GitLab parser, MR discovery/state, discussion, check-log, merge-routing, refresh, and GitHub-regression tests.
- Ran
bun run lintandbun run typechecksuccessfully. - Ran focused tests successfully: 87 passing tests across the GitLab and GitHub Review paths, plus 47 parser and local-repository resolution tests covering GitLab.com and a self-hosted GitLab host.
- Manually tested a real GitLab merge request: normal comments and diff discussions sync into Superset; resolving discussions works; provider-aware GitLab labels/links render; marking a merge request ready refreshes its Review status.
- Manually verified discovery and Review-pane rendering for an open branch MR on an authenticated self-managed GitLab host.
Screenshots/video will be added shortly.
How to run and test
-
Check out this PR branch and start a local Superset workspace:
bun install ./.superset/setup.local.sh bun run dev -
Authenticate the GitLab CLI on the same machine for the GitLab host to test:
glab auth login --hostname <gitlab-host> -
Open a GitLab repository in Superset that has an open, same-repository merge request for the checked-out branch. The GitLab remote may be a subgroup project or an authenticated self-hosted host.
-
Open Review and verify the merge request title, draft/ready status, checks, comments, and diff discussions. Add a normal comment or diff discussion on GitLab, then return to Superset to confirm it refreshes. Resolve a discussion in Superset and confirm it resolves on GitLab.
Forked merge requests are outside this PR's initial scope.
Validation note
bun run test reaches an unrelated existing agent-setup fixture-isolation failure: two OpenCode tests import temporary fixture modules after another suite removes their shared temporary directory. This does not exercise the GitLab Review path; the focused GitLab/GitHub regression suites pass.
Checklist
- PR title follows conventional commits (
type(scope): subject) -
bun run lintandbun run typecheckpass - Allow edits from maintainers is enabled
Summary by cubic
Adds GitLab merge request support to the workspace Review pane and hover cards via glab, matching the existing GitHub gh integration. Review previously handled only GitHub pull requests; it now discovers, reviews, and manages same-repository GitLab merge requests—including comments, diff discussions, checks, CI job logs, draft/ready toggling, resolution, and merging—with GitHub behavior unchanged. Forked GitLab merge requests remain unsupported.
- Supports GitLab.com and authenticated self-hosted GitLab hosts, including subgroup projects; merge-request search, parsing, and repository matching cover all of these.
- Review labels, links, actions, workspace hover cards, and empty states now use the correct provider, GitLab author avatars render where GitHub-derived ones did, and author filters accept GitLab-style usernames.
- Provider state refreshes on Review mount, retry, and window focus with a 30-second cooldown per workspace.
- Long branch names truncate in the workspace header so merge-request controls stay readable in narrow layouts.
Migration
- GitLab
originremotes are detected when the host is GitLab.com or authenticated inglab; runglab auth login --hostname <gitlab-host>for self-hosted GitLab. - The merge mutation now accepts
workspaceIdas an alternative toprojectIdso it routes to the correct provider. - Workspaces reject upstreams from a different provider or GitLab host.
Summary by CodeRabbit
- New Features
- Added GitLab merge request support for merging, reviews, checks, discussions, and CI job logs.
- Repository detection now supports GitHub and GitLab remotes, including nested groups and self-hosted GitLab.
- Workspace refresh synchronizes pull and merge request status with the provider.
- Provider names now appear accurately in review links, comments, and action labels.
- Long branch names display more compactly in narrow layouts.
- Bug Fixes
- Improved workspace-linked merge handling and review-tab terminology.
- Tests
- Expanded coverage for GitLab workflows, remote parsing, logs, discussions, merging, and refresh behavior.