Repository navigation
Re-Read a Failed Coverage Input Before pr_review.py Reports Unstated - #2746
Conversation
…stated One run of `status` read `coverage=unstated` on a head that the runs on either side of it read as `carried:table`. Two reads decide that reading and can fail transiently: the REST compare the change-set bound reads, and the payload's changed-file list. Each is now re-read on a short bounded schedule before the verdict, which is the "run status again" remedy exit 45 already names. A 404 compare is GitHub's answer and is not re-read. Fixes #2650 Co-Authored-By: Claude Opus 5.5 <[email protected]>
The local review found the new re-read loop a near-sibling of backoff and the new unread check a second copy of table_shortfall's file checks. All three re-reads (the compare, the full payload, and the review-request settle) now run through backoff on a finite schedule, and files_shortfall is the one predicate both the re-read and the table reading use. wait's final read goes through the same re-read, and each unread arm is tested. Co-Authored-By: Claude Opus 5.5 <[email protected]>
backoff's default schedule repeated its last delay with no clock when a caller passed neither a schedule nor a start, so it could loop forever. The repeat now runs only under a clock. full_read gains a test for the payload wait hands it, so dropping that re-read fails the suite. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
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 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #2746 +/- ##
===========================================
+ Coverage 59.83% 59.91% +0.08%
===========================================
Files 16 16
Lines 8368 8385 +17
===========================================
+ Hits 5007 5024 +17
Misses 3361 3361
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:
|
There was a problem hiding this comment.
🟡 Changes recommended
Add coverage for the handed-in final wait path and bound the regression test’s mock.
2 open findings
What changed in this PR
Improves coverage reporting by retrying transient GitHub compare and payload reads.
Changes:
- Adds bounded backoff retries for coverage inputs.
- Centralizes changed-file validation.
- Expands regression coverage for retries and backoff.
| File | Summary |
|---|---|
tests/test_pr_review.py |
Adds retry and backoff tests. |
scripts/pr_review.py |
Implements payload and compare re-reads. |
🧠 Review effort: Lite
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
A round landing during a held poll hands that poll's own payload to full_read, and that arm now has a test through main that fails when the call site skips a handed-in payload. The no-clock backoff test bounds its own sleeps, so a regression fails it rather than hanging the suite. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
A recorded local strict-review pass covers head |
## Summary This answers Copilot's finding on promotion [#2747](#2747). `files_unread`, added in [#2746](#2746), re-read the whole payload whenever a head round stated nothing and the changed-file list fell short, including cases where the table reading refuses before it reads that list: - no table on the head or on any earlier round - a partial round on record - a review history cut short - a carried table whose round names no commit Each of those cost up to two extra GraphQL reads and seven seconds of sleep for nothing. `files_unread` now takes the table the way `table_reading` does: the head's own table first, and otherwise the newest carried one where its round names a commit. It then asks `table_shortfall` whether the file list is the reason, so the two cannot disagree. ## Local-review finding The local strict review's two-round edit budget left one `introduced` prose finding: an over-long docstring sentence. Copilot raised the same one, and b468ec1 rewords the docstring. ## Test plan - `python3 tests/test_pr_review.py`: 715 tests pass. - New cases cover each no-use shape not re-reading, and a head table read again past a newer round naming no commit. Each was checked to fail against the predicate it replaces. - ruff format, ruff check, mypy, the prose gate, and the EOL gate are clean. Refs #2650 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
## Summary This promotes two changes from develop to main. - [#2746](#2746) makes `pr_review.py` re-read an input that failed transiently before it reports `coverage=unstated`. Two inputs decide that reading: the REST compare that bounds a carried statement, and the changed-file list the file table is matched against. Each is re-read on a short bounded schedule, and both `status` and `wait`'s final read go through it. Every re-read now runs through the one `backoff` loop, and one predicate decides when a changed-file list counts as unread. - [#2748](#2748) answers this pull request's review finding. The changed-file list is re-read only where a file table can use it, which is the order the table reading itself takes the table in. Closes #2650 🤖 Generated with [Claude Code](https://claude.com/claude-code)


Summary
pr_review.py statusonce readcoverage=unstatedon a head that the runs immediately before and after it read ascarried:table, with nothing changed but check states (#2650). Two network reads decide that reading and can fail transiently: the REST comparecarry_holdsbounds the carry on, and the payload's changed-file list the table is matched against. Which of the two failed that time is not recoverable, since that run's explanation line was cut from its output.The maintainer chose to re-read each input in-run instead of adding a new state or exit code:
changed_atre-reads a compare that did not happen on theREAD_RETRY_DELAYSschedule. An absenceanswered_absentrecognizes is GitHub's answer and is not re-read.full_readre-reads the whole payload whilefiles_unreadholds: a round covers the head and states nothing, and the changed-file list is absent, malformed, or empty. Bothstatusandwait's final read go through it, so the digest and the exit code still come from one payload.backoff, includingrequest_copilot_review's existing one-shot settle re-read. A finite schedule ends the loop, and the default schedule repeats its last delay only under a clock.files_shortfallis now the one changed-file predicate shared by the re-read andtable_shortfall's reason.A persistent failure still reports
unstatedand exits 45, as before.Local-review findings
The local strict review's two-round edit budget left two
introducedtest findings open. Copilot raised the same two on the first round, and a2a3b17 fixes both:wait's held-poll payload reachingfull_readis now exercised throughmain.backofftest now bounds its own sleeps, so a regression fails it instead of hanging.Test plan
python3 tests/test_pr_review.py: 713 tests pass.statusandwaitpayload re-reads, each unread arm, a handed-in payload, the held-poll path throughwait, and the bounded default schedule. Each re-read case was checked to fail with its re-read removed.Fixes #2650
🤖 Generated with Claude Code