You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PR #5476 sat "CI pending" for ~30 minutes after every workflow had finished. All 25 checks were green, but the required gate commit status was stuck at pending — "Waiting for required PR gates: unit", blocking merge indefinitely.
Root cause (evidenced from run logs)
Deploy Gate (.github/workflows/deploy-gate.yml) triggers on workflow_run.completed for Test / Typecheck / Lint Code / Security Audit, polls commits/<sha>/check-runsexactly once, and posts the gate status. Two failure modes combine:
It posted gate=pending at 08:12:20Z. Since that was the LAST workflow-completion event for the SHA, nothing ever re-evaluated: the stale pending is permanent.
Last-writer-wins across concurrent gate runs. Each of the four watched workflows fires its own gate run; a run triggered early but scheduled late can overwrite a later run's correct success with pending. Same terminal state, different trigger.
Recovery (works today)
gh run rerun <latest-gate-run-id> — the rerun re-polls (now consistent) and posts the true result. That's how #5476 was unstuck (gate flipped to success at 08:39:52Z).
Proposed fix
In the gate step, when pending is non-empty andfailed is empty (i.e. nothing has actually failed — we're only waiting), retry the check-runs poll 3–4 times with a 30s sleep before posting pending. That bounds the stale-read window at ~2 minutes and turns the terminal-stale case into a self-healing one. Optionally guard last-writer-wins by skipping the status POST when the existing gate status for the SHA is already success with a newer updated_at evaluation basis.
Evidence
Stuck status: gate | pending | 2026-07-23T08:12:20Z vs unit | completed | success | 08:11:12Z on b33988c70
Symptom
PR #5476 sat "CI pending" for ~30 minutes after every workflow had finished. All 25 checks were green, but the required
gatecommit status was stuck atpending — "Waiting for required PR gates: unit", blocking merge indefinitely.Root cause (evidenced from run logs)
Deploy Gate(.github/workflows/deploy-gate.yml) triggers onworkflow_run.completedfor Test / Typecheck / Lint Code / Security Audit, pollscommits/<sha>/check-runsexactly once, and posts thegatestatus. Two failure modes combine:b33988c70), theunitcheck-run completed at08:11:12Z. The final gate run evaluated at08:12:19Z— 67s later — and the check-runs API still returnedunit=pending(eventual consistency). Log from run 29990493776:gate=pendingat08:12:20Z. Since that was the LAST workflow-completion event for the SHA, nothing ever re-evaluated: the stale pending is permanent.successwithpending. Same terminal state, different trigger.Recovery (works today)
gh run rerun <latest-gate-run-id>— the rerun re-polls (now consistent) and posts the true result. That's how #5476 was unstuck (gate flipped to success at08:39:52Z).Proposed fix
In the gate step, when
pendingis non-empty andfailedis empty (i.e. nothing has actually failed — we're only waiting), retry the check-runs poll 3–4 times with a 30s sleep before postingpending. That bounds the stale-read window at ~2 minutes and turns the terminal-stale case into a self-healing one. Optionally guard last-writer-wins by skipping the status POST when the existinggatestatus for the SHA is alreadysuccesswith a newerupdated_atevaluation basis.Evidence
gate | pending | 2026-07-23T08:12:20Zvsunit | completed | success | 08:11:12Zonb33988c70success | All required PR gates passed