Skip to content

fix(cmux): cover merged/closed PR tracking and update stale-stage caption - #419

Merged
ClipboardJason merged 1 commit into
mainfrom
jason-fix-pr-stage-coverage
Oct 8, 2026
Merged

ClipboardJason merged 1 commit into
mainfrom
jason-fix-pr-stage-coverage

Conversation

@ClipboardJason

Copy link
Copy Markdown
Contributor

Summary

  • Main is red after feat(cmux): sync PR review stage into the orchestrator watch loop #409 merged: the coverage gate reports prStageSync.ts at 90.47% functions (lines 164-165). vitest 5.0.3 (chore(deps): update vitest monorepo to v5.0.3 #418, merged just before) counts the ?? fallback callbacks in selectTrackedPullRequest as separate functions, and no test reached the merged or closed branches. Adds table cases for a merged PR preferred over a closed one, and a closed-only PR.
  • The cmux sidebar's stale-stage caption still named the retired standalone poller. It now reads "PR stages stale — is crew run --watch running?" (sidebar, its tests, and README).

Verification

  • node --run verify passes locally on node 24.14.1, coverage back to 100%.
  • Swapping the merged/closed preference in selectTrackedPullRequest fails the new merged-over-closed case.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QDPWP8wH2WJjTPgZzibVG2

…tion

Main's coverage gate failed after vitest 5.0.3 started counting the
`??` fallbacks in selectTrackedPullRequest as separate functions, which
no test reached. Add cases for a merged PR preferred over a closed one
and a closed-only PR.

The sidebar's stale caption still named the retired standalone poller;
point it at `crew run --watch`, which now owns the sync.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QDPWP8wH2WJjTPgZzibVG2
@ClipboardJason ClipboardJason self-assigned this Oct 8, 2026
@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 75648f55-9bf1-4e67-9ca2-43be0b207153
📥 Commits

Reviewing files that changed from the base of the PR and between 6bfa9be and 6bfa9be.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: a7f96633-4f5f-4cd4-b7fa-c46bb19cda7d
📥 Commits

Reviewing files that changed from the base of the PR and between 69f6880 and 6bfa9be.

📒 Files selected for processing (4)
  • contrib/cmux/README.md
  • contrib/cmux/groundcrew.swift
  • contrib/cmux/tests/GroundcrewSidebarStageTests.swift
  • src/commands/prStageSync.test.ts
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

Included review availability: This review used your included allowance. 1 included review remains after this review. Your included PR review attempts over the past 7 days set your current allowance at 3 reviews per hour.


📝 Walkthrough

Walkthrough

The stale-stage warning and documentation now refer to crew run --watch. New tests cover pull-request selection when no open pull request exists.

Changes

Stale-stage command reference

Layer / File(s) Summary
Update stale-stage command reference
contrib/cmux/groundcrew.swift, contrib/cmux/README.md, contrib/cmux/tests/GroundcrewSidebarStageTests.swift
The warning, documentation, and caption test expectations now use crew run --watch instead of crew-pr-stages.

Pull-request selection tests

Layer / File(s) Summary
Test closed and merged pull-request selection
src/commands/prStageSync.test.ts
Added cases verify that a merged candidate is selected over a closed candidate, and that a sole closed candidate is selected for detail fetching.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 6bfa9

The updated warning and documentation point to the watcher that refreshes PR stages, and the added tests cover the stated pull-request selection cases. No merge-blocking risk is identified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 3 files. (1 skipped: 1… 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 summarizes both main changes: PR tracking coverage and the cmux stale-stage caption update.
Description check ✅ Passed The description directly explains the added merged and closed pull-request tests and the cmux caption update. It also includes verification details.
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 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 3 files. (1 skipped: 1 unsupported.)

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

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

@ClipboardJason
ClipboardJason merged commit 192d616 into main Oct 8, 2026
5 checks passed
@ClipboardJason
ClipboardJason deleted the jason-fix-pr-stage-coverage branch October 8, 2026 14:32
ClipboardJason added a commit that referenced this pull request Oct 8, 2026
…420)

Stacked on #419 (main's coverage gate is red until it merges).

## Summary

- Sidebar rows showed only `w.pr`, the first PR cmux reports for the
workspace, so a task whose agent opened several PRs hid the rest. The
second row line is now a vertical list: the ticket pill, then one `PR #N
· status` line per entry in `w.prs`.
- Sidebar test fixtures now set `prs` alongside `pr`, matching what cmux
projects. New `listsEveryPullRequestOnItsOwnLineUnderTheTicket` case.
- README layout description updated.

## Verification

- 50 sidebar tests pass against a cmux checkout; the new case failed
before the change.
- Render benchmark: 282.1ms vs main's 281.7ms (DEBUG median).
- `node --run verify` passes on top of #419.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01QDPWP8wH2WJjTPgZzibVG2

Co-authored-by: Test <test@example.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants