Ship the check gate as a tools command: one way to run checks in every repo and fork #239
Labels
No labels
blocked
bug
decision
duplicate
enhancement
help wanted
invalid
landed?
question
ready-to-merge
stale
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
allod/tools#239
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Give every allod repo, and every fork of one, a single command that runs its checks inside a dev VM's memory, by shipping the framework's check gate as a tools command instead of a script each repo carries.
Primary goals:
allod/toolsand reaches every machine with the other workspace tools, so no repo and no fork maintains its own script.nixprocess per machine and per check, every check built, every failing step reported in one run, and a run that built nothing refused.Current state and specifics
The gate is
check.shat the root ofallod/archetypes, documented in that repo's README under Common commands. It takes an optional flake reference, so it already runs against another repo unchanged.check-selftest.shbeside it proves the gate can fail.allod/deployhas no gate. The branchagent/check-gatethere adds acheck.shthat finds the pinnedarchetypessource and runs that revision's gate against the deploy flake, plus a README section. It is a stopgap: it gives the template a working command today and is one of the scripts this issue deletes.Measured on an 8 GiB dev VM with no swap, each run inside a 6.8 GiB memory cap. The first four rows are a deployment fork of
allod/deploywith eight machines and 21 checks; the last is the public template.nix flake check --no-buildruntime-module-selectionarchetypescheck.sh <deploy checkout>nix-fast-build1.4.0, 2 eval workers, 2048 MiB worker limitnix-fast-build1.4.0, 1 eval worker, 1024 MiB worker limitruntime-module-selection./check.shon the public templatePeak memory is the whole scope's and includes file cache.
nix-fast-buildwas not tuned further; it also runs onlychecks, notnixosConfigurations, so it would not replace the gate even if it fit.Three things to change while moving the gate:
--override-input. It reaches the flake two ways,nix eval "<flake>#<attr>"for ordinary names andbuiltins.getFlakefor names that are unsafe in an installable, and an override has to reach both.validatedin the gate's enumeration expression was read off Nix 2.31.5. It is not load-bearing: an output outsidehandledandpassiveAllowedis refused whether or not it is invalidated, which only selects the error message. Drop it and keep one refusal.passiveAllowednames outputs specific to the framework repo (profilesSource,secretsSource,inventorySource,secretsConsumedInventorySource) beside general ones (lib,vmFacts). In a shared command that list is the repo's own setting, not the tool's.What can drift with a Nix upgrade is how deeply Nix checks the kinds the gate handles. The self-test should run stock
nix flake checkand the gate over the same small fixtures and fail when Nix rejects a fixture the gate accepts.Default shape: a subcommand,
allod check [<flake-ref>], written the way the rest ofcmd/allodis. A standalone workspace binary is the alternative if the subcommand fights the CLI's conventions.Done when
allod/tools: the command, its tests including the differential self-test, and its docs.allod/archetypes:check.shandcheck-selftest.share gone and the README names the command.allod/deploy: the stopgapcheck.shis gone and the README names the command.allod/memory: thenix.mdsection onnix flake checkmemory names the command.nix flake check.Earlier pull requests carry
Refsto this issue. The last one carriesCloses.Scope
In: everything under Done when. Out: the CI runner itself, tracked in allod/strategy#52; reducing what the checks cost to evaluate; and
fork-safety.shinallod/archetypes, which is a different witness and stays where it is.Picked up. The stopgap is open as allod/deploy#6, and the command is being built on
agent/check-commandinallod/tools. This comment records the decisions taken where the issue left a choice, and the order the pull requests will arrive in.Decisions
builtins.getFlake. It reads everything through the flake reference, including the list of top-level outputs.names the root of the outputs (nix eval '<ref>#.' --apply builtins.attrNames) and honours--override-input.getFlakecannot take an override at allfork-safety.shhas to report such a name as a failure, because its fallback wasgetFlakeallod-check.tomlat the root of the flake,passive-outputs = [...].libandvmFactsare built insite.tomlthe same waytests/allod-check-selftest.shinallod/tools, run by hand against real Nixnix, which the sandboxed flake checks do not have. When to run it: after a Nix upgrade, and before a change to the command landsallod checkOrder
Refs.allod/tools: the command, tests, docs.Refs.allod/archetypes: deletecheck.shandcheck-selftest.sh, addallod-check.tomlnaming the four source outputs, README.Refs. Cut after 2 has merged, since a pull request cannot be stacked on an open one and the README has to name a command that exists.allod/memorynix.md, and the body of allod/strategy#52.allod/deploy: delete the stopgap, README.Closes. Last, so the issue does not close with a box open. This puts the deploy box after the memory and strategy boxes, which is the one place the order differs from the checklist.Out of scope, noted here as asked
allod/toolsitself exposespackagesanddevShells, which the gate refuses as unknown outputs. Runningallod checkonallod/toolsneeds its ownallod-check.toml, and allowingpackagesthat way only forces the value where stock Nix checks that each entry is a derivation. Whether the gate should handlepackagesproperly is a separate decision.allod/toolscarries it and it has been rebuilt. Until then, on that machine, the README inallod/archetypeswill name a command that is not installed yet. The rebuild is a host-side human step.