Skip to content

refactor(github): PR and work-item calls carry the repo owner's host - #27289

Merged
OrcaWin merged 1 commit into
mainfrom
OrcaWin/d4-g1-github
Oct 10, 2026
Merged

OrcaWin merged 1 commit into
mainfrom
OrcaWin/d4-g1-github

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​58 $\color{#cf222e}{\Huge{\mathbf{−}}}$​78 $\color{#cf222e}{\Huge{\mathbf{−}}}$​20
Prod 17 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​118 $\color{#cf222e}{\Huge{\mathbf{−}}}$​105 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​13

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

  • Before (user): a known repo already went to its owner, because the settings passed in were faked to name the owner. But the transport was still read back out of the Active Server setting, and getRuntimeRepoTarget defaulted to the raw setting when nothing was passed. A repo with no row went to the focused server.
  • After (user): same host for every known repo. A repo with no row runs on this computer, where the main process refuses repos it doesn't own. That matches what refactor(forge): forge reads and edits route by the repo's owner or the task source #27276 did for hosted-review actions.
  • Mechanism:
    • getRuntimeRepoTarget(state, repoPath, target) now takes the connection its caller routed by. The = state.settings default is gone.
    • New getGitHubSourceTarget(state, repo, sourceContext) in work-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 12 getGitHubWorkItemRequestContext callers pass it instead of settings.
    • PR lookups (startPullRequestLookup) get requestTarget from the repo row. PR refreshes use runtimeTargetForOwnerEnvironment(candidate owner) instead of faking settings.
    • fetchHostedReviewForBranch routes by the existing hostedReviewRepoOwnerTarget(repo).
    • Cache keys are byte-identical. They still embed the repo's own host; only a key for an unknown repo keeps its old scope.
    • Deleted helpers: settingsForHostedReviewRepoOwner, settingsForGitHubFocusedRepoOwner and getGitHubWorkItemSourceSettings.
    • Owner-routing ratchet: 165 → 163. Focus-read ratchet: 1343 → 1331.

Why

These were the last GitHub sites still taking their host from the Active Server setting. We considered converting the whole requestSettings plumbing, 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:

  • 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, focused pnpm 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

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

No wire change. SSH repos keep this computer's credentials. GitLab and other providers are unaffected.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 419d2447-d542-4b0e-8e2c-417eea0ecae8

📥 Commits

Reviewing files that changed from the base of the PR and between 8646d6cca698b9d66be27c9c5e79200ad26440e8 and a2c9d39.


📒 Files selected for processing (22)
  • config/focus-setting-read-baseline.txt
  • config/owner-routing-baseline.txt
  • src/renderer/src/store/github/check-actions.ts
  • src/renderer/src/store/github/comment-fetch-actions.ts
  • src/renderer/src/store/github/comment-mutation-actions.ts
  • src/renderer/src/store/github/conversation-comment-actions.ts
  • src/renderer/src/store/github/issue-actions.ts
  • src/renderer/src/store/github/pull-request-actions.ts
  • src/renderer/src/store/github/pull-request-execution.ts
  • src/renderer/src/store/github/repository-routing.ts
  • src/renderer/src/store/github/review-thread-actions.ts
  • src/renderer/src/store/github/work-item-aggregate-actions.ts
  • src/renderer/src/store/github/work-item-fetch-actions.ts
  • src/renderer/src/store/github/work-item-routing.test.ts
  • src/renderer/src/store/github/work-item-routing.ts
  • src/renderer/src/store/slices/github-work-items-error-envelope.test.ts
  • src/renderer/src/store/slices/github-work-items-pagination.test.ts
  • src/renderer/src/store/slices/github-work-items-runtime-routing.test.ts
  • src/renderer/src/store/slices/hosted-review-cache-state.ts
  • src/renderer/src/store/slices/hosted-review.test.ts
  • src/renderer/src/store/slices/hosted-review.ts
  • src/renderer/src/store/slices/store-test-helpers.ts

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d83eeb10-0e3f-4203-a76a-54b5618cbb4c


📥 Commits

Reviewing files that changed from the base of the PR and between 2eb6a92 and 8646d6cca698b9d66be27c9c5e79200ad26440e8.



📒 Files selected for processing (22)
  • config/focus-setting-read-baseline.txt
  • config/owner-routing-baseline.txt
  • src/renderer/src/store/github/check-actions.ts
  • src/renderer/src/store/github/comment-fetch-actions.ts
  • src/renderer/src/store/github/comment-mutation-actions.ts
  • src/renderer/src/store/github/conversation-comment-actions.ts
  • src/renderer/src/store/github/issue-actions.ts
  • src/renderer/src/store/github/pull-request-actions.ts
  • src/renderer/src/store/github/pull-request-execution.ts
  • src/renderer/src/store/github/repository-routing.ts
  • src/renderer/src/store/github/review-thread-actions.ts
  • src/renderer/src/store/github/work-item-aggregate-actions.ts
  • src/renderer/src/store/github/work-item-fetch-actions.ts
  • src/renderer/src/store/github/work-item-routing.test.ts
  • src/renderer/src/store/github/work-item-routing.ts
  • src/renderer/src/store/slices/github-work-items-error-envelope.test.ts
  • src/renderer/src/store/slices/github-work-items-pagination.test.ts
  • src/renderer/src/store/slices/github-work-items-runtime-routing.test.ts
  • src/renderer/src/store/slices/hosted-review-cache-state.ts
  • src/renderer/src/store/slices/hosted-review.test.ts
  • src/renderer/src/store/slices/hosted-review.ts
  • src/renderer/src/store/slices/store-test-helpers.ts


💤 Files with no reviewable changes (1)
  • config/owner-routing-baseline.txt


Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.




📝 Walkthrough
📝 Walkthrough

Walkthrough

GitHub request routing now resolves explicit runtime or local targets and passes them to request-context construction. Pull-request lookup and hosted-review lookup use repository-derived targets. The changes add routing tests, reuse a helper for runtime-owned repository test state, and update baseline entries.



Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 8646d

No identified routing or cache-identity issue blocks merge. Complete the usual build and test checks before merging.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 21.43% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 14 functions across 20 files. (1 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: carrying the repository owner's host through GitHub PR and work-item calls.
Description check Passed The description is detailed, on-topic, and covers the required sections, including the user impact, mechanism, rationale, testing, visual proof, notes, and checklist. It states that no linked issue ex…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.


Full details: Docstring Coverage

Explanation

Docstring coverage is 21.43% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 14 functions across 20 files. (1 skipped: 1 unsupported.)




✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR



  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.
@OrcaWin
OrcaWin force-pushed the OrcaWin/d4-g1-github branch from 8646d6c to a2c9d39 Compare October 10, 2026 18:36
@OrcaWin
OrcaWin merged commit ca1aac6 into main Oct 10, 2026
49 of 51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant