Skip to content

Keep merged PRs visible after refreshes - #6456

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

brennanb2025 merged 1 commit into
mainfrom
brennanb2025/fix-merged-pr-badges

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Jun 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Preserve a cached merged GitHub PR when a newer branch-hosted-review refresh returns no review, but only when the cached PR headSha still matches the worktree head.
  • Keep non-GitHub linked review metadata authoritative so GitLab, Bitbucket, Azure DevOps, and Gitea links do not accidentally surface a GitHub branch PR fallback.
  • Use the same guarded review selection in the worktree card and Checks tab so merged/done PRs keep their purple PR state after refreshes.

Design and Review

  • Design approach: recover merged PR state from existing branch PR cache only when the worktree commit proves the cache still describes the checked-out branch; otherwise keep the newer no-review result.
  • Design review: completed with no P0/P1 issues. The independent Codex reviewer leg could not run because CODEX_LB_API_KEY was unavailable, so the design-review subagent documented that limitation.
  • Implementation deviations: no product-direction deviations. A performance follow-up avoided scheduling disk cache saves for preserved no-op PR refreshes.

Verification

  • Completeness verification: initial pass found the Checks tab needed to block GitHub fallback for Bitbucket, Azure DevOps, and Gitea, not just GitLab; fixed and rechecked clean.
  • Performance audit: touched cache refresh and sidebar/checks render selection paths. The audit found a low-risk no-op cache-save issue; fixed by omitting unchanged prCache updates and only saving when the PR cache reference changes. Deterministic no-write tests cover direct and queued refresh paths.
  • Code review: two independent reviewers returned clean in the same round. Autonomy boundaries were not applicable because this diff does not add or edit agent-facing text.
  • Brennan test changes: final verdict was land after local blockers were fixed, then land. Electron validation used seeded cache/API state in a demo repo rather than a live GitHub PR.

Manual Evidence

  • Sidebar merged PR recovery: /tmp/orca-5690-sidebar-merged-pr.png
  • Checks tab recovered PR state: /tmp/orca-5690-checks-merged-pr.png
  • Also verified a linked GitLab MR suppresses the GitHub PR fallback in the visible app.

Checks Run

  • pnpm run typecheck
  • pnpm run lint (passed with an existing unrelated warning in useGitStatusPolling.ts)
  • git diff --check
  • pnpm vitest run --config config/vitest.config.ts src/renderer/src/store/slices/github.test.ts src/renderer/src/components/sidebar/WorktreeCard.pr-display.test.tsx src/renderer/src/components/sidebar/WorktreeCard.merged-pr-display.test.tsx src/renderer/src/components/right-sidebar/checks-panel-review.test.ts src/main/github/client.test.ts

Post-PR Stabilization

  • Waited 8 minutes after opening the PR before sweeping CodeRabbit and CI.
  • CodeRabbit reported no actionable comments. Its generic docstring coverage warning was not tied to an inline review finding or failing repository check.
  • PR checks are passing: verify and track-community-pr both succeeded.

Assumptions and Gaps

  • No SSH-specific behavior changes are expected; the fix uses stored worktree metadata and existing cache keys, including execution-host-aware hosted-review keys.
  • Cross-provider behavior is covered by tests for GitLab, Bitbucket, Azure DevOps, and Gitea guards.
  • Manual validation used seeded local state to avoid mutating or relying on a real GitHub PR.

@coderabbitai

coderabbitai Bot commented Jun 26, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Right sidebar review selection now uses a dedicated selector that prefers GitLab hosted reviews, suppresses GitHub PR cache when another provider-linked review is present, and otherwise converts GitHub PR data. WorktreeCard now shows a cached merged PR when its head SHA matches the current worktree head. GitHub PR cache handling now preserves matching merged PR entries during fallback misses and refresh events, and only saves the cache when the PR cache actually changes. Tests were added for the selection, display, and cache paths.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. 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 is concise and accurately captures the main change: keeping merged PRs visible after refreshes.
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.
Description check ✅ Passed The PR description covers the change, screenshots, testing, review, and follow-up notes, with only minor template section mismatches.
✨ 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.

@brennanb2025
brennanb2025 merged commit 8c81c30 into main Jun 27, 2026
2 checks passed
@brennanb2025
brennanb2025 deleted the brennanb2025/fix-merged-pr-badges branch June 27, 2026 00:15
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