Repository navigation
Name a Stale Job Record on a Completed Run in pr_review.py - #3662
Conversation
A job record can stay in progress after its workflow run has completed. status and wait read it as a check still running, so a driver waits on a record no run will update. The reader now marks a check run whose suite has completed while the job is in progress, and judges it STALE_RECORD. The digest line names the run and the two remedies, a re-run of that job or a new head. A required one on a BLOCKED merge takes exit 44, and it holds no poll, since waiting cannot end it. pr_review_checks.py was three lines under its ceiling, so the digest's check lines move into pr_review_check_lines.py first, beside a ceiling of their own.
A stale record in an older run now counts as finished for superseding, so a newer run of the same workflow on the head holds the poll rather than the wait exiting 44 on a record that run will replace.
A superseded stale record has no conclusion, so its line printed a dangling slash.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
|
A recorded local strict-review pass covers head |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #3662 +/- ##
===========================================
+ Coverage 81.60% 81.72% +0.11%
===========================================
Files 26 27 +1
Lines 9070 9126 +56
===========================================
+ Hits 7402 7458 +56
Misses 1668 1668
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.
🟢 Approval recommended
No active review issues are identified, with corresponding test coverage and documentation for stale-record handling and related output behavior.
No open issues 🎉
What changed in this PR
This pull request detects stale IN_PROGRESS job records after their workflow run completes, preventing indefinite polling and providing remediation guidance.
Changes:
- Adds
STALE_RECORDdetection, reporting, superseding behavior, and exit code44handling. - Extracts check-line rendering into
pr_review_check_lines.pywith updated import guards and size limits. - Expands tests for stale records, digest output, polling, and superseding runs.
- Includes minor documentation and wording fixes noted for follow-up.
| File | Summary |
|---|---|
tests/test_pr_review.py |
Adds coverage for stale records, output, exit behavior, polling, and superseding. |
tests/test_pr_review_size.py |
Adds the size ceiling for the new reader module. |
scripts/README.md |
Documents the new reader module and STALE_RECORD behavior. |
scripts/pr_review.py |
Updates stale-record help text and remediation guidance. |
scripts/pr_review_digest.py |
Imports check-line rendering from the new reader module. |
scripts/pr_review_checks.py |
Detects stale records, carries workflow run IDs, and handles superseding runs. |
scripts/pr_review_check_lines.py |
Renders diagnostic lines for check states, including stale records. |
This pull request is ready to be approved.
Review effort: Lite
…Session Prompt Rules (#3667) Promotes the changes merged into `develop` since promotion #3636 to `main`. - [#3640](#3640) Pins the validator's `uvx ruff` to a Dependabot-managed manifest. - [#3642](#3642) Counts Copilot findings under the unresolved bullet and the file table. - [#3644](#3644) Aligns the split comment copies and drops the stale counts. - [#3646](#3646) Sends a command meant for the session's input line in a plain message, never in a blocking prompt. - [#3648](#3648) Opens the attended session by cloning a hub checkout of the session's own. - [#3650](#3650) Reads a held package as installed in both Linux host scripts. - [#3652](#3652) States the PowerShell `-Help` and `-h` form in the command-line argument rules. - [#3654](#3654) Counts sentences in Markdown table cells for the sentence-length check. - [#3658](#3658) Splits a table row only at an unescaped pipe in the semicolon rule. - [#3660](#3660) Finds table cell boundaries before blanking code spans and quotations. - [#3662](#3662) Names a stale job record on a completed run in `pr_review.py`. - [#3665](#3665) Keeps a line holding code after a block comment's closer out of `comment-added`. Its squash commit on `develop` carries the pull request's original title, which names a heredoc reading. That reading was withdrawn before the merge on decision #3666, so a workflow `run:` heredoc body still reads as code. - [#3669](#3669) Counts each `[Pn]` marker in a Copilot Findings cell, so a second finding in one cell is no longer dropped from triage. It answers one of the two findings Copilot raised on this promotion. The other is declined with a parser probe in its thread. Closes #3616 Closes #3610 Closes #3622 Closes #3638 Closes #3604 Closes #3511 Closes #3602 Closes #3456 Closes #3655 Closes #3657 Closes #3362 Closes #1664 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Summary
A job record can stay
IN_PROGRESSafter its workflow run has completed.pr_review.py statusandwaitread it as a check still running, so a driver waits on a record no run will update. This change names that shape and says how to clear it.check_nodesmarks a check run that is stillIN_PROGRESSwhile its suite has completed asstale. It also carries the run's id on every check run.check_shapejudges a stale nodeSTALE_RECORDat any age. The digest printsCHECK RECORD STALEwith the run id and both remedies, a re-run of that job or a new head.BLOCKEDmerge takes exit44. It is not settling, so it holds no poll.44on a record that run will replace.Changes
scripts/pr_review_checks.pywas at 447 lines against its 450 ceiling. SoSTUCK_LINESandcheck_linesmove first into a new reader,scripts/pr_review_check_lines.py, which gets its own size ceiling and its own place in the reader import guards. Their inline comments move into docstrings.--helptext, theCHECKS_NOT_MERGEABLEline, andscripts/README.md.check()now gives a running job an in-progress suite unless a case names the suite's status, since a running job in a completed suite is the shape this change reads as stale.44exit, the poll that no longer holds, and the newer-run supersede. Each one fails with the reader change reverted.Verification
python -m unittest discover -s tests: 3128 tests OK (7 skipped), run before the two review-fix commits. After them, thetest_pr_review*suites pass (565 tests)./in the superseded line. Both were fixed, and round 3 found nothing.Closes on promotion: #3362
🤖 Generated with Claude Code