Skip to content

Show accurate PR status for local worktrees - #6460

Merged
brennanb2025 merged 1 commit into
mainfrom
brennanb2025/fix-pr-status-sidebar
Jun 27, 2026
Merged

brennanb2025 merged 1 commit into
mainfrom
brennanb2025/fix-pr-status-sidebar

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Jun 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Keep sidebar PR, check, hosted-review, and linked-issue status tied to the repo that owns the worktree instead of the currently focused runtime. Known local repos now read and write local cache keys even when a runtime is selected; SSH and runtime-owned repos still keep their explicit owner scopes, and missing owner context still follows the focused runtime fallback.

I checked the latest 50 merged PRs before opening this. Recent adjacent fixes such as #6397 and #6456 are already in origin/main; they fix badge stability and merged PR preservation, but origin/main still used focused-runtime fallback cache keys for known local repos. This PR is rebased on top of those fixes.

Design and Review

  • Design approach: add owner-aware cache identity to the existing GitHub and hosted-review key helpers, then pass repo-owner context through sidebar, right-sidebar, status-bar, refresh, and cache writer paths.
  • Design-review outcome: clean after tightening the implementation plan around shared helpers rather than writer-only changes.
  • Implementation deviations: adjacent linked-issue and workspace-space readers were folded in after completeness verification found the same reader/writer divergence there.

Verification

  • Completeness verification: initial passes found right-sidebar checks/comments and linked-issue/status-bar readers that still used focused-runtime keys. Those were fixed; final pass found no blockers.
  • Performance audit: no actionable findings. The change preserves exact-entry store subscriptions, existing TTLs, inflight dedupe, bounded caches, and visibility-gated refresh intervals; no new polling, subprocesses, or API churn were added.
  • Code review: two independent reviewers returned clean before the latest-main rebase. After checking the latest 50 merged PRs and rebasing, two more independent reviewers returned clean against current origin/main.
  • Product validation verdict: land. Electron validation used the actual demo-project PR stablyai/demo-project#22, which has a failed test check. The exact PR worktree rendered the left sidebar as PR checks: Failed for title PR status sidebar repro, not just the branch.

Screenshots

Manual validation evidence was captured from the exact PR worktree:

  • /tmp/orca-pr-status-sidebar-validation/pr-status-sidebar-pr-checks-failed.png

The screenshot shows the real demo-project PR #22 rendered in the left sidebar with PR checks: Failed.

Testing

  • pnpm run typecheck
  • pnpm run lint (passed with existing useGitStatusPolling.ts exhaustive-deps warning)
  • git diff --check
  • pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/store/slices/github-pr-refresh-host-guard.test.ts src/renderer/src/store/slices/hosted-review.test.ts src/renderer/src/store/slices/repo-owner-cache-identity.test.ts src/renderer/src/components/sidebar/WorktreeCard.pr-display.test.tsx src/renderer/src/components/sidebar/WorktreeCard.compact-hover.test.tsx src/renderer/src/components/sidebar/worktree-list-groups.test.ts src/renderer/src/components/status-bar/workspace-space-presentation.test.ts src/renderer/src/store/slices/github-checks.test.ts src/renderer/src/store/slices/hosted-review-cache-race.test.ts src/renderer/src/store/slices/hosted-review-cache.test.ts src/renderer/src/store/slices/worktrees.test.ts src/renderer/src/store/slices/github.test.ts src/renderer/src/components/right-sidebar/checks-panel-content.test.tsx src/renderer/src/components/right-sidebar/parent-pr-checks-rows.test.ts - 14 files, 504 tests
  • Reviewer rerun: focused 5-file slice, 165 tests
  • Reviewer rerun: 16 files, 514 tests
  • Product validation focused slice: 13 files, 465 tests
  • Electron validation from exact worktree: verified identity /Users/thebr/orca/workspaces/orca/devilray, branch brennanb2025/fix-pr-status-sidebar; validated stablyai/demo-project#22 with failed test check rendered as PR checks: Failed in the left sidebar.

AI Review Report

  • Design review: completed and incorporated the shared owner-aware cache-helper approach.
  • Completeness verification: completed after each cache-reader/writer fix; final pass found no blockers.
  • Performance audit: completed; no actionable performance findings.
  • Code review: two independent clean-review rounds completed, including a fresh round after rebasing onto latest origin/main with adjacent PR badge fixes already present.
  • Product validation: completed in Electron against a real demo-project PR and an in-memory focused-runtime stress check.

Security Audit

No new network endpoints, shell commands, filesystem writes, credential handling, IPC handlers, or permissions are introduced. The change adjusts renderer/store cache identity and existing provider routing. GitHub-specific behavior remains in GitHub paths, and SSH/runtime boundaries remain explicit through existing connection/execution-host owner scopes. No telemetry or agent-facing prompt text was added.

