Skip to content

fix(ci): live label queries, real allow-ci gating, dead triggers - #607

Merged
sini merged 1 commit into
mainfrom
chore/ci-robustness
Jun 11, 2026
Merged

sini merged 1 commit into
mainfrom
chore/ci-robustness

Conversation

@sini

@sini sini commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Why

PR #606 exposed a CI gating bug: re-running the failed allow-ci job kept failing even after the allow-ci label was added. The label check read github.event.pull_request.labels — a payload frozen at trigger time, which re-runs reuse verbatim. A general audit of the workflows turned up several more robustness issues.

Changes

test.yml

  • allow-ci queries labels live via the API instead of the event payload, so re-runs see labels added after the triggering event. Permission-check fallback kept (auto-allow-ci's GITHUB_TOKEN labeling doesn't re-trigger workflows).
  • ci-deep and flake-check are now actually gated by allow-ci — previously they ran for fork PRs regardless; the gate only protected the cheap template jobs. They fail (via a Require allow-ci first step) rather than skip, because skipped required checks count as passing under the ruleset and would let an unvetted PR satisfy Tests ubuntu-latest. Behavior change: external PRs get no CI until labeled, matching the gate's stated intent.
  • Main builds are never cancelled: cancel-in-progress is now conditional. Back-to-back merges to main previously cancelled each other's runs, leaving main untested.
  • non-draft emits a nix-changed output instead of failing grep '.nix' on docs-only PRs (red ❌ on every review of a non-nix PR). Downstream jobs skip cleanly, preserving the skipped-required-checks path that lets docs-only PRs merge. Also fixes the unescaped-dot regex.
  • Only approved reviews re-trigger CI — pull_request_review: submitted previously fired full CI on comment/changes-requested reviews too.

benchmark.yml

  • Same live-label-query fix for allow-bench and bench-skip.

bogus.yml / docs.yml

  • branches: ["!main"] was a dead trigger — a filter with only negative patterns matches no branch at all. Replaced with branches-ignore: [main].
  • docs concurrency group is per-ref; the global "docs" group made concurrent PRs cancel each other's builds. Review-triggered docs builds gated to approvals.
  • nothing-but-nix pinned to @v10 in bogus.yml for consistency.

gh-pages.yml

  • Artifact listing paginates (previously capped at 30 — old doc versions silently dropped) and picks the newest artifact per docs-* name instead of an arbitrary one.

Not changed (flagged)

  • Actions are tag-pinned, not SHA-pinned (EndBug/latest-tag@latest in particular) — separate supply-chain hardening if desired.
  • pull_request_review keeps no paths filter by design: it's the re-trigger lever and the docs-only-merge mechanism.

Validated with actionlint (only pre-existing info-level SC2086 notes remain) and just fmt.

- query allow-ci/allow-bench/bench-skip labels via API instead of the
  event payload: re-runs reuse the payload frozen at trigger time, so
  labels added after a failure were never seen
- gate ci-deep and flake-check behind allow-ci with a hard-fail step;
  they previously ran for fork PRs regardless of the gate. Fail instead
  of skip because skipped required checks count as passing
- stop cancel-in-progress on main: back-to-back merges cancelled each
  other's runs, leaving main untested
- non-draft emits a nix-changed output instead of failing grep on
  docs-only PRs (red herring X); downstream jobs skip cleanly
- only approved reviews re-trigger CI, not comment reviews
- branches: ["!main"] in bogus/docs never matched anything (only-negative
  patterns match no branch); use branches-ignore
- docs concurrency group per-ref so PRs don't cancel each other
- paginate gh-pages artifact listing (was capped at 30) and pick newest
  artifact per name
- handle permission API failure gracefully; pin nothing-but-nix@v10 in bogus
@github-actions github-actions Bot added the allow-ci allow all CI integration tests label Jun 11, 2026
@sini
sini requested a review from vic June 11, 2026 16:24
@sini
sini merged commit fe63b4b into main Jun 11, 2026
4 checks passed
@sini
sini deleted the chore/ci-robustness branch June 11, 2026 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

allow-ci allow all CI integration tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant