Skip to content

Read a Superseded Run's Failed Aggregator as Superseded in pr_review.py wait - #3256

Merged
ptr727 merged 7 commits into
developfrom
feature/auto-3254
Oct 20, 2026
Merged

ptr727 merged 7 commits into
developfrom
feature/auto-3254

Conversation

@ptr727

@ptr727 ptr727 commented Oct 20, 2026 •

Copy link
Copy Markdown
Owner

Summary

scripts/pr_review.py wait read a failed check from a superseded workflow run as a verdict on the head and exited 44. The usual cause is a closed and reopened pull request. GitHub cancels the first run, whose aggregator then fails over the cancelled jobs, while the reopen's run on the same head is still going and has not yet posted its own aggregator.

  • The rollup query now reads each check suite's status and its workflow run's databaseId.
  • check_nodes marks a check superseded when its name appears only in an older suite of a workflow whose newest suite has not completed. It records the newest run's id as newer_run.
  • check_shape reads a superseded check as not stuck. It no longer takes exit 44, and a held wait still polls on it as settling.
  • The digest prints CHECK SUPERSEDED for a superseded check that did not pass, naming the newer run.
  • Once the newer run completes, a check name it never posted stands as the merge gate reads it.

Tests build the case from the issue: the first run's failed aggregator, plus a second run of the same workflow still in progress. Reverting the fix brings exit 44 back and the wait test fails. A held-wait case and a case for a passed superseded check pin the other paths.

Local review findings

The local pass's edit budget ran out on the first push. These two findings were listed then and are now fixed:

  • introduced, fixed in d1f3038: the newer run was found only through check runs it had already posted, so a read could still return 44 while the newer run waited on a concurrency slot. The head commit's own checkSuites now count too.
  • introduced, fixed in d1f3038, wording again in 5410b07: the exit-44 help sentence could be read as the older run being the one still running.

Later passes also had the change supersede only a finished check, state the exception in scripts/README.md, and drop a dead clause.

Listed open after 255964b, when that push's edit budget was spent, and now fixed:

  • introduced, fixed in c96856a: test_a_superseded_check_that_passed_prints_no_superseded_line never asserted that the green check was marked superseded. If the marking had stopped firing for that shape, the test would still have passed. The pass over c96856a found nothing.

Closes on promotion: #3254

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Pull request checks now recognize when an older workflow run has been superseded by a newer unfinished run.
    • Failures from superseded runs are reported for visibility but do not block merging.
    • Newly queued workflow runs are recognized even before checks appear.
  • Bug Fixes

    • Completed failures remain blocking when no newer run is active.
    • Unfinished checks from older runs continue to be handled correctly.
    • Exit status 44 is now limited to required checks that are stuck while merging is blocked.
  • Documentation

    • Clarified how superseded checks and blocked merge outcomes are reported.

ptr727 and others added 3 commits October 19, 2026 20:31
…py wait

A closed and reopened pull request cancels its first workflow run, whose
aggregator then fails over the cancelled jobs, while the reopen's run on the
same head is still going and has not posted its own aggregator yet. `wait`
read that failure as a verdict and exited 44.

The rollup query now reads each suite's status and run id. A name only an
older suite of a workflow carries is marked superseded while that workflow's
newest suite has not completed, so it is not a stuck check, a held wait polls
on it, and the digest names the newer run. Once the newer run completes, a
name it never posted stands as the merge gate reads it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…guard

The suite's status is a non-null field the query always selects, so the guard
against it being absent protected only test fixtures. The fixture now carries
a completed status by default. A held wait on a blocked merge is pinned to
poll on a superseded gate until the newer run posts its own.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…back

A check only reaches a workflow origin when its workflow run was read, and a
read run always carries its id, so the fallback wording protected nothing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings October 20, 2026 03:52
@ptr727

ptr727 commented Oct 20, 2026

Copy link
Copy Markdown
Owner Author

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

@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: ptr727/ProjectTemplate/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e791ca7f-84f2-4885-8250-c5ef5344ff6f
📥 Commits

Reviewing files that changed from the base of the PR and between 8577f22 and c96856a.

📒 Files selected for processing: 3
  • scripts/README.md
  • scripts/pr_review.py
  • tests/test_pr_review.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

The review script now identifies newer workflow runs on the same head commit. It reports completed checks from older runs as superseded while the newer run is unfinished, and excludes them from failure and stall classification.

Changes: Workflow Check Supersession

Layer / File(s) Summary
Identify newer workflow runs
scripts/pr_review.py, tests/test_pr_review.py
The query retrieves check-suite and workflow-run metadata. Check normalization uses head-commit suites to identify the newest run for each workflow. Tests cover active and queued runs, completed runs, and workflow isolation.
Handle and report superseded checks
scripts/pr_review.py, scripts/README.md, tests/test_pr_review.py
Checks from older runs are marked superseded while a newer run is unfinished. They do not block failure or stall classification. The digest identifies the newer run. Documentation and CLI tests cover the status and exit behavior.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to c9685

