fleet: standard CI kit v1 (setup, report, superseded, templates) #1

Merged
gmackie merged 4 commits from fleet-ci-kit-v1 into main 2026-11-24 01:59:40 +00:00
Owner

Fleet CI standard, Phase 3: the standard CI kit.

  • fleet/setup: detects stacks from lockfiles (pnpm, npm, bun, uv, go, any mix), installs toolchains, points each manager at its fleet cache mount only when the mount exists and accepts a write, installs with retries, exports Turbo env when turbo-token is set, and prints one fleet-cache: line per job. Never uses an archive cache (FORGE-198). With no mount it falls back to the npm.forgegraf.com mirror when registry-token is set.
  • fleet/report: sends the same /api/fg/ci/report payload as today's hand-written steps, plus logTail on failure. It never fails the job.
  • fleet/superseded: on a push to the default branch, skip=true when the branch has a newer commit. Always false on PRs and dispatch.
  • templates/: node-turbo.yml (PRs run turbo --affected), node.yml, python-uv.yml, go.yml, preview-addon.yml (merge/close guard). All use runs-on: apps and the standard on/concurrency block.
  • Docs: fleet/README.md.

Verification (test repos under gmackie, runs-on: apps)

mount is the cache-instance id stored in the mount; matching ids mean the two runs shared a cache.

Repo / stack Cold run (cache, s, mount) Warm run (cache, s, mount)
ci-kit-test-pnpm (pnpm + turbo, 160 pkgs incl. next/react/eslint) 37691: miss (106 downloaded), 6.3 s, 443a3b60 37692: hit (160 reused), 4.6 s, 443a3b60
ci-kit-test-pnpm, merge push 37935: hit, 1.6 s, 443a3b60
ci-kit-test-pnpm, slower host 37811 (PR): miss, 63.5 s, befb54cf 37832: hit, 33.5 s, befb54cf
ci-kit-test-npm (npm ci) 37693: miss (85 tarballs), 1.6 s, a8eba3aa 37694: hit, 1.1 s; 37833: hit, 1.4 s, a8eba3aa
ci-kit-test-bun 37695: miss, 3.4 s, d76ae433 37696: hit, 0.1 s; 37834: hit, 0.4 s, d76ae433
ci-kit-test-uv (incl. pandas/numpy) 37697: miss, 12.1 s, 80430bc6 37931 (e3ee2b1): hit, 0.8 s, 80430bc6. The earlier 37698 was fully cached but counted as a miss because of the project's own build (fixed in e3ee2b1)
ci-kit-test-go (grpc graph) 37699: miss, 1.0 s, d3b63a84 37700: hit, 0.0 s, d3b63a84

Also checked:

  • fleet/superseded: stale main runs skipped and finished green (e.g. 37496, 37665 to 37669). PR and dispatch runs gave skip=false.
  • PR cancel-in-progress: a new PR push cancelled the older PR run. Main runs were never cancelled.
  • turbo --affected: the PR touching packages/a ran only @kit/a. Main ran @kit/a, @kit/b.
  • Preview guard: the open PR deployed (37812). Merging right after a push made the closed event cancel the queued deploy (37933). The live-state check returns deploy=false for a merged PR and fails open when the PR can't be read.
  • fleet/report: the payload passed ForgeGraph's auth and schema (HTTP 404 unknown repo for the unregistered test repo). With no token it warns and skips.
  • The ubuntu-latest fallback runs (no pnpm/npm mounts) used the npm mirror: registry=https://npm.forgegraf.com/, cache=off.

Reusable-workflow spike: go, with limits

  • uses: owner/repo/.forgejo/workflows/x.yml@ref works. Forgejo 15 expands it server-side. Inputs and outputs pass, and secrets: inherit passes the caller's secrets.
  • The full https://… URL form never schedules. It waits for "a runner with the following labels: " forever, with no error.
  • A callee cannot declare workflow_call.secrets; Forgejo rejects the file.

v1 therefore ships composite actions plus templates. Details are in fleet/README.md.

Tested kit SHA: e3ee2b1 (pnpm, npm, bun and uv green on it; go green on 940f574, whose go path is identical). The preview closed run skipped the deploy and ran cleanup (merged=true). The head commit after it changes README only.

🤖 Generated with Claude Code

