[ka:cli-build-out] ka-install: --render/--dry-run mode (compute install plan without executing) #38
Reference in New Issue
Block a user
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?
Parent umbrella
Closes a scoped subset of #21. ka-promote (#22) and ka-build (#34) are already closed; this is the third verb's "computation half only."
Scope — render-only, never execute
ka-install <host> --render(or--dry-run, following ka-build's existing--dry-runflag atbin/ka-build:36) computes and prints the install plan thatka-install <host>would execute — without touching any host, SSH, scp, pacman, or reboot.What --render computes
manifest.lock(produced byka-promote <host>, expected atbuild/<host>/<baseline_ref>/manifest.lock)manifest.lock's resolved hash match the package that was actually built?hertz:/sparfuxdata/kernel-agent-backups/<host>/<replaced_version>/vmlinuz, notImage(the ARM kernel filename) — detect which trigger path appliesExplicitly out of scope (NOT in this issue)
scp/rsyncof files to any hostpacman -U/aptpackage installationThese remain a separate, future, human-gated issue that will extend ka-install with the execution half.
Acceptance
ka-install <host> --renderprints a plan and exits 0Imagevsvmlinuznaming and selects the correct mkinitcpio triggertests/ka-install/fixtures/Implementation report
Closes #38.
What was done
New file:
bin/ka-install(243 lines, Python3)Read-only install-plan computation engine. Always --render mode (never executes).
fleet/<host>.yamlfor package metadata (name, versioning template, kernel suffix, boot path, bootloader, backup target)build/<host>/<baseline>/manifest.lock(produced by ka-promote)build.packages)backup.pre_installtemplateImage(ARM64, default) vsvmlinuz(x86, heuristic via kernel_suffix)mkinitcpio -P --hook vmlinuz=Imagefor ARM (stock hook watches vmlinuz, not Image), plainmkinitcpio -Pfor x86Exit codes: 0 (plan ready), 2 (missing input), 3 (drift), 4 (parse error).
New file:
tests/ka-install/run-tests.sh(337 lines, Bash)20 hermetic tests covering every acceptance criterion:
New file:
tests/ka-install/fixtures/make-sandbox.sh(275 lines, Bash)Fixture builder for hermetic sandboxed test trees. Supports 6 fixtures:
happy-path— full build receipt presentdrift— manifest.lock without build receiptno-manifest-lock— fleet manifest present, no build outputno-host-manifest— build receipt present, fleet yaml missingimage-detection— x86-style kernel_suffix for vmlinuz testampere-boot-firmware— /boot/firmware/ path layoutExisting tests unaffected
tests/ka-promote/run-tests.sh: 6/6 PASS (unchanged)tests/ka-build/run-tests.sh: 3 PASS, 2 SKIP, 1 pre-existing failure (marfrit-packages not present on pica) — no regression