FORGE-79: skip superseded queued main-push CI runs #739

Merged
gmackie merged 1 commit from FORGE-79-skip-superseded-ci into main 2026-10-12 06:52:42 +00:00
Owner

Kanbanger: FORGE-79 (CI backlog request from FORGE-67)

Why

Main pushes share the forgegraph-ci-refs/heads/main concurrency group and run one at a time, so every merge queued another full CI run behind the last. At 06:33Z on 2026-10-12, 15 main runs were queued holding ~117 jobs while the node pool sat at 12/12 busy. Those queued jobs also count as "waiting" in Forgejo's job search, which keeps the Cloudflare pool relaunching containers that have nothing to claim.

What

  • New superseded job first, on runs-on: cloudflare — the same main-head check as deploy.yml's guard. If main has moved past github.sha when a push run starts, current=false.
  • Every job (gitleaks, storybook, web-build, checks, unit-api, unit-web, database, go) has needs: superseded + if: needs.superseded.outputs.current == 'true'.
  • Aggregate ci keeps the literal if: always(), needs superseded, and on a superseded run exits its verdict early with superseded=true: no ForgeGraph report, no failure.
  • Running main runs are never cancelled; PR runs keep cancel-in-progress. PRs and failed head lookups always run; a failed guard job leaves the jobs skipped, which fails ci (fail closed).

Tests

ci-aggregate.test.ts and forgegraph-ci-runner-placement.test.ts: guard placement and logic, every job gated, superseded verdict, empty-guard verdict fails. 9/9 pass locally.

🤖 Generated with Claude Code

Kanbanger: FORGE-79 (CI backlog request from FORGE-67) ## Why Main pushes share the `forgegraph-ci-refs/heads/main` concurrency group and run one at a time, so every merge queued another full CI run behind the last. At 06:33Z on 2026-10-12, 15 main runs were queued holding ~117 jobs while the node pool sat at 12/12 busy. Those queued jobs also count as "waiting" in Forgejo's job search, which keeps the Cloudflare pool relaunching containers that have nothing to claim. ## What - New `superseded` job first, on `runs-on: cloudflare` — the same main-head check as deploy.yml's guard. If main has moved past `github.sha` when a push run starts, `current=false`. - Every job (gitleaks, storybook, web-build, checks, unit-api, unit-web, database, go) has `needs: superseded` + `if: needs.superseded.outputs.current == 'true'`. - Aggregate `ci` keeps the literal `if: always()`, needs `superseded`, and on a superseded run exits its verdict early with `superseded=true`: no ForgeGraph report, no failure. - Running main runs are never cancelled; PR runs keep `cancel-in-progress`. PRs and failed head lookups always run; a failed guard job leaves the jobs skipped, which fails `ci` (fail closed). ## Tests `ci-aggregate.test.ts` and `forgegraph-ci-runner-placement.test.ts`: guard placement and logic, every job gated, superseded verdict, empty-guard verdict fails. 9/9 pass locally. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
FORGE-79: skip superseded queued main-push CI runs
All checks were successful
CI / superseded (pull_request) Successful in 1s
CI / gitleaks (pull_request) Successful in 14s
CI / unit-web (pull_request) Successful in 2m34s
CI / unit-api (pull_request) Successful in 2m43s
CI / storybook (pull_request) Successful in 2m8s
CI / go (pull_request) Successful in 1m7s
CI / checks (pull_request) Successful in 2m15s
CI / web-build (pull_request) Successful in 2m41s
CI / database (pull_request) Successful in 3m53s
forgegraph/ci CI passed
CI / ci (pull_request) Successful in 55s
4b7fd6e268
Main pushes share one concurrency group and run serially, so each merge
queued a full CI run (~9 jobs) behind the last. On 2026-10-12 fifteen
queued main runs held ~120 jobs while the node pool sat at 12/12.

Add a superseded guard (the same check as deploy.yml's) as the first job,
on the Cloudflare lane. A main run that starts after main has moved on
skips every job and frees the group in seconds; the aggregate ci job
passes it without reporting. The running main run is never cancelled,
and PRs and failed lookups always run.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign in to join this conversation.
No description provided.