ci: split CI — fast native gate every PR, hermetic nix flake check only on nix/dep changes #36
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/coding-lab!36
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "afk/32"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Splits the single
nix flake checkPR gate — ~12–13 min, the whole nix closure realized stone-cold on the ephemeral runner every run — into two gates so the common path skips nix entirely:.forgejo/workflows/ci.yml→ native gate (jobnative). Runs on every PR; the intended required check. Go + Node directly on the stock runner withactions/setup-go@v5/actions/setup-node@v4caching — no nix. Mirrors the flake's non-nix checks: SPAeslint+prettier+vitest+vite build→ copyweb/dist→internal/webui/dist→go build -tags ui ./cmd/...→go test -tags ui ./...→golangci-lint run ./...(untagged),CGO_ENABLED=0throughout, withgit/tmux/prlimiton PATH. ~2–4 min..forgejo/workflows/ci-nix.yml→ hermetic gate (jobflake-check). The existingnix flake check -L+ in-job Determinate install,on: pull_requestwithpaths:=**/*.nix,flake.lock,go.mod,go.sum. Stays authoritative; the deploy (bump-nixos-pin→test-configuration) re-runs it as a merge-to-main backstop.Version pins match nixpkgs at the current
flake.lock(d407951): Go 1.26 (fromgo.mod), Node 24 (pkgs.nodejs), golangci-lint 2.12.2 (nix eval nixpkgs#golangci-lint.version).Why
go.mod/go.sumgate the nix job (the one correctness trap)nix/package.nixpinsvendorHash— a fixed-output hash over the vendored Go module set. A dependency bump stales that hash →nix flake checkfails, but the native gate (go mod downloadlive) passes green. Without gating the nix job ongo.mod/go.sum, a dep bump would merge clean on the native gate and rot the nix build for the next nix-touching PR (and the deploy).web/package-lock.jsonis deliberately not a trigger —importNpmLockreads the lockfile directly (nonpmDepsHash), so npm deps can't rot the nix build, and its vitest/build coverage is already in the native gate.⚠️ Maintainer action required — branch-protection required-check switch
After merge, move branch protection's required status check from
flake-checktonative. The nix gate reports a status only when itspaths:match, so on a Go/TS-only PR it never runs; a rule that still requiresflake-checkwould wedge every such PR at "expected". Thenativejob id is kept stable for exactly this reason. (This is a repo setting the agent cannot change — flagged per the issue's decision 4.)Docs
docs/adr/0023-ci-split-native-and-nix-gates.md— records the trade; relaxes ADR-0002 on the common path (native-green no longer guarantees nix-green for non-dependency reasons: sandbox behavior, theui-embed compile, flake-only checks), hermetic gate authoritative on nix/dep changes + the deploy backstop.docs/ops.md— "CI runner prerequisites" now describes both gates (native egress, the actions-cache backend requirement, tmux install; nix egress unchanged).Scope
Pure CI + docs. No diff to
flake.nix,nix/**, product source (Go/TS), ordeploy.yml. Thestore-postgresM2 template stays commented inci.yml.Two out-of-scope staleness notes for you to reconcile (deliberately not touched, since both files are outside this issue's file list):
deploy.yml's header comment now misdescribes reality — it says the flake-check gate "lives inci.ymlon pull_request" (it's nowci-nix.yml) and that branch protection requires the "flake-checkstatus" (it'll benative). Comment-only; deploy behavior is unchanged and correct. Natural to fix alongside the required-check switch above.docs/definition-of-done.md§9 still says "CI is exactlynix flake check". Now imprecise on the common path.Verification
nixisn't available in this environment, so the gate behavior is reasoned from thepaths:filter rather than a live push (per the issue's fallback): a Go/TS-only PR matches noci-nix.ymlpath → onlynativeruns; a PR touching**/*.nix/flake.lock/go.mod/go.sumadditionally firesflake-check. The version pins were verified against nixpkgsd407951(golangci-lint2.12.2,pkgs.nodejs→24, both cross-checked), and the forgejo-runner facts —setup-go@v5/setup-node@v4resolving like the existingcheckout@v4(pin by tag, not SHA),tmuxabsent from the image (apt-installed) butprlimitpresent, setup-go caching by default vs setup-node needingcache: npm— confirmed against Forgejo docs and the catthehacker image scripts. A multi-dimension adversarial review of the diff against the acceptance criteria returned zero confirmed defects.Closes #32
🤖 Generated with Claude Code
https://claude.ai/code/session_01TdXvXtsF3jTnSvyu5wH9it