Skip to content

ci: run a lighter CI on forks to avoid Actions pauses - #5

Merged
prekabreki merged 2 commits into
mainfrom
fm/fm-fork-ci-paused-f9
Oct 12, 2026
Merged

prekabreki merged 2 commits into
mainfrom
fm/fm-fork-ci-paused-f9

Conversation

@prekabreki

Copy link
Copy Markdown
Owner

Intent

Reduce the CI load on the fork prekabreki/firstmate so GitHub does not pause its Actions again.
GitHub paused every workflow on the fork after 2026-10-08 "due to the scale of GitHub Actions usage"; the only sign was a banner on the Actions page, and with zero checks reported, PRs could merge with no CI at all.
The captain re-enabled Actions, and the upstream-sync PR #4 (merged 2026-10-12) then ran all 20 checks green.
Each run fans out to about 20 hosted jobs (lint x2, portable parallel x2, portable serial x9, a Herdr job with a 75-minute backstop, macOS stock bash, coverage, invariants, timing aggregate), plus the separate windows-herdr-spike workflow, and several 2026-10-08 runs were cancelled at the 30-minute timeout.

Constraints set for this work: keep the fork-local divergence in .github/workflows/ minimal; upstream kunchenguid/firstmate must still run exactly what it runs today; prefer a mechanism keyed on the repository (github.repository or a repo variable) over editing matrices or deleting jobs; choose the cuts from evidence; lint, repo invariants and the portable behaviour tests must still run on every PR to main; do not reduce shards if that pushes any job toward its 30-minute timeout; no-mistakes-required.yml stays unchanged; keep tests/fm-ci-workflow.test.sh and docs/fm-test-portable-shards.md (which owns the timeout policy) consistent and document the fork-only behaviour there; the PR targets the fork's main (prekabreki/firstmate), never upstream; the PR body says what the fork now skips or shrinks and roughly how many hosted jobs a PR run drops from and to.

Decisions made: job-level if: conditions keyed on github.repository == 'kunchenguid/firstmate' (self-contained, no repo-variable setup). In a fork, pull requests skip only the Herdr and macOS stock Bash lanes (18 hosted jobs to 16), and pushes to main run only the fast tier - coverage guard, invariants, timing aggregate - (18 to 3), because the PR already tested that tree; the timing aggregate tolerates all its needs being skipped. This is a deliberate trade-off: a commit pushed directly to the fork's main gets only the fast checks, so fork changes needing the full gate go through a PR. Serial shards stay at 9 because fork evidence showed serial shards at 13-20 minutes with one cancelled at 30. windows-herdr-spike.yml is workflow_dispatch-only, never ran on the fork, and is left unchanged. A pre-existing locale defect in bin/fm-test-run.sh --check-coverage (comm without LC_ALL=C) is filed separately and intentionally out of scope.

What Changed

  • .github/workflows/ci.yml now gates jobs with job-level if: conditions on github.repository == 'kunchenguid/firstmate', so upstream still runs every job on every event. In a fork, pull requests skip only the Herdr and stock macOS Bash lanes (18 hosted jobs drop to 16). Lint, the coverage guard, invariants, both portable parallel shards, all nine serial shards and the timing aggregate still run. Fork pushes to main run only the fast tier (coverage guard, invariants, timing aggregate), so 18 jobs drop to 3. The serial shard count is unchanged, and windows-herdr-spike.yml and no-mistakes-required.yml are untouched.
  • tests/fm-ci-workflow.test.sh gains a Ruby-based resolver that evaluates each job's if: (and needs for jobs with no if:) against a simulated repository and event. New tests assert three things: upstream runs every job on both pull requests and pushes, a fork PR runs everything except Herdr and macOS, and a fork main push runs exactly the fast-tier jobs.
  • docs/fm-test-portable-shards.md adds a "Fork-light CI" section with the rationale, what a fork skips, the job counts, and the trade-off: a commit pushed straight to a fork's main gets only the fast checks. CONTRIBUTING.md points to that section.

🤖 Generated with Claude Code

Risk Assessment

✅ Low: The change adds six job-level if: gates. Each one resolves true for kunchenguid/firstmate on both events, so upstream is unchanged. On a fork, PRs drop from 18 hosted jobs to 16 and main pushes drop to 3, which matches the stated decisions; the timing aggregate's always() and nullglob handling tolerate skipped needs, and the doc and test updates stay consistent with the workflow.

