Repository navigation
feat(host-service,desktop): GitLab MR discussions, job logs, PR pane and workspace from MR - #8724
Draft
geraudloup wants to merge 14 commits into
Draft
geraudloup wants to merge 14 commits into
geraudloup wants to merge 14 commits into
Conversation
A workspace whose remote is on a GitLab host now shows its merge request the way a GitHub workspace shows its pull request: state, draft, merged, the head pipeline as its check, and "review required" when approval is missing. Create PR opens a merge request with `glab mr create`. Every GitLab call is a `glab` subprocess, like the `gh` path, so it uses the user's own `glab auth login`. Superset passes `-R https://<host>/<path>` built from the remote, and glab maps that host to its API host itself, so self-managed instances and SSH host aliases work without any host settings in Superset. - A host is GitLab when its name contains "gitlab"; other hosts never spawn glab. - The GitLab identity is not written to the project row: avatars, clone matching and the Octokit procedures read projects.repo* as GitHub. - Merge and Ready for review stay hidden for non-GitHub PRs. They call GitHub by owner/repo/number, which a GitLab MR can share with a GitHub mirror of the same project.
Merge and Ready for review now work for a linked GitLab MR: the github router runs `glab mr merge` (squash and rebase map to their flags, auto-merge off so the result matches GitHub's immediate merge) and `glab mr update --ready`. The callers send owner/repo/number only, so the host picks GitLab when a linked GitLab MR has that identity, and refuses when a linked GitHub PR has it too: a GitLab project and its GitHub mirror share owner/repo, and a guess could merge the wrong one. The lookup reads the runtime's own pull_requests rows (the rows the PR chip shows), next to findPullRequestRow, so github.ts reads no snapshot fields. This replaces the renderer guard that hid both actions for GitLab MRs, and also covers mobile.
A GitLab owner now carries its host (`gitlab.example.com/group`, with the HTTPS port when the remote names one; an SSH port is not the web port): - MRs of two GitLab instances with the same path and number no longer share a cache entry or a pull_requests row. - An HTTPS remote on a non-default port keeps its port in the glab URL. - Merge and Ready for review pick GitLab when the owner has a slash, which a GitHub owner never has. No stored row is consulted, so a GitHub PR can never be routed to glab, and the runtime lookup is gone. Also from review: - A merge request without a string sha is skipped instead of being stored with headSha "undefined"; a pipeline without a URL has none. - A failed refresh after creating an MR is logged, as on the GitHub path. - The PR menu and card say "Open in browser" (an existing catalog string) instead of "View on GitHub". Files that now hold GitLab code are renamed to github-gitlab-*. The `@superset/shared/github-remote` export keeps its name so its importers do not change.
Renaming github-remote.ts to github-gitlab-remote.ts showed as a full delete and re-add, since the GitLab part nearly doubles that small file. The GitLab parser now lives in its own gitlab-remote.ts (exported as `@superset/shared/gitlab-remote`), so github-remote.ts and its importers stay untouched and the change is a plain addition.
…ab errors - Each job of the MR's head pipeline is a check (`glab ci get`), as each GitHub check run is. An allowed-to-fail job counts as neutral, and a manual job as skipped, so neither keeps the MR red or pending. - An MR with at least one approval shows as approved (approvals API, reached through the MR's own web host and project id). "Review required" still comes from detailed_merge_status. - execGlab rejects with glab's own reason (its stderr) instead of execFile's "Command failed: glab ..." line, which repeated the whole command, MR description included. Create, merge and ready failures now read like the GitHub path's.
A remote is GitLab when glab has a config entry for its host, not when the host name contains "gitlab": self-managed instances on any host name (git.company.com) now link their merge requests. The check is `glab config get api_host --host <host>`: a local config read, no network. Each answer is cached per host for five minutes, so a refresh spawns nothing for a host seen recently, and a later `glab auth login` is picked up. Only remotes that are not GitHub are checked.
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
3 tasks done
…en GitLab does - A manual job that may not fail blocks its pipeline, so it stays a pending check; only an optional manual job counts as skipped. - "Approved" needs GitLab's own `approved: true` as well as an approver: an approval can exist while required rules are still unmet.
geraudloup
force-pushed
the
feat/gitlab-glab-review
branch
from
October 21, 2026 13:26
39b8611 to
f578c2a
Compare
…ts gaps - The PR head and details lookups pick glab or GitHub inside one cachedGitHubFetch call instead of repeating it per provider. - Comments say why a fork MR is never linked (GitLab names the source project by id only), why "approved" also needs an approver (GitLab reports `approved` when no approval rule applies), and that GitLab has no case-drift sweep yet (its source-branch filter is case-sensitive).
geraudloup
force-pushed
the
feat/gitlab-glab-review
branch
from
October 21, 2026 13:51
f578c2a to
352db5b
Compare
- execGlab moves to its own exec-glab.ts with an ExecGlab type, so GitLab code no longer imports it from exec-gh. exec-gh exports the shared execCli runner. - normalizeMergeRequest and toJobCheck become normalizeGitLabMergeRequest and toGitLabJobCheck.
The runtime keeps a set of hosts glab has confirmed instead of re-checking every host every 5 minutes. An unknown host is asked again at each refresh, one local `glab config get`, so a host added with `glab auth login` shows at the next refresh without a restart.
geraudloup
force-pushed
the
feat/gitlab-glab-review
branch
from
October 21, 2026 14:30
352db5b to
ed4279f
Compare
Routers now ask the runtime only for a GitLab identity, through getGitLabRepository. getProjectRepository returns the GitHub identity saved on the project row, which routers must not use: resolveGithubRepo reads the remote as it is now. A GitLab identity is never saved, so it is always read fresh.
geraudloup
force-pushed
the
feat/gitlab-glab-review
branch
from
October 21, 2026 15:05
ed4279f to
daeb64a
Compare
normalizePullRequest, toCheckRunNode and mapReviewDecision and their GitLab counterparts build the same shapes, so a change to one usually needs the other. Each now names its twin.
geraudloup
force-pushed
the
feat/gitlab-glab-review
branch
from
October 21, 2026 16:53
daeb64a to
cf17302
Compare
- The two runtime tests share one gitlabProject helper and seed the workspace upstream, as the GitHub refresh tests do, instead of mocking readWorkspaceRefs. - glab answers come from one table keyed by subcommand. - The optional failed job had no effect on the assertion and is gone. - Shorter example hosts keep each remote-parser case on one line.
…and workspace from MR Builds on the GitLab support in ParadevAI#8719, through the same glab calls: - Discussions: the Review tab and the PR pane read an MR's discussions (diff notes as review threads, other notes as conversation), reply to a thread and resolve or reopen it. - Job logs: "Copy job logs" works for a failed GitLab CI job (`glab ci trace`), for jobs of the MR's own project only. - PR pane: a GitLab MR link opens in Superset's PR pane. Its ref keeps the host in the repo name, so the GitHub fallbacks never read it as a GitHub repo. Content, diff (`glab mr diff --raw`), merge, close and reopen, and ready or draft all run through glab. Writes reuse the GitHub path's sync, whose row lookup no longer needs the provider: a GitLab owner carries its host and never matches a GitHub one. - Workspace from an MR: the PR picker searches one GitLab project's MRs (text, `!12`, `12` or the MR URL), and checkout reads the MR's branch and head with `glab mr view`. MRs from forks are refused for now.
geraudloup
force-pushed
the
feat/gitlab-glab-review
branch
from
October 21, 2026 17:00
cf17302 to
d311dd4
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Part of #6445. Follow-up to #8719 and stacked on it: only the last commit is new (compare).
GitLab merge requests get the review features GitHub PRs have, through the same
glabcalls as #8719:glab ci trace), only for jobs of the MR's own project.glab mr diff --raw), merge, close/reopen and ready/draft.12,!12, or the MR URL.glab mr view.+454/−13 source lines, +78 test lines.
Not covered:
How I tested it
bun testinpackages/host-service: 2609 pass.bun run lintis clean.Checklist
type(scope): subject)bun run lintpasses.bun run typecheckreports no errors in the changed files; the local desktop check fails on unrelated UI-library types.Summary by cubic
GitLab merge requests get the review features GitHub PRs already have: status and approval display, CI job log copying, discussions with reply and resolve, the PR pane, and workspace creation from an MR. All calls go through the user's own
glabCLI, so self-managed instances work without extra setup. GitLab repos keep their host in the repo name so they can never be read as a GitHub repo.glab.approvedwith at least one approver; a blocking manual job stays a pending check and an optional one counts as skipped.!12,12, or the MR URL; checkout reads branch and head viaglab mr view. Fork MRs are refused.glab ci trace); the pane's commit list and line counts are not shown for GitLab.glabwhether it knows the host (confirmed hosts are remembered; unknown ones are re-asked at each refresh), not by parsing the URL.Written for commit d311dd4. Summary will update on new commits.