Skip to content

ci(release): wait for CI Success as long as CI's slowest required chain - #350

Merged
sunerpy merged 3 commits into
mainfrom
ci/release-ci-wait
Nov 27, 2026
Merged

sunerpy merged 3 commits into
mainfrom
ci/release-ci-wait

Conversation

@sunerpy

@sunerpy sunerpy commented Nov 27, 2026

Copy link
Copy Markdown
Owner

Summary

Verify CI Passed now waits for the release commit's CI Success for as long as CI's slowest required chain can take. A contract check keeps that wait in step with ci.yml.

  • .github/workflows/release.yml, exact-SHA wait step (now id: exact_ci): CI_WAIT_MINUTES: "90". Finding the CI push run and waiting for its CI Success now share one budget of CI_WAIT_MINUTES * 4 polls, one spent before each 15-second sleep. This replaces two fixed seq 1 120 loops, and both timeout messages print the minutes.
  • verify-ci job limit goes from 35 to 110 minutes: the wait plus room for its API calls and the earlier steps. The release verify job limit goes from 30 to 45 minutes, the limit of ci.yml's Linux job, which runs the same make check. v0.56.0's verify job took 22 min.
  • scripts/check-ci-gate.sh (run by make guardrail and scripts/tests/ci-gate.test.sh) gets a release-wait rule. It sums timeout-minutes along the longest needs path ending at ci-success, counting an unset limit as GitHub's 360. It then requires:
    • CI_WAIT_MINUTES to be at least that sum (today workspace-version 10 + windows-test 60 + ci-success 5 = 75);
    • the verify-ci limit to be at least CI_WAIT_MINUTES + 15;
    • the verify limit to be at least that of the ci.yml job running make check;
    • no seq loop in the wait step.
  • scripts/tests/release-ci-override.test.sh runs the exact-SHA wait against its stub gh.
  • CONTRIBUTING.md (Releases) lists the three limits the checker keeps in step with ci.yml.
  • The publish-time re-check after the PR-CI fallback (30 x 15 s in a 10-minute job) is unchanged.

Why

v0.56.0's Release run 45864204121 did not publish on its first attempt. Verify CI Passed (job 140062920295) ran from 17:02:48 to 17:34:04 UTC and failed when its second 120-poll loop ran out. The release commit's CI push run 45864204084 ran from 17:02:20 to 17:44:54 (42 min 34 s). The release was published only after the failed jobs were re-run.

The job limits in ci.yml let CI Success arrive up to 75 minutes after the run starts (Workspace Version 10, Windows Tests 60, CI Success 5), before runner queueing. A 30-minute wait can therefore fail a healthy release. 90 minutes covers the 75 with 15 to spare for queueing, which also meets the agreed minimum of 60.

Verification

Red, at d56ecda (contract and stub cases added, workflow unchanged):

  • bash scripts/tests/ci-gate.test.sh: 14 passed, 2 failed. A_repository and B_pristine fail with:
    MISMATCH [release-wait]: the exact-SHA wait step needs CI_WAIT_MINUTES, whole minutes covering CI's slowest required chain (workspace-version 10 + windows-test 60 + ci-success 5 = 75), got None
    MISMATCH [release-wait]: the exact-SHA wait step must bound its polling by CI_WAIT_MINUTES, not by a fixed seq count
    MISMATCH [release-wait]: verify timeout-minutes 30 is shorter than ci.yml gives the same make check (linux 45)
    
  • bash scripts/tests/release-ci-override.test.sh: 35 passed, 7 failed.
    • Y1_ci_after_121_polls (CI Success passes on poll 122) ends with timed out waiting for CI Success in run 40000000001, which is the old 120-poll cap.
    • Y2_one_minute_budget (CI_WAIT_MINUTES=1, never done) calls the jobs endpoint 120 times instead of 4.
    • Y3_no_push_run calls the runs endpoint 120 times instead of 4.
    • Y4_shared_budget (run found on the third call) calls the jobs endpoint 120 times instead of 2.
    • Y5_ci_failed and the 31 existing cases pass.

Green, at 475d473:

  • make script-tests: ci-gate 21/21, release-ci-override 42/42; the other harnesses are unchanged.
  • make workflow-lint (actionlint 1.7.12, shellcheck 0.11.0), make docs-check, make fmt-oxfmt-check (oxfmt 0.64.0), make guardrail, cargo fmt --all --check and git diff --check all pass.
  • Guards are not vacuous. In a scratch copy:
    • disabling one release-wait rule at a time fails exactly its fixtures (Q and R, S, T, U);
    • step bodies with two budgets, a 120-poll cap, or polling past a failed CI Success fail exactly Y4; Y1, Y2 and Y4; and Y5.
  • Edge probes:
    • a needs cycle or an undefined need exits 2 with an ERROR line;
    • an expression or boolean limit is reported;
    • an unset limit counts as 360;
    • CI_WAIT_MINUTES: 90 unquoted passes;
    • "90m" or a missing value fails.

The pre-push make pre-ci passed on 475d473; its guardrail printed release wait : CI_WAIT_MINUTES 90 >= workspace-version 10 + windows-test 60 + ci-success 5 = 75; verify-ci 110 >= 90 + 15; verify 45 >= make check 45.