This change makes the PR review wait command treat a failed check from an older workflow run as superseded while a newer run is still active. No concrete merge-blocking risk was identified, and the change is mergeable.

Pre-merge checks: Passed 4 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Docstring Coverage Inconclusive Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 1 files. (2 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly describes the main change: treating a failed aggregator from a superseded workflow run as superseded in pr_review.py wait. It is specific and related to the changeset, although sligh…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title clearly describes the main change: treating a failed aggregator from a superseded workflow run as superseded in pr_review.py wait. It is specific and related to the changeset, although slightly awkward in wording.

Full details: Docstring Coverage

Explanation

Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 1 files. (2 skipped: 1 unsupported, 1 too large.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • 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.

A run waiting on its concurrency slot has a check suite and no check run, so
the rollup alone missed it and a read in that gap still exited 44. The head
commit's own suites now count toward each workflow's newest one. The exit-44
help sentence now says it is the newer run that has not finished.

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.

🟡 Changes recommended

A queued replacement run may be missed, and the exit-44 help text remains ambiguous.

2 open issues
What changed in this PR

Updates pr_review.py wait to ignore failed checks from superseded workflow runs while newer runs remain active.

Changes:

  • Tracks workflow suite status and run IDs.
  • Suppresses superseded failures from exit 44.
  • Adds regression coverage for superseded and completed runs.
File Summary
tests/​test_pr_review.py Adds tests for superseded workflow behavior.
scripts/​pr_review.py Implements superseded-run detection and reporting.

Review effort: Lite

Comment thread scripts/pr_review.py Resolved
Comment thread scripts/pr_review.py Resolved
@codecov

codecov Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (develop@8577f22). Learn more about missing BASE report.

Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #3256   +/-   ##
==========================================
  Coverage           ?   65.56%           
==========================================
  Files              ?       17           
  Lines              ?     9946           
  Branches           ?        0           
==========================================
  Hits               ?     6521           
  Misses             ?     3425           
  Partials           ?        0           
Flag Coverage Δ
python-3.13 65.56% <100.00%> (?)

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.

ptr727 and others added 2 commits October 19, 2026 20:59
An older run still going behind a queued newer one keeps its own stuck
reading, since the newer run cannot start until it finishes. The digest now
says the newer run has not finished rather than that it is in progress, and
the help sentence is split and rewrapped.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…odes

The README's exit-44 and held-poll paragraphs now name a superseded check as
the exception. The dead stale clause in the superseded test is gone, and the
check_nodes docstring is rewrapped.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ptr727

ptr727 commented Oct 20, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 255964be9aa9f85c5b9d6be86d02b10b29fa1310, the content this pull request carries at that commit against develop, and it recorded 1 finding.

@ptr727

ptr727 commented Oct 20, 2026

Copy link
Copy Markdown
Owner Author

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

@ptr727

ptr727 commented Oct 20, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@ptr727

ptr727 commented Oct 20, 2026

Copy link
Copy Markdown
Owner Author

CodeRabbit's pre-merge check "Docstring Coverage" read inconclusive at 75% across 4 touched functions. No change needed: the undocumented function is note_run, a closure nested inside check_nodes, and the docstring of check_nodes states what it reads and why. Every other function this diff touches already has a docstring. CodeRabbit raised no actionable comment on this head.

@ptr727
ptr727 merged commit 040152e into develop Oct 20, 2026
13 checks passed
@ptr727
ptr727 deleted the feature/auto-3254 branch October 20, 2026 04:43
ptr727 added a commit that referenced this pull request Oct 20, 2026
…and File-Naming Check to Main (#3266)

## Summary

Promotes eight pull requests from develop. Three are `pr_review.py`
reader fixes from this round, one answers this promotion's first review,
and four are from other sessions.

- #3261: each heading, thematic-break, and fence shape in `pr_review.py`
has one primitive that every reader composes from. A no-break space
after a heading's hashes no longer opens a heading, and a tab-spaced
thematic break or setext underline closes its block.
- #3262: when `wait` returns `50` at once on an uncounted-verdict head
while a check has not concluded, it names a bounded `gh pr checks
--watch` to watch the checks with.
- #3264: `CODE_SPAN` reads code spans, raw inline HTML, and autolinks
left to right, as GitHub binds them, so a backtick inside an earlier
HTML comment, tag, or autolink opens no span. A line of only blockquote
markers now ends a paragraph.
- #3256: `pr_review.py wait` reads a superseded run's failed aggregator
as superseded rather than as a verdict on the head.
- #3258: a `driftNote` can exempt a tool-fixed script name from the
file-naming check.
- #3253: an audit check for file naming, including secret-file stem
casing.
- #3249: the Linux quick start names the no-sudo Debian case.
- #3267: splits the over-long and two-instruction sentences that this
promotion's first Copilot round found in #3249's paragraph.

Closes #3241
Closes #3246
Closes #3235
Closes #3252
Closes #3254
Closes #3141
Closes #2551

🤖 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