Skip to content

Re-Read a Failed Coverage Input Before pr_review.py Reports Unstated - #2746

Merged
ptr727 merged 4 commits into
developfrom
feature/pr-review-coverage-flicker
Oct 10, 2026
Merged

ptr727 merged 4 commits into
developfrom
feature/pr-review-coverage-flicker

Conversation

@ptr727

@ptr727 ptr727 commented Oct 10, 2026 •

Copy link
Copy Markdown
Owner

Summary

pr_review.py status once read coverage=unstated on a head that the runs immediately before and after it read as carried:table, with nothing changed but check states (#2650). Two network reads decide that reading and can fail transiently: the REST compare carry_holds bounds 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_at re-reads a compare that did not happen on the READ_RETRY_DELAYS schedule. An absence answered_absent recognizes is GitHub's answer and is not re-read.
  • full_read re-reads the whole payload while files_unread holds: a round covers the head and states nothing, and the changed-file list is absent, malformed, or empty. Both status and wait's final read go through it, so the digest and the exit code still come from one payload.
  • Every re-read now runs through backoff, including request_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_shortfall is now the one changed-file predicate shared by the re-read and table_shortfall's reason.

A persistent failure still reports unstated and exits 45, as before.

Local-review findings

The local strict review's two-round edit budget left two introduced test findings open. Copilot raised the same two on the first round, and a2a3b17 fixes both:

  • wait's held-poll payload reaching full_read is now exercised through main.
  • The no-clock backoff test now bounds its own sleeps, so a regression fails it instead of hanging.

Test plan

  • python3 tests/test_pr_review.py: 713 tests pass.
  • New cases cover the compare re-read, the 404 exemption, the status and wait payload re-reads, each unread arm, a handed-in payload, the held-poll path through wait, and the bounded default schedule. Each re-read case was checked to fail with its re-read removed.
  • ruff format, ruff check, mypy, the prose gate, and the EOL gate are clean.

Fixes #2650

🤖 Generated with Claude Code

ptr727 and others added 3 commits October 10, 2026 12:48
…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]>
Copilot AI lite review requested due to automatic review settings October 10, 2026 20:03
@coderabbitai

coderabbitai Bot commented Oct 10, 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: 3a19450f-c4de-450b-bb5d-e5a076286b1f

  • 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.

@codecov

codecov Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.55556% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.91%. Comparing base (5147099) to head (a2a3b17).

Files with missing lines Patch % Lines
scripts/pr_review.py 95.55% 2 Missing ⚠️
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              
Flag Coverage Δ
python-3.13 59.91% <95.55%> (+0.08%) ⬆️

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.

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

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.

Comment thread tests/test_pr_review.py Resolved
Comment thread scripts/pr_review.py Resolved
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]>
@ptr727

ptr727 commented Oct 10, 2026

Copy link
Copy Markdown
Owner Author

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

@ptr727
ptr727 merged commit 413bcbc into develop Oct 10, 2026
13 checks passed
@ptr727
ptr727 deleted the feature/pr-review-coverage-flicker branch October 10, 2026 20:17
ptr727 added a commit that referenced this pull request Oct 10, 2026
## 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]>
ptr727 added a commit that referenced this pull request Oct 10, 2026
## 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)
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