Notes

  • The planned stub cases U and V are Y1 and Y2 here, because U and V already name PR-CI cases in that file. Y3 and Y4 pin the shared budget, and Y5 pins that a failed CI Success still stops the wait at once. The ci-gate fixture U_fixed_polls guards the seq rule next to Q to T.
  • The seq rule first also required the step to mention CI_WAIT_MINUTES, but the timeout messages alone met that. The last commit drops that condition, and the stub cases check the budget by behavior.
  • The verify rule finds the ci.yml job by its make check step, not by the name linux.
  • Unchanged: one failed gh api call still ends the wait (set -euo pipefail). The longer wait makes up to about 360 calls instead of 240.
  • This must merge before the v0.56.1 release PR, because the Release run uses the release.yml of the release commit. Whether Verify CI Passed passes on the first attempt will only be known at release time.

Give verify-ci's "Wait for exact-SHA CI Success" step the id exact_ci.
Nothing reads the id yet and the step's behavior is unchanged.

scripts/tests/release-ci-override.test.sh extracts the steps it runs
against its stub gh by step id. Without an id, a stub case for the
exact-SHA wait would stop at extraction with exit 2 instead of failing
on the wait's 120-poll cap, so the id comes first.

Verified: scripts/tests/ci-gate.test.sh (16 passed) and
scripts/tests/release-ci-override.test.sh (31 passed) stay green, and
actionlint passes on every workflow.
Add a release-wait rule to scripts/check-ci-gate.sh. It takes the
longest needs path of job timeout-minutes that ends at ci-success in
ci.yml (an unset limit counts as GitHub's default 360) and requires:

- the exact-SHA wait step's CI_WAIT_MINUTES to be at least that sum;
- verify-ci's timeout-minutes to be at least CI_WAIT_MINUTES + 15;
- the release verify job's limit to be at least the limit ci.yml gives
  the job that runs the same make check;
- the wait step to poll by CI_WAIT_MINUTES instead of a fixed seq count.

Extract the exact_ci step in scripts/tests/release-ci-override.test.sh
and run it against the existing gh and sleep stubs, with the workflow's
own CI_WAIT_MINUTES unless a case sets one:

- Y1: CI Success is in progress for 121 polls, then passes; exit 0.
- Y2: CI_WAIT_MINUTES=1 and CI never finishes; exit 1 after exactly
  four calls to the jobs endpoint.
- Y3: no push run ever appears; exit 1 after four calls.
- Y4: the push run appears on the third call; the jobs endpoint gets
  the two polls left.
- Y5: CI Success failed; exit 1 after one call.

Y1 and Y2 are the plan's U and V; those letters already name PR-CI
cases in this file. Y3 and Y4 check that the two loops share one
budget, and Y5 checks that a failed CI still stops the wait at once.

This commit is red. The release workflow still caps each loop at 120
polls of 15 seconds, has no CI_WAIT_MINUTES, and gives verify 30
minutes against Linux CI's 45: ci-gate.test.sh fails A_repository and
B_pristine (14 passed, 2 failed), and release-ci-override.test.sh fails
Y1 to Y4, Y2 with 120 jobs calls instead of 4 (35 passed, 7 failed).
Y5 and the 31 existing cases pass. shellcheck passes on both scripts.
On v0.56.0's first Release attempt (run 45864204121), Verify CI Passed
gave up after 31.3 minutes while the release commit's CI run
45864204084 needed 42.5, so the release stayed a draft until the
failed jobs were re-run. Each of the step's two loops stopped after 120
polls of 15 seconds, and the job's limit was 35 minutes. CI's slowest
required chain is Workspace Version (10 minutes), Windows Tests (60)
and CI Success (5): 75 minutes of job limits.

- The exact-SHA wait step gets CI_WAIT_MINUTES: "90", which leaves 15
  minutes for runner queueing. Finding the push run and waiting for
  its CI Success now share one budget of CI_WAIT_MINUTES * 4 polls,
  one spent before each 15-second sleep, and both timeout messages
  print the minutes.
- verify-ci's limit goes from 35 to 110 minutes: the wait plus room
  for its API calls and the earlier steps.
- verify's limit goes from 30 to 45 minutes, the limit of ci.yml's
  Linux job, which runs the same make check. v0.56.0's verify job took
  22.0 minutes.
- The publish-time re-check after the PR-CI fallback is unchanged.
- check-ci-gate.sh's fixed-poll rule now looks only for seq. Its other
  condition, that the step mentions CI_WAIT_MINUTES, was met by the
  timeout messages alone; the stub cases check the budget by behavior.
- ci-gate.test.sh gets guard fixtures: Q (wait 90 to 60), R (Windows
  Tests 60 to 100 with the wait unchanged), S (verify-ci 110 to 35),
  T (verify 45 to 30) and U (a seq 1 120 loop again) must all fail.
- CONTRIBUTING.md describes the three limits the checker keeps in step
  with ci.yml.

Verified: ci-gate.test.sh passes 21 of 21, A_repository and B_pristine
included; release-ci-override.test.sh passes 42 of 42, Y1 to Y4
included, which failed at d56ecda. make script-tests, make
workflow-lint (actionlint 1.7.12, shellcheck 0.11.0), make docs-check,
make fmt-oxfmt-check (oxfmt 0.64.0) and make guardrail pass. Disabling
any one release-wait rule in a scratch copy fails exactly its fixtures,
and scratch step bodies with two budgets, a 120-poll cap, or polling
past a failed CI Success fail the matching stub cases.
@codecov

codecov Bot commented Nov 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #350      +/-   ##
==========================================
- Coverage   96.40%   96.40%   -0.01%     
==========================================
  Files         368      368              
  Lines      254382   254382              
==========================================
- Hits       245229   245228       -1     
- Misses       9153     9154       +1     

see 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sunerpy
sunerpy merged commit 9b89c2f into main Nov 27, 2026
11 checks passed
@sunerpy
sunerpy deleted the ci/release-ci-wait branch November 27, 2026 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant