From 20eaa5c24ee044d88f0c66c56b328f7992c0ff16 Mon Sep 17 00:00:00 2001 From: MarcoDotIO Date: Wed, 21 Oct 2026 10:23:44 -0400 Subject: [PATCH] fix(server): Forgejo and GitCafe pull requests link to their threads again pullRequestRepositoryKey only recognised /pull/, so a Forgejo, Gitea or GitCafe pull request URL (/pulls/) produced a null repository key. Thread pull request discovery and settlement require a key that matches the project, so those pull requests were detected and then dropped. Co-Authored-By: Claude Opus 5.5 --- apps/server/src/git/GitManager.test.ts | 5 +++++ apps/server/src/git/GitManager.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/server/src/git/GitManager.test.ts b/apps/server/src/git/GitManager.test.ts index 7bfc2c802773..bd2781682a15 100644 --- a/apps/server/src/git/GitManager.test.ts +++ b/apps/server/src/git/GitManager.test.ts @@ -1785,6 +1785,11 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { "gitlab.example.com/group/subgroup/repository", ], ["https://bitbucket.org/team/repository/pull-requests/42", "bitbucket.org/team/repository"], + ["https://codeberg.org/team/repository/pulls/42", "codeberg.org/team/repository"], + [ + "http://code.example:3000/forgejo/team/repository/pulls/42/files", + "code.example/forgejo/team/repository", + ], [ "https://dev.azure.com/org/project/_git/repository/pullrequest/42", "dev.azure.com/org/project/_git/repository", diff --git a/apps/server/src/git/GitManager.ts b/apps/server/src/git/GitManager.ts index bb180042c034..43098c90ab60 100644 --- a/apps/server/src/git/GitManager.ts +++ b/apps/server/src/git/GitManager.ts @@ -260,7 +260,7 @@ export function pullRequestRepositoryKey(value: string): string | null { try { const url = new URL(value); const match = - /^(.*)(?:\/pull\/|\/-\/merge_requests\/|\/pull-requests\/|\/pullrequest\/)\d+(?:\/.*)?$/iu.exec( + /^(.*)(?:\/pulls?\/|\/-\/merge_requests\/|\/pull-requests\/|\/pullrequest\/)\d+(?:\/.*)?$/iu.exec( url.pathname, ); if (match?.[1] === undefined) return null;