Testing

I ran the targeted workflow test, which resolves each job's if: from the parsed YAML for upstream and the fork on both pull_request and push, and it passed. Four deliberate gating mutations each made it fail, then ci.yml was restored byte-identical and the worktree is clean. I inspected the resolved job set: 18 jobs upstream on both events, 16 on fork PRs, 3 on fork main pushes, serial shards still 9, and the timing aggregate exits 0 with a warning when there are no lane artifacts. Running this live means GitHub Actions on prekabreki/firstmate. That requires a push, which belongs to the outer executor's CI phase, so every scenario is reported untested and the verdict is no-surface. There is no UI, so no visual evidence applies.

  • Live validation: ⚠️ no-surface - 0 of 3 scenarios driven live against the product
Scenario Result Live Evidence
Fork PR to prekabreki/firstmate main shows 16 checks: lint x2, invariants, coverage, portable parallel x2, serial x9, timing aggregate; Herdr and macOS stock Bash appear as skipped ⏸️ untested no No live-validatable surface in this phase. The behaviour only exists in GitHub Actions on the fork, and triggering it means pushing the branch and opening a PR on prekabreki/firstmate. That is the out…
Push to fork main runs only coverage guard, invariants and timing aggregate (3 jobs), and the timing aggregate succeeds with all its needs skipped ⏸️ untested no No live-validatable surface in this phase. It needs a push to prekabreki/firstmate main on GitHub's hosted runners, and pushing to main is outside the test phase's authority. The first post-merge main…
Upstream kunchenguid/firstmate still runs every ci.yml job on pull requests and main pushes (adversarial: gating must never reach upstream) ⏸️ untested no No live-validatable surface. Running CI on the upstream repository requires a PR or push to kunchenguid/firstmate, which the intent explicitly forbids (the PR targets the fork only). Upstream behaviou…
Evidence: fm-ci-workflow.test.sh transcript

Source: fm-ci-workflow.test.sh transcript

ok - CI matrices cover every executable serial lane and canonical lint root exactly once
ok - upstream runs every ci.yml job on pull requests and main pushes
ok - fork PRs run lint, invariants, coverage, and every portable lane
ok - fork main pushes run only the fast-tier checks
ok - a newer push to one PR supersedes that PR's in-flight CI
ok - distinct PRs get distinct concurrency groups
ok - every main push keeps its own group and is never cancelled
ok - every ci.yml job carries a finite timeout
ok - every ci.yml job belongs to one of the three timeout tiers
ok - fast tier jobs share one 5 minute tripwire
ok - normal tier jobs share one 30 minute budget
ok - Herdr keeps a 20 minute step tripwire under a 75 minute job backstop
Evidence: Gating mutation checks (each caught, exit 1)

Source: Gating mutation checks (each caught, exit 1)

