Port and deploy flake-update-cascade as a Go binary #159
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
allod/tools#159
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?
Replace
flake-update-cascadewith a standard-library-only Go binary while preserving its fail-safe multi-repository update workflow, then deploy it and retire the Bash implementation.Primary goals:
flake-update-cascadework split from issue allod/tools#98.--pr, and--dry-runkeep their current flags, output, exit behavior, multi-input semantics, branch handling, and one-combined-update-per-repository contract.allod/toolsPR that removes the verified Bash implementation carries the closing keyword.Current state and contracts
flake/flake-update-cascadeis a 513-line Bash state machine. It sourceslib/workspace.sh, walks reachable direct pins throughflake.lock, checks every repository before mutation, serializes per-repository runs withflock, and then drivesnix,git, and optionallyforge. It owns direct commits, dry-run temporary locks, PR branch creation and lease-protected updates, evaluation checks, and rollback paths.The executable contract is spread across
tests/flake/flake-update-cascade/*.sh,tests/flake/flake-update-cascade-multiple-inputs.sh, andtests/flake/flake-update-cascade-follows.sh;flake/README.mdandflake/flake-update-cascade --helpare the human-facing contract. All of those suites are in scope: the directory-only glob in the old migration plan misses the multiple-input and follows-collapse witnesses.The deployed command is still assembled with
writeShellApplication:allod/archetypesmodules/dev-home-shared.nix:61-65for development machines andallod/nexusnix/home.nix:54-58for the host. Both wrappers prepend the shared workspace library. The Go implementation must preserveworkspace_collect_reposdiscovery and ordering semantics while keepingnix,git, andforgeas explicit subprocess boundaries.Freeze current behavior at implementation start. Preserve multiple requested input names, reachable-pin and
followsresolution, active-PR and protected-branch skips, dirty/branch/unpushed preflight failures, per-repository exclusion locking, combined updates, evaluation gates, deterministic output order, force-with-lease PR updates, and checkout restoration. The noninteractive foreign-nixConfigand interruptibility behavior repaired by issue allod/tools#143 is part of the contract. A correctness bug still open when implementation starts may diverge only with a regression test and an explicit PR-body note.Validation and deployment
Parameterize every cascade suite with
CASCADE_UNDER_TESTand run the same scenarios against Bash and Go. Compare stdout, stderr, exit status, command traces, resulting locks, branches, commits, and working-tree state. Add explicit witnesses for direct mode; dry-run immutability; preflight atomicity; multiple inputs; a pin collapsing tofollows; Nix update failure; evaluation failure; push failure; timeout/interruption; lock contention; and restoration after every partially entered mutation path.Before cutover,
gofmt -l .,go vet ./...,go test ./..., all Bash oracle suites, all Go-target parity suites,nix build .#flake-update-cascade, and affected flake checks must pass. Consumer PRs switch only this command tobuildGoModuleand retain the Bash file for rollback. After the downstream lock updates and human rebuilds, verify thatcommand -v flake-update-cascaderesolves to the Go package, run a no-change dry run on a development machine and nexus, and exercise the mutating path in a disposable fixture repository. Remove the Bash source only after those witnesses pass.Scope
In scope: the Go command and supporting internal packages in
allod/tools; parity, state-transition, and rollback tests; theallod/toolspackage output; theallod/archetypesandallod/nexuspackage switches; downstream lock updates and rebuild verification; documentation adjustments required by packaging; and final Bash retirement.Out of scope:
flake-status, new update modes or flags, changing branch-protection policy, changingforge, unrelated workspace-tool migrations, and the report-validator work in issue allod/tools#142.