Keep PR checks aligned with branch switches#6458
Conversation
Co-authored-by: Orca <help@stably.ai>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe PR adds git identity tracking to ChecksPanel refresh handling, including snapshot-based refresh checks, explicit 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
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. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/renderer/src/store/slices/worktrees.ts (1)
2375-2496: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winPersist clears when a tombstoned worktree switches branches again.
After the first branch switch clears links, a second
updateWorktreeGitIdentitybefore the queued clear runs updates the tombstone here but leavesshouldPersistHostedReviewClearfalse. The queued task can then return at Line 2439 becausecurrent.branch !== clearedBranch, so the clear survives only in memory and stale persisted review metadata can rehydrate after restart.Suggested fix
} else { const tombstone = hostedReviewLinkClearTombstonesByWorktreeId.get(worktreeId) if (tombstone) { - hostedReviewLinkClearTombstonesByWorktreeId.set(worktreeId, { + const nextTombstone = { ...tombstone, branch: nextBranch, branchIdentity: canonicalHostedReviewBranchIdentity(nextBranch), head: nextHead - }) + } + hostedReviewLinkClearTombstonesByWorktreeId.set(worktreeId, nextTombstone) + if (hostedReviewBranchChanged) { + shouldPersistHostedReviewClear = true + clearedBranch = nextBranch + clearGeneration = tombstone.generation + } } }
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: dde227d7-ab4c-4bbe-b86b-522f7fc5e672
📒 Files selected for processing (5)
src/renderer/src/components/right-sidebar/ChecksPanel.tsxsrc/renderer/src/components/right-sidebar/checks-panel-git-status-snapshot.test.tssrc/renderer/src/components/right-sidebar/checks-panel-git-status-snapshot.tssrc/renderer/src/store/slices/worktrees.test.tssrc/renderer/src/store/slices/worktrees.ts
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
Summary
Keeps the Checks/PR sidebar aligned with the active worktree branch when terminal/git status observes a branch switch.
Screenshots
Product validation captured local screenshot evidence:
.playwright-cli/page-2026-06-27T00-33-20-080Z.png.playwright-cli/page-2026-06-27T00-33-50-204Z.pngTesting
pnpm lint(passed with one existing warning inuseGitStatusPolling.ts, outside this diff)pnpm typecheckpnpm test(not run in full; focused Vitest below covered changed modules)pnpm build(not run locally; CI built the unpacked app)pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/right-sidebar/checks-panel-git-status-snapshot.test.ts src/renderer/src/store/slices/worktrees.test.ts(202 passedafter CodeRabbit fix)pnpm run typecheck:webgit diff --checkoxlint, React Doctor oxlint config,oxfmt --writeverifycheck passed, including lint, typecheck, test, unpacked app build, and packaged CLI smokeProduct validation:
/Users/thebr/orca/workspaces/orca/yellowtailon branchbrennanb2025/agent-cli-layout.demo-projectvia a temporary git worktree; did not use the Orca repo or real Orca PRs/issues.linkedPR: 4908and apushTarget, switched the underlying branch externally, then clicked the real Checks pane Refresh button.pushTarget.Branch not published,Publish Branch, andRefresh.AI Review Report
Design review completed cleanly after adding explicit performance constraints from recent git refresh/coalescing work.
Implementation/completeness review flagged several branch-switch and stale-refetch edge cases during the process, including push-target clearing, stale refetch protection, migration-during-persist behavior, list-lag behavior, tombstone lifecycle, and repeated branch switches before clear persistence. Those issues were fixed and covered with focused regression tests.
Perf review checked the recent Windows/git subprocess risk areas: polling, subprocess fanout, store churn, worktree list refresh hot paths, persistence write fanout, SSH/runtime boundaries, and alias/tombstone memory bounds. No new background polling was added; the extra git status read is only from an explicit user Refresh click.
Final pre-PR code-review round: two independent reviewers returned
No issues found.The review explicitly checked macOS/Linux/Windows compatibility, SSH/runtime parity, provider compatibility, stale async guards, and persistence/state consistency.Post-PR CodeRabbit/check stabilization:
fa86135a6with a regression test.verifycheck passed.Security Audit
Reviewed risks:
settings,worktreeId,worktreePath, andconnectionIdboundaries preserved for local, SSH, and runtime environments.No follow-up security work is required.
Notes