Repository navigation
fix(merge-gate): a check run with a conclusion is finished, whatever its status says - #15
Conversation
Port of citrate-core #950's jq test to the org template. Runs the workflow's own summary/failed/pending lines with bash and jq over check-run lists shaped like the API's. Red against main: a run with a conclusion but status still in_progress counts as pending (the core #917 two-hour wait), and a stuck run's failure is not judged. Signed-off-by: Larry Klosowski <larryklosowski@proton.me> Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FPJzHNqGLdTVoFzde3Sxbw
…its status says Port of citrate-core #950. GitHub can leave a finished run's status at in_progress; the ci gate keyed pending on status and so waited out its 120-minute deadline on such a run. Pending now counts runs with no conclusion (queued and running runs both have conclusion null), and the verdict is taken from runs that have a conclusion, so a stuck failure still fails the gate. Signed-off-by: Larry Klosowski <larryklosowski@proton.me> Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FPJzHNqGLdTVoFzde3Sxbw
BerryManifold
left a comment
There was a problem hiding this comment.
Automated Codex static review of 403d4cf84c16a82583e849365e687b71cec78563 is complete. Result: clean; details retained privately. Details and coverage limits are recorded in the project's private review log. No tests were executed by this reviewer. Both account submissions represent the same Codex review, not independent reviews.
Matr0xshka
left a comment
There was a problem hiding this comment.
Automated Codex static review of 403d4cf84c16a82583e849365e687b71cec78563 is complete. Result: clean; details retained privately. Details and coverage limits are recorded in the project's private review log. No tests were executed by this reviewer. Both account submissions represent the same Codex review, not independent reviews.
Pins the 'last' selector: with main's status == "completed" selector this case fails the gate falsely; every other case passes either way. Signed-off-by: Larry Klosowski <larryklosowski@proton.me> Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FPJzHNqGLdTVoFzde3Sxbw
|
Independent agent review (fresh reviewer): APPROVE, no blocking findings. It ran the 6 cases on 403d4cf, mutation-tested the filter (7 of 8 mutations caught), and confirmed permissions and inputs are unchanged. Its one non-blocking gap is fixed in 17e0a15: 🤖 Generated with Claude Code |
BerryManifold
left a comment
There was a problem hiding this comment.
Automated Codex static review of 17e0a1595103cbb88ff6ce34b58a1f227249785c is complete. Result: clean; details retained privately. Details and coverage limits are recorded in the project's private review log. No tests were executed by this reviewer. Both account submissions represent the same Codex review, not independent reviews.
Matr0xshka
left a comment
There was a problem hiding this comment.
Automated Codex static review of 17e0a1595103cbb88ff6ce34b58a1f227249785c is complete. Result: clean; details retained privately. Details and coverage limits are recorded in the project's private review log. No tests were executed by this reviewer. Both account submissions represent the same Codex review, not independent reviews.
What citrate-core #950 fixed
On citrate-core's merge-queue commit for #917, one attempt of
lane-guard resolvefinished in 3 s withconclusion: successandcompleted_atset, but GitHub left itsstatusatin_progressfor good. Thecigate's "Wait for every other check on this commit" step counted a run as pending whenstatus != "completed", so it waited on that attempt until its 120-minute deadline and then failed the entry. GitHub setsconclusiononly when a run completes, so a run with a conclusion is finished whatever its status says. #950 changed the filter in core's copy and noted that this repo's template has the same filter.The ported change
.github/workflows/merge-gate.yml(the copy every CitrateNetwork repo inherits),summaryfilter in thecijob:pendingcounts runs withconclusion == null. Queued runs and runs that are really running both have a null conclusion, so the gate still waits on them.lastpicks from runs with a non-null, non-cancelled conclusion, so a stuck run that failed still fails the gate.Nothing else in the step changes (no merge_group or other divergence from core is pulled in).
scripts/ci/test_merge_gate.py(new, 6 cases) is the Python/unittest port of core'sscripts/merge-gate-workflow.test.mjs. It reads the workflow's ownsummary,failedandpendinglines out of merge-gate.yml and runs them with bash and jq, as the runner does, over check-run lists shaped like the API's. It is picked up by the existingpython3 -m unittest discover -s scripts/ci -p 'test_*.py'step inci.yml, so no workflow wiring was needed. ubuntu-latest has jq; the class skips only if bash or jq is missing.Red / green
Red (commit 1, test only, against main's filter):
Same 2 of 6 as core #950: the #917 case and the stuck-failure case. The other 4 pin behaviour that must not change.
Green (commit 2, with the fix):
scripts/test-canon-guardrail.shandscripts/ci/public-truth.sh .also exit 0. The local-CI pre-push gate passed.Self-review pass 1: correctness
neutralandskippedconclusions are treated as before (finished, not failing).lastis null); a cancelled duplicate is still ignored (tested).sort_by(.completed_at)now may include a stuck run; it hascompleted_atset (the API sets it with the conclusion), so ordering is still by real finish time.ciandsecret-scanexclusions are unchanged (tested).Self-review pass 2: security (incl. workflow injection / agentic actions)
${{ }}expressions, inputs, env vars, permissions, actions or secrets. The job keepscontents: readandchecks: read. The jq program is a static single-quoted string; API data is passed to jq on stdin, never interpolated into the program or into shell.bash -con text taken from this repo's own workflow file with fixed JSON on stdin; no network, no token.Risk / rollback
Low. Repos that copied merge-gate.yml keep the old filter until they re-sync; core already has the fix. Rollback is a revert of commit 2; the test commit would then go red, which is the intended signal.
🤖 Generated with Claude Code
https://claude.ai/code/session_01FPJzHNqGLdTVoFzde3Sxbw