Skip to content

weekly: bound the bump CI wait and do not wait on a queued pr_agent - #636

Merged
bong-water-water-bong merged 1 commit into
mainfrom
1bit/weekly-bounded-checks
Oct 30, 2026
Merged

bong-water-water-bong merged 1 commit into
mainfrom
1bit/weekly-bounded-checks

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

Why

scripts/weekly.sh step bumps finishes each verified bump PR with

gh pr checks "$n" -R "$REPO" --watch --interval 30

--watch returns only when every check has finished. A check that stays queued never finishes, so
one permanently queued check hangs the whole Sunday release (build/package/release never start).

That is the state of the box right now: coder-llm is OFF (owner, 2026-10-30), and its pr_agent
check is the one that stays queued. It is not a release-blocking signal — the bump itself is verified
locally first (checkout → pins → build → ctest → the bump's own check), and CI's real content checks are
build, CodeQL, hw_gate and the pin guards.

What changes

One new helper, checks_green <pr>, and one call site changed. It polls gh pr checks --json name,bucket
every 30 s and decides per check from the bucket GitHub assigns:

bucket what happens
fail, cancel holds the bump immediately (a cancelled run is not a pass)
pending, name matches $WEEKLY_QUEUED_OK (default pr_agent) not waited for
pending, anything else waited for, up to $WEEKLY_CHECKS_TIMEOUT (default 2700 s)
pass, skipping not blocking

So a queued review bot cannot hold the release, and a stuck CI holds that bump (recorded as held in
bumps.json, the rest of the release continues) instead of the whole run.

Two smaller things while in there:

  • every poll is appended to logs/bump-<pr>-checks.log, the same file --watch used to write, so the
    artifact does not disappear;
  • the failing / still-queued check names reach the why field of bumps.json (checks failed: hw_gate) instead of the bare CI failed the old code recorded.

No WEEKLY_SKIP_BUMPS option: weekly.sh already takes stages as arguments, so
weekly.sh <workdir> build test package release is the existing way to skip bumps. Adding an env var for
the same thing would be a second way to say one thing.

Not merged, not tagged

Opened for the orchestrator to review and squash-merge; the Sunday release runs from whatever main holds
when it starts. Nothing was pushed to main.

Testing

bash -n scripts/weekly.sh clean, tools/copyright.py --check rc=0.

The filter is the new logic, so it was exercised with a stub gh that prints a fixture on stdout,
the function text copied out of the script unchanged:

case result
all green rc 0
pr_agent queued, rest green rc 0
pr_agent queued + CodeQL green rc 0
hw_gate queued, rest green rc 1 after the bound (checks still hw_gate after 2s)
hw_gate fail rc 1 at once (checks failed: hw_gate)
CodeQL2 skipping, rest green rc 0
hw_gate cancel rc 1 at once
WEEKLY_QUEUED_OK=hw_gate with hw_gate queued rc 0

Not run: an end-to-end release-path bumps stage against a real bump PR (there are none open on the
engine right now, so this change is preventive; the rehearsal path used this Sunday is WEEKLY_DRY_RUN=1,
which never reached the --watch line at all).

`gh pr checks --watch` returns only when every check has finished, and a check that stays queued
never finishes. coder-llm is off on the release box (the owner, 2026-10-30), so its `pr_agent`
check can sit queued for ever: the Sunday release would wait on a review bot, not on CI.

`checks_green` polls instead and decides per check, from the bucket GitHub itself assigns:

- a `fail` (or `cancel` - a cancelled run is not a pass) holds the bump, exactly as before;
- a `pending` check whose name matches $WEEKLY_QUEUED_OK (default: pr_agent) is not waited for;
- everything else is still waited for, and the whole wait is bounded by $WEEKLY_CHECKS_TIMEOUT
  (default 2700 s), so a stuck CI holds that bump and never the release.

Each poll is appended to logs/bump-<pr>-checks.log, which is where the old --watch output went, and
the failing or still-queued check names now reach bumps.json's "why" instead of a bare "CI failed".

Checked with a stub `gh` over fixture buckets, the real filter code unchanged: all-green 0,
pr_agent queued + rest green 0, another check queued 1 (after the bound), a failing check 1 at once,
a cancelled check 1, skipping buckets 0, $WEEKLY_QUEUED_OK override 0.

No new option to skip the bumps stage: the stages argument already does that
(`weekly.sh <workdir> build test package release`).
@bong-water-water-bong
bong-water-water-bong merged commit cff88c9 into main Oct 30, 2026
7 of 8 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the 1bit/weekly-bounded-checks branch October 30, 2026 06:20
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