Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): PR guides work for pull requests on a fork's own repository #39601

Mergedjuliusmarmingemerged 3 commits intomain fromrefs/pull/39601/headmerged by juliusmarminge View on GitHub

Showing 5 changed files with 69 additions and 19 deletions (loading 2).

x
0 of 5 viewed, 5 left
24 additions and 1 deletionapps/server/src/mcp/toolkits/pullRequests/handlers.test.tsModified
View file
@@ -697,12 +697,33 @@
}),
id: ProjectId.make("project-web"),
- const harness = yield* makeHarness({ projects: [makeProject(), other] });
+ // A fork's canonical key follows its upstream; its own repository is `origin`.
+ const fork = {
+ ...makeProject({
+ canonicalKey: "github.com/acme/web",
+ locator: {
+ source: "git-remote",
+ remoteName: "upstream",
+ remoteUrl: "https://github.com/acme/web.git",
+ },
+ origin: {
+ canonicalKey: "github.com/someone/web",
+ remoteUrl: "https://github.com/someone/web.git",
+ },
+ provider: SourceControlProviderKind.make("github"),
+ displayName: "acme/web",
+ owner: "acme",
+ name: "web",
+ }),
+ id: ProjectId.make("project-fork"),
+ };
+ const harness = yield* makeHarness({ projects: [makeProject(), other, fork] });
const result = yield* harness.call("write_pull_request_guides", {
pullRequests: [
{ url: "https://github.com/acme/web/pull/7" },
{ repository: "t3tools/t3code", number: 12 },