Skip to content

Promote the Coverage-Input Re-Read to Main - #2747

Merged
ptr727 merged 2 commits into
mainfrom
develop
Oct 10, 2026
Merged

ptr727 merged 2 commits into
mainfrom
develop

Conversation

@ptr727

@ptr727 ptr727 commented Oct 10, 2026 •

Copy link
Copy Markdown
Owner

Summary

This promotes two changes from develop to main.

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

…2746)

## 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](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings October 10, 2026 20:17
@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: 42d8fbea-9127-499e-8d5c-0e07073ba663

  • 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 96.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.94%. Comparing base (5147099) to head (3408f1d).
⚠️ Report is 359 commits behind head on main.

Files with missing lines Patch % Lines
scripts/pr_review.py 96.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2747      +/-   ##
==========================================
+ Coverage   59.83%   59.94%   +0.10%     
==========================================
  Files          16       16              
  Lines        8368     8390      +22     
==========================================
+ Hits         5007     5029      +22     
  Misses       3361     3361              
Flag Coverage Δ
python-3.13 59.94% <96.00%> (+0.10%) ⬆️

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

File-list retries can add avoidable delays and GraphQL requests when no file table can be used.

1 open finding
What changed in this PR

This promotes the coverage-input re-read from develop to main so pr_review.py is less likely to report coverage=unstated after a transient failed read.

Changes:

  • Re-read failed compare results and unread changed-file lists on a bounded schedule.
  • Route status and wait through the shared read path, with regression tests.
File Description
scripts/​pr_review.py Adds bounded re-reads and a shared changed-file predicate.
tests/​test_pr_review.py Tests retry behavior across status, wait, and compare reads.

🧠 Review effort: Lite


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread scripts/pr_review.py Resolved
## 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]>

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.

🟢 Approval recommended

The retry paths have targeted tests, and the remaining performance concern is bounded and uncommon.

0 open findings

1 resolved since last review

🧠 Review effort: Lite

@ptr727
ptr727 merged commit 59e0ec0 into main Oct 10, 2026
14 checks passed
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.

pr_review.py status Reported coverage=unstated Once on an Unchanged Head Between Two carried:table Reads

2 participants