Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/client-runtime/src/sourceControlClients.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,13 @@ describe("sourceControlClients.parseChangeRequestUrl", () => {
repository: "team/project",
number: 9,
});
const nested = "https://forge.example/acme/team/pull/123/-/merge_requests/7";
expect(parse(nested)).toEqual({
host: "forge.example",
repository: "acme/team/pull/123",
number: 7,
});
expect(kindOf(nested)).toBe("gitlab");
expect(
sourceControlClients.changeRequestUrlFromReferenceAutolink(
"https://gitlab.com/team/apps/web/-/merge_requests/42",
Expand Down
4 changes: 3 additions & 1 deletion packages/source-control-definitions/src/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ export { canonicalizePullRequestUrl as canonicalizeGitCafePullRequestUrl } from

/**
* GitHub comes first as the client default for unknown hosts. GitCafe, TanStack Source and Origin
* claim URLs first: GitHub and Forgejo accept the same routes on any hostname. TanStack Source is a
* claim URLs first: GitHub and Forgejo accept the same routes on any hostname. GitLab's `/-/` routes
* claim before GitHub's, which a nested project path can also match. TanStack Source is a
* private beta: every reader knows its URLs, and only a server with its flag on offers the forge.
*/
export const builtInSourceControlDefinitions = makeSourceControlDefinitionRegistry(
Expand All @@ -32,6 +33,7 @@ export const builtInSourceControlDefinitions = makeSourceControlDefinitionRegist
TanStackSource.definition.kind,
CursorOrigin.definition.kind,
AzureDevOps.definition.kind,
GitLab.definition.kind,
],
recognizeRemotesIn: [
GitCafe.definition.kind,
Expand Down
Loading