== mutation: Herdr if: removed (fork would run Herdr)
not ok - fork PRs must run every job but Herdr and macOS, ran: invariants lint test-coverage tests-herdr tests-portable-parallel-1 tests-portable-parallel-2 tests-portable-serial tests-timing-aggregate
exit=1
== mutation: lint gated upstream-only (fork PR would lose lint)
not ok - fork PRs must run every job but Herdr and macOS, ran: invariants test-coverage tests-portable-parallel-1 tests-portable-parallel-2 tests-portable-serial tests-timing-aggregate
exit=1
== mutation: parallel-1 gated on PR only (upstream push would lose it)
not ok - upstream push must run every job, ran: invariants lint macos-stock-bash test-coverage tests-herdr tests-portable-parallel-2 tests-portable-serial tests-timing-aggregate
exit=1
== mutation: invariants gated upstream-only (fork loses invariants)
not ok - fork PRs must run every job but Herdr and macOS, ran: lint test-coverage tests-portable-parallel-1 tests-portable-parallel-2 tests-portable-serial tests-timing-aggregate
exit=1
- Outcome: ⚠️ 1 warning across 1 run (1m9s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

⚠️ **Test** - 1 warning
  • ⚠️ this change has no live-validatable surface; proceed without live validation? (0 of 3 scenarios were driven live against the product); Fork PR to prekabreki/firstmate main shows 16 checks: lint x2, invariants, coverage, portable parallel x2, serial x9, timing aggregate; Herdr and macOS stock Bash appear as skipped: No live-validatable surface in this phase. The behaviour only exists in GitHub Actions on the fork, and triggering it means pushing the branch and opening a PR on prekabreki/firstmate. That is the outer executor's push/PR/CI phase, which this test phase is forbidden to run. That CI run is where this scenario gets proven.; Push to fork main runs only coverage guard, invariants and timing aggregate (3 jobs), and the timing aggregate succeeds with all its needs skipped: No live-validatable surface in this phase. It needs a push to prekabreki/firstmate main on GitHub's hosted runners, and pushing to main is outside the test phase's authority. The first post-merge main push on the fork will exercise it, including download-artifact@v4 with zero matching artifacts.; Upstream kunchenguid/firstmate still runs every ci.yml job on pull requests and main pushes (adversarial: gating must never reach upstream): No live-validatable surface. Running CI on the upstream repository requires a PR or push to kunchenguid/firstmate, which the intent explicitly forbids (the PR targets the fork only). Upstream behaviour can only be checked by resolving the conditions semantically, as done here.
  • Live validation: ⚠️ no-surface - 0 of 3 scenarios driven live against the product
Scenario Result Live Evidence
Fork PR to prekabreki/firstmate main shows 16 checks: lint x2, invariants, coverage, portable parallel x2, serial x9, timing aggregate; Herdr and macOS stock Bash appear as skipped ⏸️ untested no No live-validatable surface in this phase. The behaviour only exists in GitHub Actions on the fork, and triggering it means pushing the branch and opening a PR on prekabreki/firstmate. That is the out…
Push to fork main runs only coverage guard, invariants and timing aggregate (3 jobs), and the timing aggregate succeeds with all its needs skipped ⏸️ untested no No live-validatable surface in this phase. It needs a push to prekabreki/firstmate main on GitHub's hosted runners, and pushing to main is outside the test phase's authority. The first post-merge main…
Upstream kunchenguid/firstmate still runs every ci.yml job on pull requests and main pushes (adversarial: gating must never reach upstream) ⏸️ untested no No live-validatable surface. Running CI on the upstream repository requires a PR or push to kunchenguid/firstmate, which the intent explicitly forbids (the PR targets the fork only). Upstream behaviou…
  • bash tests/fm-ci-workflow.test.sh (12/12 ok, including the 3 new fork/upstream gating assertions)
  • Mutation: removed if: from tests-herdr → fork-PR assertion fails (exit 1); ci.yml restored byte-identical from cp backup
  • Mutation: lint gated upstream-only → fork-PR assertion fails (exit 1)
  • Mutation: tests-portable-parallel-1 gated on pull_request only → upstream-push assertion fails (exit 1)
  • Mutation: invariants gated upstream-only → fork assertion fails (exit 1)
  • ruby -ryaml dump of every job's if/needs/timeout to confirm job counts 18 → 16 (fork PR) and 18 → 3 (fork push), serial matrix still 9 shards, timing aggregate if: always() with an empty-input warn path
  • git diff --stat d1d29783 a1c30b34 confirms only ci.yml, the test, and the doc changed (no-mistakes-required.yml and windows-herdr-spike.yml untouched)
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

GitHub paused every workflow on a busy fork for Actions usage scale, and
a paused fork reports no checks, so its pull requests could merge with
no CI. Key job-level `if:` conditions on github.repository so
kunchenguid/firstmate still runs every job on every event, while a fork
skips the Herdr and macOS stock Bash lanes on pull requests (18 hosted
jobs to 16) and runs only the fast tier on main pushes (18 to 3), since
the pull request already tested that tree.

Lint, repo invariants, the coverage guard and every portable behaviour
shard still gate fork pull requests, and the serial shard count is
unchanged so no job moves toward its 30-minute bound.
tests/fm-ci-workflow.test.sh resolves each job's `if:` for both
repositories and events, and docs/fm-test-portable-shards.md "Fork-light
CI" owns the rationale.
@prekabreki
prekabreki merged commit 2f97b49 into main Oct 12, 2026
36 of 37 checks passed
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