[nomad-step-0] S0.1-fix — bin/disinto swallows --backend=nomad as repo_url positional #835
Labels
No labels
action
backlog
blocked
bug-report
cannot-reproduce
in-progress
in-triage
needs-triage
prediction/actioned
prediction/dismissed
prediction/unreviewed
priority
rejected
reproduced
tech-debt
underspecified
vision
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: disinto-admin/disinto#835
Loading…
Add table
Add a link
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?
Bugfix for S0.1 (#821). Discovered during Step 0 end-to-end verification on a fresh LXC.
Symptom
The error is nonsensical —
--backend=nomadis right there.Root cause
bin/disinto→disinto_init(around line 710) consumes the first positional arg asrepo_urlbefore the argparsewhileloop runs:So
disinto init --backend=nomad --emptybecomes:repo_url = "--backend=nomad"(swallowed)--emptyseen by loop →empty=truebackendstays at default"docker"empty=true && backend != "nomad"→ errorWhy repo_url is wrong for nomad
For
--backend=nomad, the cluster-up flow doesn't clone anything — the LXC already has the repo cloned by the operator.repo_urlis a docker-backend concept.Fix
In
disinto_init, move backend detection to before therepo_urlconsumption, and makerepo_urlconditional onbackend=docker:Simpler alternative: if first arg starts with
--, assume no positional and skip repo_url consumption entirely (covers nomad + any future--help-style invocation).Either shape is fine; pick the cleaner one.
Acceptance criteria
./bin/disinto init --backend=nomad --emptyrunslib/init/nomad/cluster-up.shwithout error on a clean LXC../bin/disinto init --backend=nomad --empty --dry-runprints the 9-step plan and exits 0../bin/disinto init <repo-url>(docker path) behaves identically to today — existing smoke path passes../bin/disinto init(no args, docker implied) still errors with the "repo URL required" message../bin/disinto init --backend=docker(no repo) errors helpfully — not "Unknown option: --backend=docker".Verified regression case from Step 0 testing
On a fresh Ubuntu 24.04 LXC, after
./lib/init/nomad/cluster-up.shwas invoked directly (workaround), the cluster came up healthy end-to-end:So the bug is isolated to
bin/disintoargparse; the rest of the Step 0 code path is solid. This fix unblocks the formal Step 0 acceptance test.Labels / meta
[nomad-step-0] S0.1-fix— no dependencies; gates Step 1.Affected files
bin/disinto—disinto_init()function, around line 710: pre-scan for--backendbefore consumingrepo_urlpositional argument