Skip to content

Refuse a Branch Delete Another Open Pull Request Uses and Drop the Hand-Form Delete - #2988

Merged
ptr727 merged 3 commits into
developfrom
feature/pr-review-cleanup-followups
Oct 14, 2026
Merged

ptr727 merged 3 commits into
developfrom
feature/pr-review-cleanup-followups

Conversation

@ptr727

@ptr727 ptr727 commented Oct 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • pr_review.py cleanup reads the open pull requests in the repository whose head or base is the branch, and refuses with exit 1 naming them. A fork's pull request on a same-named branch is not counted.
  • drive-pr step 4 and merge-and-release step 8 drop the hand-typed git push origin --delete fallback. Where cleanup cannot run, the skill reports the delete to the maintainer, so cleanup is the one place holding the checks.
  • CleanupCase keeps the redirected stderr, and the failed rules read test asserts the stub's HTTP 404 text and the rc=1 in the status=UNREAD line.

Verification

The new refusal tests and the diagnostic assertions each fail with their code reverted. The full tests.test_pr_review suite, ruff, mypy, prose lint, build_dist.py --check, spec/validate.py, and docker_lint.py pass.

The local review's eight findings were fixed in the second commit. That commit was not given a second review pass.

scripts/README.md and .agents/skills/backlog-burndown/SKILL.md still describe the old hand form and are outside this change's files, filed as #2987.

Fixes #2969
Fixes #2971
Fixes #2983

🤖 Generated with Claude Code

ptr727 and others added 2 commits October 14, 2026 07:28
…nd-Form Delete

The cleanup subcommand reads open pull requests headed or based on the branch and refuses naming them. The drive-pr and merge-and-release skills drop the direct delete and report it to the maintainer where cleanup cannot run, so cleanup holds every check. A test now asserts the failed rules read prints its stderr and exit code.

Fixes #2969
Fixes #2971
Fixes #2983

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… Read

Filter the open pull request read to heads in this repository, document the refusal in the cleanup usage, remove the drive-pr references to the deleted hand form, and test the unanswered, overflow, and fork cases.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings October 14, 2026 14:31
@ptr727

ptr727 commented Oct 14, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 4d7b7daead09cdcca1dcbd117db14ff1167a36b8, the content this pull request carries at that commit against develop, and it recorded 8 findings.

@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Repository: ptr727/ProjectTemplate/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 16730ce8-b973-478f-81c5-37d818d3a77d
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Copilot AI 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.

🟡 Changes recommended

Three unresolved review findings remain.

2 open findings
What changed in this PR

This PR centralizes branch-deletion safety in pr_review.py cleanup and removes manual deletion fallbacks.

Changes:

  • Checks open pull requests using the branch as head or base.
  • Adds refusal and diagnostic tests.
  • Updates canonical/generated skills and source digests.

Review findings:

  • scripts/pr_review.py:5916 — P1 / moderate, 4 votes: count only same-repository head pull requests.
  • .agents/skills/drive-pr/SKILL.md:101 — P2 / moderate, 2 votes: remove the unused pre-merge tip read.
  • .agents/skills/drive-pr/SKILL.md:123 — P2 / nit, 1 vote: split the sentence to meet the 25-word prose limit.
File Description
tests/​test_pr_review.py Adds cleanup refusal and diagnostic coverage.
scripts/​pr_review.py Checks open pull requests before deletion.
.github/​skills/​merge-and-release/​SKILL.md Updates generated merge-and-release skill.
.github/​skills/​drive-pr/​SKILL.md Updates generated drive-pr skill.
.claude-plugin/​fleet-skills/​skills/​merge-and-release/​SKILL.md Updates generated plugin skill.
.claude-plugin/​fleet-skills/​skills/​drive-pr/​SKILL.md Updates generated plugin skill.
.claude-plugin/​fleet-skills/​.source-digests/​merge-and-release Refreshes source digest.
.claude-plugin/​fleet-skills/​.source-digests/​drive-pr Refreshes source digest.
.agents/​skills/​merge-and-release/​SKILL.md Removes manual deletion guidance.
.agents/​skills/​drive-pr/​SKILL.md Removes manual deletion guidance.

🧠 Review effort: Lite


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .agents/skills/drive-pr/SKILL.md Resolved
Comment thread scripts/pr_review.py Resolved
@codecov

codecov Bot commented Oct 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.83333% with 1 line in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (develop@3833ab8). Learn more about missing BASE report.

Files with missing lines Patch % Lines
scripts/pr_review.py 95.83% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #2988   +/-   ##
==========================================
  Coverage           ?   60.92%           
==========================================
  Files              ?       17           
  Lines              ?     8996           
  Branches           ?        0           
==========================================
  Hits               ?     5481           
  Misses             ?     3515           
  Partials           ?        0           
Flag Coverage Δ
python-3.13 60.92% <95.83%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ptr727

ptr727 commented Oct 14, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 179f3e1c8bd89a6a63045cf71c2c43bbaf3e7655, the content this pull request carries at that commit against develop, and it recorded 0 findings.

@ptr727
ptr727 merged commit 4ae7240 into develop Oct 14, 2026
13 checks passed
@ptr727
ptr727 deleted the feature/pr-review-cleanup-followups branch October 14, 2026 14:47
ptr727 added a commit that referenced this pull request Oct 14, 2026
…and Write-Guard Split Directory and Substitution Denies to Main (#3002)

- #2986 makes `pr_review.py` count a Copilot finding named only in the
overview file table, or only in a headline total larger than the open
sections list, under `FINDINGS WITH NO THREAD`, so the gate reads a
finding the round opened no thread or open-findings entry for
- #2988 makes `pr_review.py cleanup` refuse a branch delete where
another open pull request in the repository uses the branch as its head
or base, naming them, and drops the hand-typed `git push origin
--delete` fallback from `drive-pr` step 4 and `merge-and-release` step
8, so a seat that cannot run `cleanup` reports the delete to the
maintainer. The failed-rules-read test now asserts the stub's stderr
text and exit code
- #2992 names `pr_review.py cleanup` as the branch delete in
`backlog-burndown` and in `scripts/README.md`, with any nonzero exit, or
a seat that cannot run it, reported to the maintainer
- #2994 makes `gh-write-guard` deny an unquoted `-C`, `--git-dir`, or
`--work-tree` value that word splitting may split, on every git
subcommand, naming quoting the variable as the fix, deny a command word
holding a `$` or a backtick where its subcommand is `push` or `commit`,
and read the body of a double-quoted `$(...)` or backtick substitution,
and of an unquoted backtick substitution, as a command, so a git push or
commit hidden there reaches every check. A heredoc body inside such a
substitution stays data
- #3001 describes those readings in the two agent-safety READMEs

After this merges, the host-safety installer payload changes, so the
maintainer runs the installer after promotion.

Closes #2982
Closes #2969
Closes #2971
Closes #2983
Closes #2987
Closes #2976
Closes #2977
Closes #2990

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


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* Branch cleanup now checks that the branch still matches the pull
request and is not used by another open pull request before deletion. If
checks fail or cleanup cannot run, maintainers are asked to handle it;
remotely pushed abandoned branches are not deleted automatically.
* Review summaries now account for findings in file-table annotations
and headlines, reducing the chance that unthreaded findings go
uncounted.

* **Safety**
* Command safeguards now inspect command substitutions and reject
ambiguous directory values and command forms that could conceal Git
operations.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
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.

2 participants