Files
Zachary Lowden 3d828eaadd ci: validate the default Windows contributor setup, non-blocking (#4162)
Every job in this repo runs on ubuntu-latest, so nothing validates Windows —
while Windows support is real and maintained: defender-exclusions.ps1, win32
branches in test-unit-run.mjs / bench.mjs / console.mjs / worktree.mjs, and
it.skipIf(win32) guards in scripts/__tests__. A supported platform verified by
nothing is how a contributor's first hour goes to a break nobody else can
reproduce.

The specific exposure this targets: `pnpm install` runs `preinstall`
(npx only-allow pnpm) and `postinstall` (pnpm run db:generate). The Makefile
carried `# TODO fix postinstall on git bash` against that path — and the target
it sat on was DEAD for everyone, because `npm i` exits 1 under only-allow. So the
hook path has gone a long time unexercised on Windows. Un-breaking the target
(4107) means the next Windows contributor is the first to walk it in a while.
This walks it first.

Both shells on purpose. pwsh is the Windows default; bash is Git Bash, and the
TODO was Git-Bash-specific. A pwsh-only job would report green over the single
case we have written evidence about.

Non-blocking (continue-on-error) to start. A gate that lands red on day one and
stops unrelated PRs trains everyone to click through, which is worse than no
gate. Flip it once it has been green long enough to mean something.

Does NOT start the compose stack: those are Linux containers and Docker on
Windows runners is slow and flaky — noise, not signal. Everything up to
`pnpm dev` is covered; the services half is Linux-identical and already exercised
by the ubuntu jobs.

Costs nothing: windows-latest is a standard GitHub-hosted runner, free for public
repositories.

The install step carries a positive control, because `pnpm install` exiting 0 is
not evidence the postinstall hook ran — a hook that silently no-ops also exits 0,
and the missing client then surfaces much later as a confusing runtime error. The
job asserts packages/civitai-db-schema/prisma/schema.prisma exists afterwards.
That file is a genuine control precisely because it is GITIGNORED: it cannot
arrive from the checkout, so its presence proves the hook executed on this runner.

The guard was tested against its own failure modes before being trusted, rather
than assumed to work:

  artifact absent          -> rc=1, "postinstall did not run"
  artifact 3 lines         -> rc=1, "slim schema looks truncated"
  artifact 200 lines       -> rc=0

Each failure fires for its OWN reason with a distinct title, so a red run names
which thing broke. The 50-line floor sits against a source schema of 8,087 lines —
two orders of magnitude of headroom, so ordinary churn cannot trip it while a stub
still fails.

Also restores the git-bash TODO to the Makefile rather than leaving it deleted.
Nothing has verified it either way; dropping the note would have retired the only
written record of a known hazard on a path that had stopped being walked. It now
points at this workflow as the thing that will answer it.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-19 21:18:04 -05:00

3.7 KiB