Repository navigation
ci: bring signed-landing to its final revision - #855
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
## What and why The `signed-landing` check on `main` is its first revision. This brings it to the revision that landed in Qbit-Org/qbit-white-paper#13 after a pilot there; the file is the same in every Qbit-Org repository apart from the branches that merge as they are. What was wrong with the first revision: the check's result sits on the head commit, and one commit can head two pull requests. Into one branch it is a single signed commit and passes; into another it is several commits and fails. Whichever run finished last decided for both, and the run that decided relied on GitHub's answers, which can lag an event by a moment. What the check does now: - It judges every pull request that could merge the same head commit, from any branch or fork and drafts aside, and passes only if all of them may land. Its message names the one that can't. Runs are grouped by head commit, and the newest cancels the older ones, so one run decides for a commit. - It keeps its own record of events. Each run's title holds the pull request's number, its `updated_at`, its state, whether it is a draft, its base branch and its head commit. So a pull request that was just opened on the commit or pushed to it is found even when GitHub's list of open pull requests doesn't show it yet, and an answer stamped earlier than a recorded event is asked for again. - A pull request's count of its commits has to equal what git says its head has and its base branch lacks. - Closing a second pull request on the commit, or turning it into a draft, clears the commit from that pull request's own run, with no re-run. - Only the workflow's `pull_request_target` runs count as its record, and a burst of runs doesn't push a run out of it. The workflow's permissions gain `actions: read` (its own runs) and `contents: read` (git's comparison of a base branch with the head commit). It still checks out nothing and uses no action. The README states what the workflow can't change: a run starts a few seconds after its event and the commit keeps its last result until then, a change made with a workflow's own token starts no run, a run that stays queued leaves the last result in place, and every run draws on the workflow token's hourly allowance of requests. No ruleset file changes. ## Checks - The check's script has 93 unit tests against real GitHub answers, and each of its rules fails a test when it is removed or weakened. - The same file was run from `main` in qbit-white-paper on two throwaway pull requests: one signed commit passed, a second pull request on the same commit into another base failed both, and closing it turned the first green from the closed pull request's own run. - This pull request is judged by `main`'s current copy of the check, the first revision, and shows a red `signed-landing` until it is squashed into one signed commit at landing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Squashed commits: 7b344a6 ci: bring signed-landing to the revision that landed in qbit-white-paper Co-Authored-By: Claude Fable 5.2 <[email protected]>
7b344a6 to
9be2c5a
Compare
There was a problem hiding this comment.
Worth a look
1. [low · security] judge_all skips judging this PR on a head mismatch alone, no longer requiring the event to agree
.github/workflows/signed-landing.yml:285
The old judge_all skipped a PR only when its event and GitHub's answer agreed it was closed or a draft. Otherwise judge() raised Behind on head lag (line ~234). Now, whenever there are others, standing() == "gone" skips judge(). That includes the case where the answer's head.sha differs from the event's head (line 462). The only guard is outrun() (lines 478-488), which accepts any answer stamped strictly later than every recorded event. Scenario: PR A (several commits, head X) shares X with PR B (one signed commit). A's synchronize run reads an answer whose updated_at has moved past the push, for example because of a comment, while head.sha still shows the old head. A is then skipped, B passes, and X turns green. Unproven: this depends on whether GitHub can return updated_at newer than an event while head.sha still lags. A human should check that. A safer form is to skip judge() only when the answer is closed or a draft, and let a head mismatch reach judge() and raise Behind.
Not posted: 2 nits and 2 leads. Reviews post bugs and security points only; the rest stay in Sixth Man's ledger.
Reviewed by Claude Opus 5.5.
|
On the point from the review of The run's own pull request steps aside for a head mismatch only when GitHub's answer is stamped strictly later than every event the check has recorded for it, which includes the event this run is for. The scenario needs an answer whose Skipping only for closed or draft, as suggested, brings back what the earlier revision did: a leftover run for a commit its pull request has moved off fails that commit for another pull request that still heads it, which reviewers raised on three of these pull requests. The daily audit of merged pull requests is the backstop for the case described. |
Since 3.x.x last took main at v3.1.1 (6046726), main gained the later revisions of the ruleset files, the signed-landing workflow and its two required-check rulesets (#837, #840, #855). .github/rulesets/README.md conflicted because both branches added it. 3.x.x's copy was main's first revision (aed3bd6) unchanged, so main's current text is taken. Two edits are not from main: - docs/releasing.md: a synchronization lands with the merge button. The version lines take changes only through a pull request that passes signed-landing, so the fast-forward push this guide described is refused. - docs/ci-same-tree-skip.md: renamed branches, as a limit of the skip (the note promised on #839). Co-Authored-By: Claude Fable 5.2 <[email protected]>
What and why
The
signed-landingcheck onmainis its first revision. This brings it to the revision that landed in Qbit-Org/qbit-white-paper#13 after a pilot there; the file is the same in every Qbit-Org repository apart from the branches that merge as they are.What was wrong with the first revision: the check's result sits on the head commit, and one commit can head two pull requests. Into one branch it is a single signed commit and passes; into another it is several commits and fails. Whichever run finished last decided for both, and the run that decided relied on GitHub's answers, which can lag an event by a moment.
What the check does now:
updated_at, its state, whether it is a draft, its base branch and its head commit. So a pull request that was just opened on the commit or pushed to it is found even when GitHub's list of open pull requests doesn't show it yet, and an answer stamped earlier than a recorded event is asked for again.pull_request_targetruns count as its record, and a burst of runs doesn't push a run out of it.The workflow's permissions gain
actions: read(its own runs) andcontents: read(git's comparison of a base branch with the head commit). It still checks out nothing and uses no action.The README states what the workflow can't change: a run starts a few seconds after its event and the commit keeps its last result until then, a change made with a workflow's own token starts no run, a run that stays queued leaves the last result in place, and every run draws on the workflow token's hourly allowance of requests.
No ruleset file changes.
Checks
mainin qbit-white-paper on two throwaway pull requests: one signed commit passed, a second pull request on the same commit into another base failed both, and closing it turned the first green from the closed pull request's own run.main's current copy of the check, the first revision, and shows a redsigned-landinguntil it is squashed into one signed commit at landing.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.