Manual Evidence

  • Electron identity: /Users/thebr/orca/workspaces/orca/devilray, branch brennanb2025/fix-pr-status-sidebar
  • Demo PR proof: stablyai/demo-project#22, open, head c490fc22..., test check conclusion FAILURE
  • Owner-aware stress check: temporarily set in-memory activeRuntimeEnvironmentId; known local demo repo still wrote/read local::<repoId>::orca-pr-status-repro-20260626142453, no runtime:focused-runtime-validation::... hosted-review cache entry was created, and UI stayed PR checks: Failed.

Assumptions and Gaps

  • SSH behavior was not live-tested because the diff changes shared cache identity/routing only; explicit SSH owner scopes are preserved and covered by deterministic tests.
  • The demo-project checkout had unrelated dirty files before validation; they were left untouched.

Post-PR Stabilization

  • Waited 8 minutes after opening the PR before sweeping CodeRabbit and checks.
  • First sweep: track-community-pr passed; verify was still pending.
  • CodeRabbit later flagged one refresh-path checks-cache lookup that still needed repo-owner scoping. Fixed in 43abe0c with a regression test; the inline comment is marked addressed.
  • Final sweep: required verify passed and GitHub reports the PR merge state as clean. A follow-up CodeRabbit run was rate-limited and did not post new actionable comments. The docstring coverage warning is a generic repository-wide warning with no actionable inline finding for this PR.

@coderabbitai

coderabbitai Bot commented Jun 27, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The PR changes cache-key generation and host-scope selection across GitHub PR, issue, checks, comments, and hosted-review flows. Store slices now pass repo identity and a repo-owner discriminator into cache-key helpers, and several fetch and refresh paths use repo-scoped settings instead of work-item scoped settings. Component and worktree/status-bar code was updated to call the expanded helpers, and tests were added or adjusted for runtime-focused local repository cases.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 2.13% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The PR description is mostly complete and follows the template, but the AI Review Report does not explicitly confirm macOS, Linux, and Windows cross-platform checks. Add an explicit cross-platform review note covering macOS, Linux, and Windows, including shortcuts, labels, paths, shell behavior, and Electron-specific differences.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: owner-aware PR status cache scoping for local worktrees.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 0280e713-0363-412b-996c-73c62c014294

📥 Commits

Reviewing files that changed from the base of the PR and between b899aef and 2d3cc766b669922171fa41d1bbbf0552d71c1bd6.

📒 Files selected for processing (28)
  • src/renderer/src/components/editor/check-run-details-fix-context.ts
  • src/renderer/src/components/right-sidebar/ChecksPanel.tsx
  • src/renderer/src/components/right-sidebar/SourceControl.tsx
  • src/renderer/src/components/right-sidebar/active-checks-status.ts
  • src/renderer/src/components/right-sidebar/parent-pr-checks-rows.ts
  • src/renderer/src/components/sidebar/WorktreeCard.compact-hover.test.tsx
  • src/renderer/src/components/sidebar/WorktreeCard.pr-display.test.tsx
  • src/renderer/src/components/sidebar/WorktreeCard.tsx
  • src/renderer/src/components/sidebar/folder-workspace-card-pr-display.ts
  • src/renderer/src/components/sidebar/use-worktree-issue-link.ts
  • src/renderer/src/components/sidebar/worktree-list-groups.test.ts
  • src/renderer/src/components/sidebar/worktree-list-groups.ts
  • src/renderer/src/components/status-bar/WorkspaceSpaceManagerPanel.tsx
  • src/renderer/src/components/status-bar/workspace-space-presentation.test.ts
  • src/renderer/src/store/slices/github-cache-key.ts
  • src/renderer/src/store/slices/github-checks.test.ts
  • src/renderer/src/store/slices/github-checks.ts
  • src/renderer/src/store/slices/github-pr-refresh-host-guard.test.ts
  • src/renderer/src/store/slices/github.test.ts
  • src/renderer/src/store/slices/github.ts
  • src/renderer/src/store/slices/hosted-review-cache-identity.ts
  • src/renderer/src/store/slices/hosted-review-cache-race.test.ts
  • src/renderer/src/store/slices/hosted-review-cache.test.ts
  • src/renderer/src/store/slices/hosted-review.test.ts
  • src/renderer/src/store/slices/hosted-review.ts
  • src/renderer/src/store/slices/repo-owner-cache-identity.test.ts
  • src/renderer/src/store/slices/worktrees.test.ts
  • src/renderer/src/store/slices/worktrees.ts

Comment thread src/renderer/src/store/slices/github.ts Resolved
@brennanb2025
brennanb2025 force-pushed the brennanb2025/fix-pr-status-sidebar branch from 2d3cc76 to 43abe0c Compare June 27, 2026 01:12
@brennanb2025
brennanb2025 merged commit d03e99c into main Jun 27, 2026
1 check passed
@brennanb2025
brennanb2025 deleted the brennanb2025/fix-pr-status-sidebar branch June 27, 2026 01:54
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
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