fix(ship-it): wait for every workflow run in tea-ci-watch #13

Merged
rootiest merged 1 commits from fix/ship-it-ci-watch-all-runs into main 2026-10-01 08:30:20 +00:00
Owner

Problem

tea-ci-watch.sh could exit 0 as soon as one CI workflow finished when several run on the same commit.

Gitea only posts an Actions job's commit status once a runner picks the job up, so queued workflows are invisible to the combined status API. Example from color-tool PR #13: Test PR succeeded at 05:00:44, but Auto Label's first (pending) status wasn't posted until 05:01:11. In between, the combined status read success with 1 check.

Fix

  • Also poll GET /repos/{repo}/actions/runs?head_sha=<sha>, which lists runs from the moment they're triggered, queued included.
  • Success only when no run is waiting/queued/in progress and the combined status is success/warning. If every job was skipped (completed runs, zero statuses), that also counts as success.
  • Fail fast (exit 1) on a failed/errored status or a failed/cancelled run; both are printed.
  • "No CI" (exit 3) now also requires zero runs.
  • ship-it bumped to 1.2.1, dist/ regenerated, README now documents all four ship-it phases.

Verification

  • Live (Gitea 1.27.3):
    • color-tool two-workflow commit: exit 0
    • qmk_firmware failed lint: exit 1, failures printed from both checks
    • repo that doesn't exist: exit 2
  • Stub tea replaying the race (one check done, second workflow queued with no status): waits through the queued window, exits 0 only after the second workflow finishes.
  • Stub runs of the all-skipped case (exit 0) and the no-CI case (exit 3) also passed.
  • bash -n and shellcheck are clean.

https://claude.ai/code/session_011atyN7HD7xfX6Fn9926J9f

## Problem `tea-ci-watch.sh` could exit 0 as soon as **one** CI workflow finished when several run on the same commit. Gitea only posts an Actions job's commit status once a runner picks the job up, so queued workflows are invisible to the combined status API. Example from color-tool PR #13: `Test PR` succeeded at 05:00:44, but `Auto Label`'s first (pending) status wasn't posted until 05:01:11. In between, the combined status read `success` with 1 check. ## Fix - Also poll `GET /repos/{repo}/actions/runs?head_sha=<sha>`, which lists runs from the moment they're triggered, queued included. - Success only when no run is waiting/queued/in progress **and** the combined status is `success`/`warning`. If every job was skipped (completed runs, zero statuses), that also counts as success. - Fail fast (exit 1) on a failed/errored status or a failed/cancelled run; both are printed. - "No CI" (exit 3) now also requires zero runs. - ship-it bumped to 1.2.1, `dist/` regenerated, README now documents all four ship-it phases. ## Verification - Live (Gitea 1.27.3): - color-tool two-workflow commit: exit 0 - qmk_firmware failed lint: exit 1, failures printed from both checks - repo that doesn't exist: exit 2 - Stub `tea` replaying the race (one check done, second workflow queued with no status): waits through the queued window, exits 0 only after the second workflow finishes. - Stub runs of the all-skipped case (exit 0) and the no-CI case (exit 3) also passed. - `bash -n` and `shellcheck` are clean. https://claude.ai/code/session_011atyN7HD7xfX6Fn9926J9f
rootiest added 1 commit 2026-10-01 06:22:15 +00:00
fix(ship-it): wait for every workflow run in tea-ci-watch
Generate plugin manifests / generate (pull_request) Skipped
Generate plugin manifests / validate (pull_request) Successful in 38s
30ebef6f30
Gitea only posts an Actions job's commit status once a runner picks the
job up, so queued workflows were invisible to the combined status. With
multiple workflows on a commit, the watcher returned success as soon as
the first one finished.

Also poll the Actions runs API (head_sha filter), which lists runs from
the moment they are triggered. Succeed only when no run is pending and
the combined status is terminal; fail fast on failed/cancelled runs or
failed statuses. Bump ship-it to 1.2.1 and document the CI phases in
the README.
rootiest merged commit b64d9a32e3 into main 2026-10-01 08:30:20 +00:00
rootiest deleted branch fix/ship-it-ci-watch-all-runs 2026-10-01 08:30:20 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: rootiest/rootiest-ai#13