Repository navigation
fix(ci): checks:read, and a bot PR's CI waits for approval rather than failing - #595
Merged
Merged
Conversation
…n failing The bus built and validated its first real batch — bus PR #585 for #510, a genuine merge commit of main@1b4668bb and #510's head — and then died in the wait step: GraphQL: Resource not accessible by integration (repository.pullRequest.statusCheckRollup…) `statusCheckRollup` needs **`checks: read`**, which the permissions block did not declare. `mergeStateStatus` kept working throughout, which is why the loop logged BLOCKED six times before dying — only the rollup needed it. Third scope learned this way after `actions: read`; the lesson is the block itself: naming any permission sets every other to `none`. Two further defects, both worse than the missing scope: THE ROLLUP READ WAS FATAL. Under `set -euo pipefail` the failed assignment aborted the step, so the first successful batch left its bus PR open with no report and no cleanup. An unreadable rollup now means "keep waiting". `ACTION_REQUIRED` WAS LISTED AS A BATCH FAILURE, and it is not. A bot-authored pull request's runs are created `conclusion: action_required` with ZERO jobs, waiting for a human to press "Approve and run" — observed on #585, all three runs held, which is also why `/check-runs` returned HTTP 500. Reporting that as "the batch went red" accuses the members of a failure nothing executed, and it is indistinguishable from starvation by step count because both are zero. So `held` is now its own verdict that blames nobody, names the exact remedy, and is excluded from the starvation relabel. The wait step first ATTEMPTS to release the runs itself (hence `actions: write`); approving runs no new untrusted code, since the bus PR is a merge of PRs whose own CI already ran this content. If the token may not approve, it says so and stops rather than inventing a cause. Whether a `GITHUB_TOKEN` may approve its own held runs is the one open question, and the next dispatch answers it. If it may not, the bus needs a different CI vehicle than a pull request — dispatching the three workflows on the batch branch is the obvious candidate — because a human click per round is not unattended batching. Covered by `held-released` and `held-stuck`. Three mutants caught: treating ACTION_REQUIRED as red, removing the self-approval, and removing the guard that keeps `held` out of the starvation path. That last one needed the scenario fixed before it meant anything — the stub was serving 42 executed steps for held runs, where real ones execute zero, so the guard looked untested because the condition it protects never arose. Fourth time this exercise that a sanitised scenario proved nothing; faithfulness to the real failure is the whole value. Also fixed: `paste -sd', '` treats the delimiter as a cycling LIST, so context names joined as `entities,test` rather than `entities, test` in PR comments. Suite now 84 assertions. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The first real batch was built, then the wait step died
The bus got further than ever: bus PR #585 for #510, with a genuine merge commit of
main@1b4668bband #510's head. Then:statusCheckRollupneedschecks: read, undeclared.mergeStateStatuskept working — which is why the loop loggedBLOCKEDsix times before dying — because only the rollup needs it. Third scope learned this way afteractions: read; the lesson is the block itself: naming any permission sets every other tonone.Two defects worse than the missing scope
The rollup read was fatal. Under
set -euo pipefailthe failed assignment aborted the step, so the first successful batch left its bus PR open with no report and no cleanup. An unreadable rollup now means keep waiting.ACTION_REQUIREDwas listed as a batch failure, and it is not. A bot-authored PR's runs are createdconclusion: action_requiredwith zero jobs, waiting for a human to press "Approve and run" — observed on #585, all three runs held (also why/check-runsreturned HTTP 500). Calling that "the batch went red" accuses the members of a failure nothing executed, and it is indistinguishable from starvation by step count, because both are zero.heldis now its own verdict: blames nobody, names the remedy, excluded from the starvation relabel.The open question this answers next run
The wait step now attempts to release the runs itself (hence
actions: write). Approving runs no new untrusted code — the bus PR is a merge of PRs whose own CI already ran this exact content — so the gate's substance is unaffected. If the token may not approve, it says so and stops rather than inventing a cause.Whether a
GITHUB_TOKENmay approve its own held runs is the one thing standing between this and unattended batching, and the next dispatch settles it empirically. If it may not, the bus needs a different CI vehicle than a pull request — dispatching the three workflows on the batch branch is the obvious candidate — because a human click per round is not automation.Verification
held-releasedandheld-stuckscenarios. Three mutants caught: treatingACTION_REQUIREDas red, removing the self-approval, and removing the guard keepingheldout of the starvation path.That last mutant initially passed, and the reason matters more than the fix: my stub served 42 executed steps for held runs, where real ones execute zero — so the guard looked untested because the condition it protects never arose. Fourth time in this exercise that a sanitised scenario proved nothing. With the scenario made faithful, removing the guard misreports a held batch as starvation, sending you to check billing when the real action is one click.
Also fixed:
paste -sd', 'treats its delimiter as a cycling list, so context names joined asentities,testrather thanentities, testin PR comments.Suite 84 assertions ·
skills-check allexit 0 · S9 pin gate exit 0.Touches
.github/workflows/, so hand-merged by its own rule.🤖 Generated with Claude Code