Repository navigation
refactor(github): PR and work-item calls carry the repo owner's host - #27289
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 49 seconds. View limit details
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to No identified routing or cache-identity issue blocks merge. Complete the usual build and test checks before merging. Pre-merge checks |
|
getRuntimeRepoTarget takes the transport its caller already routed by instead of reading the Active Server setting (with a raw focus default). Work-item, comment, check and review-thread requests get it from getGitHubSourceTarget (task source host, else the repo's owner); PR lookups from the repo row; PR refreshes from the candidate's owner. Hosted-review fetches route by hostedReviewRepoOwnerTarget. An unknown repo stays on this computer instead of following the focused server. Cache keys are unchanged. Deletes settingsForHostedReviewRepoOwner, settingsForGitHubFocusedRepoOwner and getGitHubWorkItemSourceSettings.
8646d6c to
a2c9d39
Compare
ELI5
GitHub pull-request lookups, issue and PR comments, checks, review threads and hosted-review lookups now go to the host that owns the repository. Before, two shared helpers still picked the host from the app-wide "Active Server" setting. For repos Orca knows about, the answer is the same as before. The only difference is a repo Orca has no record of: it now stays on this computer instead of quietly going to whichever server is focused.
What Changed
getRuntimeRepoTargetdefaulted to the raw setting when nothing was passed. A repo with no row went to the focused server.getRuntimeRepoTarget(state, repoPath, target)now takes the connection its caller routed by. The= state.settingsdefault is gone.getGitHubSourceTarget(state, repo, sourceContext)inwork-item-routing.ts. It uses a row-less task source's host when there is one, otherwise the repo's owner (runtimeTargetForOwnerHostId). It never uses focus. All 12getGitHubWorkItemRequestContextcallers pass it instead of settings.startPullRequestLookup) getrequestTargetfrom the repo row. PR refreshes useruntimeTargetForOwnerEnvironment(candidate owner)instead of faking settings.fetchHostedReviewForBranchroutes by the existinghostedReviewRepoOwnerTarget(repo).settingsForHostedReviewRepoOwner,settingsForGitHubFocusedRepoOwnerandgetGitHubWorkItemSourceSettings.Why
These were the last GitHub sites still taking their host from the Active Server setting. We considered converting the whole
requestSettingsplumbing, which also builds every PR and work-item cache key. That is a much larger change that would churn cache keys. Passing the routing target alongside it removes the focus routing without touching the keys.Linked Issue
None. This is part of the host-ownership routing stack (D4 G1).
Visual Proof
N/A. No UI change; it only changes request routing.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
work-item-routing.test.ts:getGitHubSourceTargetruns the same task-source cases as the settings version (Headless PR merge routing: same #6957 bug in PullRequestPage.PRActionsPanel + read-path siblings (follow-up to #7590) #7623).hosted-review.test.ts: a lookup for an unknown repo now stays on this computer. This test replaces one that expected the focused server.The work-item runtime-routing, pagination and error-envelope tests now stamp their fixture repos with the server that owns them, the way ingest does, and no longer set the focus setting. They pass, which shows routing comes from the owner.
Ran:
pnpm tc:web, focusedpnpm test(store/github, hosted-review and github slices, plus 60 other files that touch these paths),oxlint/oxfmt,check:code-quality:changed,audit:anti-slop,check:owner-routing-ratchet.Review
Agent skill upstream boundary
Notes
No wire change. SSH repos keep this computer's credentials. GitLab and other providers are unaffected.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)