Fleet CI standard, Phase 3: the standard CI kit. - `fleet/setup`: detects stacks from lockfiles (pnpm, npm, bun, uv, go, any mix), installs toolchains, points each manager at its fleet cache mount only when the mount exists and accepts a write, installs with retries, exports Turbo env when `turbo-token` is set, and prints one `fleet-cache:` line per job. Never uses an archive cache (FORGE-198). With no mount it falls back to the npm.forgegraf.com mirror when `registry-token` is set. - `fleet/report`: sends the same `/api/fg/ci/report` payload as today's hand-written steps, plus `logTail` on failure. It never fails the job. - `fleet/superseded`: on a push to the default branch, `skip=true` when the branch has a newer commit. Always `false` on PRs and dispatch. - `templates/`: `node-turbo.yml` (PRs run `turbo --affected`), `node.yml`, `python-uv.yml`, `go.yml`, `preview-addon.yml` (merge/close guard). All use `runs-on: apps` and the standard on/concurrency block. - Docs: `fleet/README.md`. ## Verification (test repos under gmackie, `runs-on: apps`) `mount` is the cache-instance id stored in the mount; matching ids mean the two runs shared a cache. | Repo / stack | Cold run (cache, s, mount) | Warm run (cache, s, mount) | |---|---|---| | ci-kit-test-pnpm (pnpm + turbo, 160 pkgs incl. next/react/eslint) | 37691: miss (106 downloaded), 6.3 s, 443a3b60 | 37692: **hit** (160 reused), 4.6 s, 443a3b60 | | ci-kit-test-pnpm, merge push | | 37935: **hit**, 1.6 s, 443a3b60 | | ci-kit-test-pnpm, slower host | 37811 (PR): miss, 63.5 s, befb54cf | 37832: **hit**, 33.5 s, befb54cf | | ci-kit-test-npm (npm ci) | 37693: miss (85 tarballs), 1.6 s, a8eba3aa | 37694: **hit**, 1.1 s; 37833: **hit**, 1.4 s, a8eba3aa | | ci-kit-test-bun | 37695: miss, 3.4 s, d76ae433 | 37696: **hit**, 0.1 s; 37834: **hit**, 0.4 s, d76ae433 | | ci-kit-test-uv (incl. pandas/numpy) | 37697: miss, 12.1 s, 80430bc6 | 37931 (e3ee2b1): **hit**, 0.8 s, 80430bc6. The earlier 37698 was fully cached but counted as a miss because of the project's own build (fixed in e3ee2b1) | | ci-kit-test-go (grpc graph) | 37699: miss, 1.0 s, d3b63a84 | 37700: **hit**, 0.0 s, d3b63a84 | Also checked: - fleet/superseded: stale main runs skipped and finished green (e.g. 37496, 37665 to 37669). PR and dispatch runs gave `skip=false`. - PR cancel-in-progress: a new PR push cancelled the older PR run. Main runs were never cancelled. - turbo `--affected`: the PR touching `packages/a` ran only `@kit/a`. Main ran `@kit/a, @kit/b`. - Preview guard: the open PR deployed (37812). Merging right after a push made the `closed` event cancel the queued deploy (37933). The live-state check returns `deploy=false` for a merged PR and fails open when the PR can't be read. - fleet/report: the payload passed ForgeGraph's auth and schema (HTTP 404 `unknown repo` for the unregistered test repo). With no token it warns and skips. - The ubuntu-latest fallback runs (no pnpm/npm mounts) used the npm mirror: `registry=https://npm.forgegraf.com/`, `cache=off`. ## Reusable-workflow spike: go, with limits - `uses: owner/repo/.forgejo/workflows/x.yml@ref` works. Forgejo 15 expands it server-side. Inputs and outputs pass, and `secrets: inherit` passes the caller's secrets. - The full `https://…` URL form never schedules. It waits for "a runner with the following labels: " forever, with no error. - A callee cannot declare `workflow_call.secrets`; Forgejo rejects the file. v1 therefore ships composite actions plus templates. Details are in `fleet/README.md`. Tested kit SHA: e3ee2b1 (pnpm, npm, bun and uv green on it; go green on 940f574, whose go path is identical). The preview `closed` run skipped the deploy and ran cleanup (`merged=true`). The head commit after it changes README only. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
gmackie/ci-actions!1
No description provided.