Repository navigation
Sweep a Pruned Worktree Entry's Branch in the Same Run in pr_review.py - #3190
Conversation
`cleanup --sweep` read the branches held by worktrees before pruning the entries whose directory is gone, so a finished branch held only by a pruned entry was skipped until the next run. `prune` now returns the entries it removed, or under a report would remove, and those no longer hold their branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
A recorded local strict-review pass covers head |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
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.
🔵 Needs a closer look
Cleanup-state and dry-run behavior warrant final human review.
No open issues 🎉
What changed in this PR
Updates cleanup sweeping so branches from pruned worktree entries are evaluated in the same run.
Changes:
- Tracks pruned and report-prunable worktree entries.
- Preserves branch holds for recent or failed prunes.
- Adds regression coverage for apply, dry-run, recent, and failed-prune cases.
| File | Summary |
|---|---|
tests/test_pr_review.py |
Adds pruning and branch-sweep regression tests. |
scripts/pr_review.py |
Updates pruning and branch-hold tracking. |
Review effort: Lite
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #3190 +/- ##
========================================
Coverage 65.46% 65.46%
========================================
Files 17 17
Lines 9749 9750 +1
========================================
+ Hits 6382 6383 +1
Misses 3367 3367
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
- #3186 adds the local half of post-merge cleanup to `pr_review.py cleanup`. With `--checkout <base-clone>`, it removes the merged branch's worktrees and local branch after the remote delete and fast-forwards the base clone's `develop`. `cleanup --sweep` reports, and with `--apply` removes, the worktrees and branches an interrupted or abandoned session left behind. - #3188 points every skill that finishes a worktree at those commands, in place of the raw `git worktree remove`, `git branch -D`, and remote delete, which the host-safety allowlist does not cover. The skills are `repo-worktree`, `drive-pr`, `merge-and-release`, `backlog-burndown`, `pr-review-conduct`, `unattended-handoff`, `resync-a-repo`, and `audit-a-repo`. `git-commit-conventions`'s post-squash `-D` exception now admits a tip behind the verified head. - #3190 fixes a promotion-review finding. `cleanup --sweep` now judges a branch held only by a pruned worktree entry in the same run, rather than skipping it until the next. - #3191 fixes a second promotion-review finding. `unattended-handoff` step 7 no longer claims that no worktree outlives the lane, and it names a cleanup that could not run or that failed. Installed Skills change at release. Closes #3184 Closes #1682 Closes #1693 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Summary
This fixes a finding raised on promotion #3189.
cleanup --sweepread the branches held by worktrees before pruning the entries whose directory is gone. A finished branch held only by a pruned entry was therefore skipped by the loose-branch scan until the next run.CleanupSweep.prunenow returns the entries it pruned, or under a report the ones it would prune, and those entries no longer hold their branch. An entry kept as too recent, or still listed after a failed prune, keeps holding its branch.Tests
test_a_pruned_entry_s_branch_is_swept_in_the_same_runandtest_a_dry_run_reports_a_prunable_entry_s_branchboth failed before the fix.test_a_too_recent_prunable_entry_still_holds_its_branchfails whenhelddrops every prunable entry.python3 -m unittest tests.test_pr_reviewran 917+ tests, all OK.Local review
Three recorded
local-strict-reviewpasses ran at thefrontiertier. Both findings were test-coverage gaps, now closed. Nothing remains open.🤖 Generated with Claude Code