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
Workspaces: show PRs opened from a fork against the upstream repository #8732
A workspace on a fork can't show the PR that its branch opened against the upstream repository
The PR's source is the workspace's branch, but GitHub stores the PR in the upstream repository, and Superset only looks for PRs in the project's own repository
This affects every open-source contribution made from a fork: the sidebar PR status, the Board columns, and the PR pane all show no PR
Today
Project repo: github.com/mjspeck/xcore, a fork of SapienzaNLP/xcore
This is a feature gap, not a regression. On a project whose origin is a fork (here mjspeck/xcore, forked from SapienzaNLP/xcore), the v2 host-service PR runtime only looks for PRs in the project's own repository. PRs from fork contributions live in the parent repo with head mjspeck:<branch>, so the lookup never finds them. The workspace then shows no PR in the sidebar status, the Board columns or the PR pane. gh pr view does find the PR because the GitHub CLI resolves the fork's parent. The older desktop code path already handles forks the same way, but the host-service runtime never got that logic.
Affected code
packages/host-service/src/runtime/pull-requests/pull-requests.ts:1052-1112: getProjectRepository builds the repo identity from projects.repoOwner/repoName or by parsing origin. It never asks GitHub whether the repo is a fork, and never records a parent.
packages/host-service/src/runtime/pull-requests/pull-requests.ts:950-988: performProjectRefresh builds wantedRefs from each workspace's upstream (mjspeck/xcore#pr/transformers-5-support). That head ref is correct, but it passes the same repo (the fork) as the base for the lookup.
packages/host-service/src/runtime/pull-requests/pull-requests.ts:1399-1436: getCachedPullRequestByHead calls repos/{repo.owner}/{repo.name}/pulls?head=owner:branch, which here is repos/mjspeck/xcore/pulls?head=mjspeck:pr/transformers-5-support. The open-PR fallback sweep (:1523-1549) has the same scope. Both return nothing, because the PR's base is SapienzaNLP/xcore.
packages/host-service/src/runtime/pull-requests/utils/github-query/github-query.ts:229-276: the gh/Octokit pulls list calls themselves, which take the base repo as a parameter.
packages/host-service/src/runtime/pull-requests/pull-requests.ts:1149-1163 and :1180-1267: findPullRequestRow and upsertPullRequestRow key rows on the project's repoOwner/repoName. The details fetch (getCachedPullRequestDetails, :1438) also queries the reviews, checks and merge queue against repo. All of these would need to use the PR's real base repo.
Existing fork handling (desktop, not host-service)
The desktop has the logic this needs: apps/desktop/src/lib/trpc/routers/workspaces/utils/github/repo-context.ts:6-60 runs gh repo view --json url,isFork,parent and builds { repoUrl, upstreamUrl, isFork }. getPullRequestRepoArgs (:149-163) then adds --repo <parent>. apps/desktop/src/lib/trpc/routers/changes/utils/pull-request-discovery.ts:137-144 does the same. The host-service runtime does not use either.
Second proposal (Link PR on an existing workspace)
The host-service pullRequests router only exposes unlink for existing workspaces (packages/host-service/src/trpc/router/pull-requests/pull-requests.ts:62). The one explicit link path is linkWorkspaceToCheckoutPullRequest (pull-requests.ts:593-652), which is used by the new-workspace checkout flow. Even that path stores the PR row under the project's repo (findPullRequestRow(repo, …), upsertPullRequestRow({ repo, … })). So linking a cross-repo PR URL would also need the base repo stored per PR row, not taken from the project.
Suggested reproduction
Fork any public repo, clone the fork, and add it as a project in Superset (origin = fork).
Create a workspace, push a branch to the fork, and open a PR against the parent repo.
Run a PR refresh. The sidebar shows no PR, while gh pr view in the worktree shows it.
A sketch for pull-requests.test.ts: seed a project with repoOwner: "fork-owner" and a workspace with upstreamOwner: "fork-owner". Stub execGh so that repos/fork-owner/x/pulls returns [] and repos/parent-owner/x/pulls?head=fork-owner:branch returns one PR. Today the workspace's pullRequestId stays null.
Suggested fix direction
Resolve and cache the parent repo once per project, for example gh api repos/{owner}/{name} --jq .parent.full_name with an Octokit repos.get fallback. It could be stored as nullable columns on projects, next to repoOwner/repoName. A host-service schema change would need the migration skill checklist.
In fetchRepoPullRequests, when a head lookup against the project repo misses and a parent exists, repeat the head lookup against the parent. Keep this to head lookups only, not the open-PR sweep over the parent, which would be costly on large upstreams. It should go through the same cachedGitHubFetch and availability gate.
Optionally, add a host-service procedure to link an existing workspace to a PR URL from any repo, built on a generalized linkWorkspaceToCheckoutPullRequest.
Before changing any procedure inputs, read packages/trpc/AGENTS.md, because released clients still call these procedures.
Activity
github-actions commentedon Oct 21, 2026
Triage summary
This is a feature gap, not a regression. On a project whose
originis a fork (heremjspeck/xcore, forked fromSapienzaNLP/xcore), the v2 host-service PR runtime only looks for PRs in the project's own repository. PRs from fork contributions live in the parent repo with headmjspeck:<branch>, so the lookup never finds them. The workspace then shows no PR in the sidebar status, the Board columns or the PR pane.gh pr viewdoes find the PR because the GitHub CLI resolves the fork's parent. The older desktop code path already handles forks the same way, but the host-service runtime never got that logic.Affected code
packages/host-service/src/runtime/pull-requests/pull-requests.ts:1052-1112:getProjectRepositorybuilds the repo identity fromprojects.repoOwner/repoNameor by parsingorigin. It never asks GitHub whether the repo is a fork, and never records a parent.packages/host-service/src/runtime/pull-requests/pull-requests.ts:950-988:performProjectRefreshbuildswantedRefsfrom each workspace's upstream (mjspeck/xcore#pr/transformers-5-support). That head ref is correct, but it passes the samerepo(the fork) as the base for the lookup.packages/host-service/src/runtime/pull-requests/pull-requests.ts:1399-1436:getCachedPullRequestByHeadcallsrepos/{repo.owner}/{repo.name}/pulls?head=owner:branch, which here isrepos/mjspeck/xcore/pulls?head=mjspeck:pr/transformers-5-support. The open-PR fallback sweep (:1523-1549) has the same scope. Both return nothing, because the PR's base isSapienzaNLP/xcore.packages/host-service/src/runtime/pull-requests/utils/github-query/github-query.ts:229-276: thegh/Octokitpullslist calls themselves, which take the base repo as a parameter.packages/host-service/src/runtime/pull-requests/pull-requests.ts:1149-1163and:1180-1267:findPullRequestRowandupsertPullRequestRowkey rows on the project'srepoOwner/repoName. The details fetch (getCachedPullRequestDetails,:1438) also queries the reviews, checks and merge queue againstrepo. All of these would need to use the PR's real base repo.Existing fork handling (desktop, not host-service)
The desktop has the logic this needs:
apps/desktop/src/lib/trpc/routers/workspaces/utils/github/repo-context.ts:6-60runsgh repo view --json url,isFork,parentand builds{ repoUrl, upstreamUrl, isFork }.getPullRequestRepoArgs(:149-163) then adds--repo <parent>.apps/desktop/src/lib/trpc/routers/changes/utils/pull-request-discovery.ts:137-144does the same. The host-service runtime does not use either.Second proposal (Link PR on an existing workspace)
The host-service
pullRequestsrouter only exposes unlink for existing workspaces (packages/host-service/src/trpc/router/pull-requests/pull-requests.ts:62). The one explicit link path islinkWorkspaceToCheckoutPullRequest(pull-requests.ts:593-652), which is used by the new-workspace checkout flow. Even that path stores the PR row under the project's repo (findPullRequestRow(repo, …),upsertPullRequestRow({ repo, … })). So linking a cross-repo PR URL would also need the base repo stored per PR row, not taken from the project.Suggested reproduction
gh pr viewin the worktree shows it.A sketch for
pull-requests.test.ts: seed a project withrepoOwner: "fork-owner"and a workspace withupstreamOwner: "fork-owner". StubexecGhso thatrepos/fork-owner/x/pullsreturns[]andrepos/parent-owner/x/pulls?head=fork-owner:branchreturns one PR. Today the workspace'spullRequestIdstays null.Suggested fix direction
gh api repos/{owner}/{name} --jq .parent.full_namewith an Octokitrepos.getfallback. It could be stored as nullable columns onprojects, next torepoOwner/repoName. A host-service schema change would need the migration skill checklist.fetchRepoPullRequests, when a head lookup against the project repo misses and a parent exists, repeat the head lookup against the parent. Keep this to head lookups only, not the open-PR sweep over the parent, which would be costly on large upstreams. It should go through the samecachedGitHubFetchand availability gate.getCachedPullRequestDetails,findPullRequestRowandupsertPullRequestRow. That makespullRequests.repoOwner/repoNamethe upstream (SapienzaNLP/xcore) and stops a fork PR add electron installation fix documentation #16 from colliding with the fork's own PR add electron installation fix documentation #16.linkWorkspaceToCheckoutPullRequest.Before changing any procedure inputs, read
packages/trpc/AGENTS.md, because released clients still call these procedures.