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
{{ message }}
Repository navigation
Decouple GitLab-compatible MR identity from browser URLs and MR-specific refs
#43345
Some GitLab-compatible servers return native MR links such as /<namespace>/<project>/merge_requests/<iid> instead of /<namespace>/<project>/-/merge_requests/<iid>.
Using the browser URL as the internal MR identity can break automatic branch/thread association, linked MR status tracking, CLI output recognition, and stack linking. Rewriting the URL into the standard GitLab shape may restore recognition but break browser navigation.
Some compatible servers also do not advertise refs/merge-requests/<iid>/head, even though the source branch is available in the repository. Worktree materialization should not depend exclusively on that MR-specific ref.
Proposed design
Use a structured MR key: (provider, host, repository identity, iid). Resolve repository identity from provider metadata; prefer the stable project ID where available.
Preserve the original web_url for display and browser navigation. Neither compare browser URLs to establish identity nor synthesize browser URLs when the provider supplies one.
Accept both MR path shapes in provider-aware input parsing, including pasted links and CLI output. Resolve them to the same structured key.
Retain native MR ref fetching where supported. If that ref is unavailable, use source_project_id and source_branch, resolve the source project's advertised clone URL, and verify the fetched head against the expected MR head SHA. This also handles fork-based MRs without assuming the target repository contains the source branch.
Expected behavior
Both URL shapes identify the same MR; the original browser link opens unchanged.
Branch association, linked-MR tracking, and stacking do not depend on the browser URL format.
Worktree materialization works when the MR ref is absent and the expected head is available from the source repository.
Related discussions
#41834: nonstandard MR links on a particular compatible forge.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Problem
Some GitLab-compatible servers return native MR links such as
/<namespace>/<project>/merge_requests/<iid>instead of/<namespace>/<project>/-/merge_requests/<iid>.Using the browser URL as the internal MR identity can break automatic branch/thread association, linked MR status tracking, CLI output recognition, and stack linking. Rewriting the URL into the standard GitLab shape may restore recognition but break browser navigation.
Some compatible servers also do not advertise
refs/merge-requests/<iid>/head, even though the source branch is available in the repository. Worktree materialization should not depend exclusively on that MR-specific ref.Proposed design
(provider, host, repository identity, iid). Resolve repository identity from provider metadata; prefer the stable project ID where available.web_urlfor display and browser navigation. Neither compare browser URLs to establish identity nor synthesize browser URLs when the provider supplies one.source_project_idandsource_branch, resolve the source project's advertised clone URL, and verify the fetched head against the expected MR head SHA. This also handles fork-based MRs without assuming the target repository contains the source branch.Expected behavior
Related discussions
This proposal is a provider-level compatibility improvement rather than special-casing any particular forge.
All reactions