Repository navigation
Re-Read a Deleted Ref Before Reporting DELETE_NOT_CONFIRMED - #3480
Conversation
The ref read can lag a delete that landed, so cleanup reads a ref still present again on a short schedule through the existing backoff helper before reporting it. Exit 2 still follows once the schedule is spent. Closes #3436 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A ref back at a new tip means the branch was pushed again, so the loop stops there and says so rather than reporting the delete as unlanded. A test now drives a settle read that does not answer, and the README sentence is split under the length limit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A delete that reported a failure can also read back at another tip, so the message says only that something pushed to the branch. The docstring now names the deleted tip as what is re-read. 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.
|
There was a problem hiding this comment.
🟢 Approval recommended
The reviewed changes have no unresolved blocking issues and include focused test coverage and documentation.
No open issues 🎉
What changed in this PR
This pull request improves remote branch deletion confirmation by retrying ref reads when GitHub’s response may lag after a successful deletion.
Changes:
- Adds bounded confirmation retries using the existing backoff helper.
- Distinguishes deleted refs, unreadable reads, and refs moved to a new tip.
- Adds focused tests and documents the retry behavior.
| File | Description |
|---|---|
tests/test_pr_cleanup.py |
Tests delayed deletion visibility, exhausted retries, unreadable reads, and changed tips. |
scripts/README.md |
Documents eventual-consistency handling during remote deletion. |
scripts/pr_cleanup.py |
Implements bounded ref-confirmation retries and new-tip reporting. |
Review effort: Lite
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #3480 +/- ##
==========================================
Coverage ? 81.00%
==========================================
Files ? 25
Lines ? 8902
Branches ? 0
==========================================
Hits ? 7211
Misses ? 1691
Partials ? 0
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:
|
## Summary Promotes the pull requests merged into develop since release 2.0.1181. - [#3479](#3479): `status=COVERAGE_IS_PARTIAL` no longer says the head's own review read fewer files on the carry paths. It leads with the carried reason there and names the remedy that clears it. - [#3480](#3480): `cleanup` re-reads a ref still at the deleted tip for a few seconds before it reports `DELETE_NOT_CONFIRMED`, since the ref read can lag a delete that landed. - [#3481](#3481): `pr_review.py cleanup` loads one copy of the gate rather than a second one under the name `pr_review`. Closes #3424 Closes #3436 Closes #3461 ## Constituent coverage Each change this promotion carries had coverage on its own pull request into develop, at its merged head: | Pull request | Merged head | Coverage | | --- | --- | --- | | [#3479](#3479) | `81ca8d88` | attested local pass at the merged head, base `develop`, and a Copilot table on the merged head naming exactly its 3 changed files, no open findings | | [#3480](#3480) | `2c71411c` | attested local pass at the merged head, base `develop`, and a Copilot table on the merged head naming exactly its 3 changed files, no open findings | | [#3481](#3481) | `1747bd78` | attested local pass at the merged head, base `develop`, and a Copilot table on the merged head naming exactly its 2 changed files, no open findings | 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Summary
Answers #3436.
cleanup_remote_deleteread the ref back once, right afterdeleteRef. GitHub's ref read can lag a delete that landed, so a landed delete could printstatus=DELETE_NOT_CONFIRMEDand exit 2 before the local half ran.DELETE_SETTLE_DELAYS = (1, 2, 4)through the existingcore.backoffhelper, so about seven seconds at most, before it is reported. Exit 2 still follows once that schedule is spent.scripts/README.md'scleanupparagraph says so.DELETEDand exit 0. A ref present on every read exits 2 after exactly the scheduled reads. A settle read that does not answer exits 2. A new tip stops the loop and names that tip. The first two fail against the unfixed source. The existing suite patches the schedule to(), which reproduces the old single read.Known limits, not defects
still reads at <tip> after the delete, exit 2, which is the conservative outcome.scripts/handoff.pyreads state back once after a write increate_label,close, andedit_issue. No lag has been seen on label or issue reads, so these are the sites to name in one issue only if it is.Verification
uv run --no-project --with-requirements tests/requirements.txt python -m unittest discover -s tests, 2952 tests run, OK (7 skipped), at 278e49a. The commit after it changes message wording and a test name, andtest_pr_*.py(628 tests) passes on it.introducedfindings (a README sentence over the length limit, no test for a settle read that does not answer, and the loop re-reading a ref at a new tip), all fixed in 278e49a. Round 2 raised three (an overclaiming message, a stale docstring, a long line), fixed in 2c71411. The third pass raised none.Pre-existing findings, not filed
scripts/README.md:264,pre-existing: five sentences this change did not edit run over the 25-word sentence-length check.🤖 Generated with Claude Code