Repository navigation
Read a Null GraphQL Node as Unread and Name a Closed Pull Request's State in pr_review.py - #3689
Conversation
…review.py A null entry in a GraphQL `nodes` list crashed `wait` in `reviewer_nodes`. The transport now drops each one and counts it on its connection, which then reads blind the way a cut window does. The digest names it in `null_nodes=`. `status` and `wait` now lead the digest with `state=`, `merged_at=`, `merge_commit=`, or `closed_at=` on a pull request no longer open. `wait` neither requests nor polls one and exits as `status` does. merge-and-release step 2 reads `state=MERGED` as already merged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A dropped null left the threads, checks, and request-state readings deciding exit codes off a list that read short, so a null standing for an open thread exited 0. A query holding a null node is now read again on the re-read schedule, and one still holding it ends the run naming where it sat. A mutation is never sent twice. The Copilot poll also ends once the pull request is no longer open, and the final read routes it to the `status` reading. merge-and-release keeps its ready-report comparison on a promotion merged before step 2 ran. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…erged Promotion The transport's null re-read now uses the existing `backoff` schedule rather than a loop of its own. The digest's open-state test reads `state` the way every other site does, and a check the non-open return made dead is dropped. merge-and-release now stops and reports on a promotion merged since step 1 rather than going on to dispatch a release someone may already have run. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
A recorded local strict-review pass covers head |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
There was a problem hiding this comment.
🟡 Changes recommended
Active issues remain: cleanup can be skipped after a concurrent merge, merged payloads may trigger redundant file reads, and the first-read early-return test does not distinguish the intended control flow.
3 open issues
What changed in this PR
This PR hardens pr_review.py against unresolved GraphQL nodes and makes merged or closed pull request states explicit in status and wait output. It also updates merge-and-release guidance and adds focused tests.
Changes:
- Retries GraphQL reads containing null nodes and reports persistent unread responses without retrying mutations.
- Adds non-open pull request state, timestamps, and merge commit details to digests.
- Stops
waitfrom requesting reviews or polling closed and merged pull requests. - Updates merge-and-release skill distributions and adds coverage for null nodes and non-open states.
- Review follow-ups remain: run cleanup after an already-merged promotion (
.agents/skills/merge-and-release/SKILL.md, nit, 4 votes); reuse the supplied full payload instead of repeatingfull_read(scripts/pr_review.py, moderate, 4 votes); and strengthen first-read early-return coverage (scripts/pr_review.py, nit, 1 vote;tests/test_pr_review.py, nit, 3 votes).
| File | Description |
|---|---|
tests/test_pr_review.py |
Adds tests for null GraphQL nodes and merged or closed pull request behavior. |
scripts/pr_review.py |
Adds null-node transport handling, state-aware status and wait behavior, and shared status execution. |
scripts/pr_review_rounds.py |
Adds recursive detection and location reporting for null GraphQL nodes. |
scripts/pr_review_digest.py |
Adds merged and closed pull request state fields to digests. |
.github/skills/merge-and-release/SKILL.md |
Updates the generated merge-and-release skill distribution. |
.claude-plugin/fleet-skills/skills/merge-and-release/SKILL.md |
Updates the generated Claude skill distribution. |
.claude-plugin/fleet-skills/.source-digests/merge-and-release |
Updates the generated skill source digest. |
.agents/skills/merge-and-release/SKILL.md |
Updates the canonical merge-and-release procedure for merged and closed promotions. |
Review effort: Lite
… After a Merged Promotion `run_status` now renders a payload it is handed rather than reading it again. A new case drives `wait --ignore-quota-signal` over a head refusal on a merged pull request, which only the first-read return keeps from requesting a review. merge-and-release's stop on a promotion already merged goes on to step 8's cleanup. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #3689 +/- ##
===========================================
+ Coverage 81.74% 81.91% +0.16%
===========================================
Files 27 27
Lines 9139 9224 +85
===========================================
+ Hits 7471 7556 +85
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:
|
The stop on a promotion already merged now goes through step 7, which gates itself on scope, before step 8, and step 8's lead names that way in. The first-read test's mock returns a request result, so a regression fails on its own assertion. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ge Stop Step 8 removes the promotion worktree wherever one exists, not only where this session made it, and step 2's merged stop reaches step 7 only where a release scope was chosen. The mid-poll test now lands no review, so only the merged state ends its poll, and it is bounded by --timeout. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
A recorded local strict-review pass covers head |
|
On the resolved thread Use the supplied full payload (P2) at |
`pr_review_rounds.is_open` replaces the inline `state` test at every site in the gate and the digest, so they cannot disagree on a payload naming no state. Co-Authored-By: Claude Opus 5.5 <[email protected]>
`await_registered_head` was the last inline open-state test in the gate, read with the opposite default for a payload naming no state. The `not ref` test beside it already covers a payload with neither, so no reachable reading changes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
A recorded local strict-review pass covers head |
…de, Read Compose and Renamed Paths, and Exempt a Delete-Only Push (#3693) Promotes the changes merged into `develop` since promotion #3681 to `main`, the first round of a backlog burndown. - [#3683](#3683) Carries a newly declared verbatim section in `carry.py` instead of refusing. The missing section is inserted in hub order: after the nearest preceding held section, else before the nearest following one, else at the end of the file. A rename is refused only for an unchanged body under a target H2 the hub does not carry, and the plans apply in two phases. - [#3689](#3689) Reads a null GraphQL node in `pr_review.py` as unread, re-reading and then exiting 1 naming the path. Names a closed pull request's state in the digest, and ends `wait` on a pull request that is no longer open the way `status` does. `merge-and-release` step 2 stops on `state=MERGED`. - [#3685](#3685) Skips the container side of a compose volume entry in the prose gate's home-path rule. Pins `--find-renames` in the gate's diff, and reads a renamed file whole only when it came from a generated tree or an excluded path. - [#3691](#3691) Exempts a delete-only push from the write guard's primary-checkout rule: a named remote, every refspec a delete of a branch other than `main`, `master` or `develop`, and only the delete, dry-run, quiet and verbose options. The branch's live protection rules still apply. Adds regression cases for #1628. Deferred review findings: #3694 (a YAML block scalar in a Compose file's volume scan) and #3690 (the `scripts/README.md` apply-time refusal sentence). #3695 records a pre-existing write-guard question raised while verifying them. Fixes #3614 Fixes #3392 Fixes #3677 Fixes #3220 Fixes #1586 Fixes #1642 Fixes #1628 🤖 Generated with [Claude Code](https://claude.com/claude-code)


Summary
Two fixes to
scripts/pr_review.py's readings. They are grouped because they touch the same reader modules.A null GraphQL node no longer crashes
wait(#3392)GitHub can return
nullfor a list item it could not resolve at read time, with no entry inerrors.reviewer_nodes()calledn.get("author")on every node, sowaitended in a traceback rather than a documented outcome.window_blindtreats a cut window. The local strict review showed why that fails. The readers that decide exit codes do not read blindness. So a null standing for an unresolved thread on an attested held head exited0rather than46, a silent false green where the crash had at least been loud.gh_graphql()now checks every response with the newpr_review_rounds.null_node(), which names the first connection holding a null. A query holding one is read again onREAD_RETRY_DELAYSthrough the existingbackoffhelper, since the null has been transient where it was seen. A null that stays ends the run at exit1, the documented outcome of a GraphQL read that failed, naming where it sat. A mutation is never sent twice. Its null ends the run saying the write it answers was sent.nodeslist, since every read and write goes throughgh_graphql(). So no reader carries a guard of its own.statusandwaitname a pull request's state once it is no longer open (#3677)HELD_FIELDSnow readsmergedAt closedAt mergeCommit{ oid }, andQ_LIVEreadsstate.stateis notOPEN, the digest carriesstate=MERGED merged_at=<ts> merge_commit=<sha8>afterpr=, orstate=CLOSED closed_at=<ts>. An open pull request prints none of these.waiton a pull request found no longer open, on its first read or on any Copilot poll, neither requests a review nor polls further. It prints the digest and exits asstatusdoes, through a sharedrun_status().waitno longer polls a closed pull request, so it never returns30for one. Thewaitdocstring says that its0there says nothing about review coverage, and thatstate=says why.merge-and-releasestep 2 now readsstate=MERGEDas a promotion merged since step 1 found it open, and stops re-reading. It confirmsmerge_commit=per step 4, runs the ready-report comparison againsthead=, and reports both. It dispatches no release from there, since whoever merged it may already have released it, which is the case that surfaced Name a Merged or Closed Pull Request's State in pr_review.py status #3677.state=CLOSEDis a stop to report.Size ceilings
pr_review_digest.pyis at 339 of its 350 ceiling,pr_review_rounds.pyat 663 of 700, andpr_review.pyat 2141 of 2200. No ceiling was raised.Not changed here
scripts/README.md'spr_review.pysection is claimed by another change in flight. It stays true, since a null read is "a GraphQL read that failed". It does not yet mention thestate=fields orwait's handling of a pull request that is no longer open, and that gap is left for follow-up.drive-prdoes not readstate=yet. A closed feature pull request reaches its merge step, wheregh pr mergefails loudly. That and the README gap are filed as Read pr_review.py's state= Field in drive-pr and Document It in scripts/README.md #3688.pr_review.py's transport rather than the sharedscripts/gh_graphql.py. Two other callers guard per site, and one site there is unguarded. That is filed as Check for a Null GraphQL Node in the Shared Transport Rather Than per Caller #3687.Findings left open by the local strict review
introducedfinding is open. The inline open-state test is now the singlepr_review_rounds.is_openhelper at every site in the gate and the digest (5e48f53, 98b6a68). The step 8 cleanup, the secondfull_read, and the unpinned first-read return were fixed in 0d05854, ab8849b, and 3893b23 after Copilot raised them too.waitpoll at exit1, and a re-run recovers. A null echoed in the review-request mutation's response also ends the run, saying the write was sent, and a re-run skips the re-request. The repository-wide Copilot history read fails closed on a null as well. A pull request merged in the seconds betweenwait's first read and its review request still gets the request, which fails loudly. No test covers a held attested head merging mid-poll, although that path ends throughheld_checks_open's existing non-open arm.Dropped findings
scripts/pr_review_checks.pyheld_checks_openandchecks_never_ran: they keep their inline open-state test rather thanis_open. Consolidation on a file this change does not touch.Test plan
tests/test_pr_review.pygains newTestNullNodesandTestPullRequestNotOpencases. They cover:null_nodenaming the connection.waiton a merged pull request neither requesting nor sleeping.waitstopping after one poll once the pull request merges under it.tests/test_pr_review.py,tests/test_pr_review_size.py, andtests/test_pr_review_copilot.pypass, and the fulltests/suite passed on the first round.scripts/build_dist.py --checkreports the generated skill distributions current.Closes on promotion: #3392, #3677
🤖 Generated with Claude Code