Repository navigation
GitLab forge support for PRs, CI badges, planboard and issue ingestion (#193) - #1571
Conversation
#193) Adds electron/gitlab.js, a glab api backend with the same contract as the gh paths: merge requests (status, create, squash merge, background refresh), head-pipeline jobs as CI checks, and issue fetch/list/plan labels/comment/close/reopen/create. GitLab origins (gitlab.com or a host containing "gitlab", including subgroups) route there before the GitHub guard. Planboard note and crew PR step now apply to GitLab too. Closes #193 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d8011192f3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const gl = gitlabOrigin(originUrl); | ||
| if (gl) { | ||
| // ponytail: GitLab always squash-merges now; method/auto are gh-only. | ||
| await require("./gitlab.js").mergeMr(cwd, gl, info.number); |
There was a problem hiding this comment.
Do not turn GitLab auto-merge into an immediate merge
When GitLab checks are pending, NextGitActionButton.tsx still exposes “Auto-merge” and calls onPrMerge({ auto: true }), but this branch ignores opts.auto and immediately invokes the merge API. On projects that do not enforce successful pipelines server-side, clicking Auto-merge can therefore merge before the running checks finish; use GitLab's merge-when-pipeline-succeeds option or reject/hide auto-merge for GitLab.
Useful? React with 👍 / 👎.
| const gitlabUrl = gitlab.parseGitlabIssueUrl(s); | ||
| if (gitlabUrl) return gitlabUrl; |
There was a problem hiding this comment.
Preserve the forge from pasted issue URLs
A GitLab URL is reduced to only {number, owner, repo}, so fetchIssue later chooses the backend solely from the current project's origin. Pasting a GitLab issue URL while working in a GitHub checkout consequently runs gh issue view -R owner/repo and can import an unrelated GitHub issue with the same coordinates; the inverse mismatch queries GitLab for a pasted GitHub URL. Preserve the URL's forge/host and route accordingly, or reject cross-forge references.
Useful? React with 👍 / 👎.
| const bucket = | ||
| j.allow_failure && j.status === "failed" ? "skipping" : normalizeCheckBucket(j.status); |
There was a problem hiding this comment.
Treat optional manual jobs as skipped
For an optional GitLab manual job, the Jobs API reports status: "manual" with allow_failure: true; this condition only special-cases failed jobs, and normalizeCheckBucket("manual") falls through to pending. Such pipelines therefore remain displayed as “checks still running” indefinitely even though GitLab considers the manual job non-blocking and the MR is ready to merge. Map optional manual jobs to the skipping bucket as well.
Useful? React with 👍 / 👎.
Closes #193.
GitLab projects now get merge requests (status, create, squash merge, background refresh), CI badges, the planboard and issue ingestion, through a new
glab apibackend with the same contract as the gh paths.What changed
electron/gitlab.js(new): detects a GitLab origin (gitlab.com, or any host whose name contains "gitlab", including subgroups and ssh ports). All calls go throughglab api --hostname <host>, so self-hosted instances work.allow_failurejob that fails counts as skipping, not red.plan:*labels, comment, close, reopen and create.electron/worktrees-pr.js:viewBranchPris the shared branch-to-PR lookup forprStatusandmergePr.prChecks,refreshPrStatesandcreatePrdispatch to GitLab before the GitHub guard.ghTryAsynctakesopts.bin, so glab gets the same async/timeout/kill handling.electron/issues.js: routes to GitLab when origin is GitLab, and accepts GitLab/-/issues/NURLs.isForgeRemote, so they now apply to GitLab projects.Tests
electron/test/gitlab.test.jsuses a fake glab (CODER_GLAB_BIN) to cover MR lookup, CI jobs and every issues.js entry point.Known limits
--autooptions only apply to gh.listPrs/checkoutPr) andmergeOptionsstill only work with GitHub.🤖 Generated with Claude Code