You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A GitLab merge request link opens the wrong repository and request number when a project path has a /pull/<n>/ segment, as with a nested group named pull. The built-in registry stops at the first host that parses a link, and GitHub's /<owner>/<repo>/pull/<n>/ route matches before GitLab's more specific /-/merge_requests/<n> route. This affects in-app PR link targets on web, desktop and mobile (resolveChangeRequestLinkTarget → sourceControlClients.parseChangeRequestUrl) and the server's thread PR sync, which uses the same registry.
Deterministic repro on origin/main (f875b27e5a0cea608918fa21bbb955471276037a): call builtInSourceControlDefinitions.parseChangeRequestUrl("https://gitlab.com/acme/team/pull/123/-/merge_requests/7"), then try again with host forge.example. Alternatively, call resolveChangeRequestLinkTarget with a GitLab project whose canonicalKey is gitlab.com/acme/team/pull/123. No forge network call is needed.
Observed: kind: "github", repository: "acme/team", number: 123 on both hosts, so resolveChangeRequestLinkTarget returns null for the matching GitLab project.
Add GitLab to the built-in registry's claimChangeRequestUrlsFirst list so its /-/ routes are tried before GitHub's routes, which accept any hostname. GitLab's routes all need a /-/ segment, which GitHub does not use, so ordinary GitHub links still parse as before. The same claim order also applies to issue, commit and autolink parsing, where GitLab's /-/ routes are just as specific.
Scope
Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.
Verification
Added two cases to packages/client-runtime/src/changeRequestLinks.test.ts. The first resolves a nested GitLab MR on gitlab.com and forge.example. The second checks that a GitHub PR subpage (/pull/7/files) still parses as GitHub's.
On base, vp test run src/changeRequestLinks.test.ts fails the first case (AssertionError: expected null to deeply equal { host: "gitlab.com", repository: "acme/team/pull/123", number: 7, … }; 1 failed, 14 passed). On head, all 15 pass.
Not shown: no screenshots, because no rendered UI changed. I did not open a link in a running client or use a live GitLab instance.
Authored by Claude Opus 5.5 (Model Hub); reviewed by GPT-6.2 Sol (Codex).
Not shown
apps/web/src/lib/openPullRequestLink.ts:278 — The transcript proves parser and target behavior, not a running-client click. Make the repro scenario-ready: load a matching GitLab project with in-app link opening enabled, click the MR from thread text, and assert that the native panel targets acme/team/pull/123 MR !7 instead of falling through to generic link handling. No real-client or live-forge run was performed.
scripts/check-changed.ts:328 — The head-tagged gist reports a clean check:changed run but does not include the command output or exit status capture. Attach SHA-stamped output for independent verification; the read-only review did not rerun the full command.
Macroscope's review found this PR approvable — GitLab merge-request URLs are now recognized before overlapping GitHub URL prefixes. The change is limited to link routing and leaves the default client and remote recognition unchanged.
You can add or adjust custom eligibility rules. Learn more.
No actionable comments were generated in the recent review.
Walkthrough
The registry now checks GitLab before GitHub when claiming change-request URLs. New tests cover nested GitLab project paths containing /pull/ and GitHub pull-request /files URLs.
Changes: Change-request URL resolution
Layer / File(s)
Summary
Provider precedence and resolution coverage packages/source-control-definitions/src/registry.ts, packages/client-runtime/src/changeRequestLinks.test.ts
The registry adds GitLab after Azure DevOps in claimChangeRequestUrlsFirst. Tests cover nested GitLab merge-request URLs on gitlab.com and a custom host, plus GitHub pull-request /files URL resolution.
Nested GitLab merge-request links should now resolve to the right project, and ordinary GitHub pull-request links should keep resolving as before. No actionable merge risk remains.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: GitLab nested merge-request URLs are routed before GitHub prefix matches. The changeset adds GitLab to claimChangeRequestUrlsFirst in the registry, with tests for nest…
Description check
The description follows the template. It has Problem, Change, Scope, and Verification sections, and it explains the root cause, the fix, and the tests. The Verification section gives a test result (1 …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: GitLab nested merge-request URLs are routed before GitHub prefix matches. The changeset adds GitLab to claimChangeRequestUrlsFirst in the registry, with tests for nested GitLab MR links and a GitHub PR subpage regression. The title uses the conventional commit format and is 84 characters long, which is acceptable.
Full details: Description check
Explanation
The description follows the template. It has Problem, Change, Scope, and Verification sections, and it explains the root cause, the fix, and the tests. The Verification section gives a test result (1 failed and 14 passed on base, 15 passed on head) and a check:changed exit status. It does not include screenshots, but the description explains why none apply because no rendered UI changed. The author also states that the change does not rely on a running client or a live GitLab instance.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
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
size:XS0-9 changed lines (additions + deletions).takeover:in-progressA takeover lead is working on this PRvouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.
2 participants
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.
Problem
A GitLab merge request link opens the wrong repository and request number when a project path has a
/pull/<n>/segment, as with a nested group namedpull. The built-in registry stops at the first host that parses a link, and GitHub's/<owner>/<repo>/pull/<n>/route matches before GitLab's more specific/-/merge_requests/<n>route. This affects in-app PR link targets on web, desktop and mobile (resolveChangeRequestLinkTarget→sourceControlClients.parseChangeRequestUrl) and the server's thread PR sync, which uses the same registry.Deterministic repro on
origin/main(f875b27e5a0cea608918fa21bbb955471276037a): callbuiltInSourceControlDefinitions.parseChangeRequestUrl("https://gitlab.com/acme/team/pull/123/-/merge_requests/7"), then try again with hostforge.example. Alternatively, callresolveChangeRequestLinkTargetwith a GitLab project whosecanonicalKeyisgitlab.com/acme/team/pull/123. No forge network call is needed.kind: "github",repository: "acme/team",number: 123on both hosts, soresolveChangeRequestLinkTargetreturnsnullfor the matching GitLab project.kind: "gitlab",repository: "acme/team/pull/123",number: 7.Change
Add GitLab to the built-in registry's
claimChangeRequestUrlsFirstlist so its/-/routes are tried before GitHub's routes, which accept any hostname. GitLab's routes all need a/-/segment, which GitHub does not use, so ordinary GitHub links still parse as before. The same claim order also applies to issue, commit and autolink parsing, where GitLab's/-/routes are just as specific.Scope
Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.
Verification
packages/client-runtime/src/changeRequestLinks.test.ts. The first resolves a nested GitLab MR ongitlab.comandforge.example. The second checks that a GitHub PR subpage (/pull/7/files) still parses as GitHub's.vp test run src/changeRequestLinks.test.tsfails the first case (AssertionError: expected null to deeply equal { host: "gitlab.com", repository: "acme/team/pull/123", number: 7, … }; 1 failed, 14 passed). On head, all 15 pass.vp run check:changedexits 0 (format, lint, knip, typecheck, affected tests).Not shown: no screenshots, because no rendered UI changed. I did not open a link in a running client or use a live GitLab instance.
Authored by Claude Opus 5.5 (Model Hub); reviewed by GPT-6.2 Sol (Codex).
Not shown