site serve and view: name the known sites when the id is missing or unknown #250
No reviewers
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!250
Loading…
Reference in a new issue
No description provided.
Delete branch "agent/site-name-known-sites"
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?
allod site viewandallod site servenow print the sites that have a preview when no site id is given or the id is not in the registry, so the id can be found from the command itself. Only messages and help text change; nothing that starts, stops or forwards a preview is touched.allod site viewwith no site,allod site serve --vm <name>with no site, and an unknown id in either command now list the known sites with their ports, and name the closest id when exactly one is close.Closes allod/tools#248
What it looks like
What changed
cmd/allod/site_list.go, new: the list, the closest-id rule, and the two messages.cmd/allod/site_view.go,cmd/allod/site_serve.go: the four call sites, one line each.cmd/allod/site_common.go: the usage block is rendered by a function both refusals share, and help text can name the registry file the running command actually reads.serve --helpandview --helpgain one paragraph: a site id is the repository's key underrepositoriesin the registry, with the path of that file.Decisions the issue left open:
example/badis two edits fromexample/bland made the prefix ofexample/blogambiguous.preview_portis malformed is listed, markedpreview_port is not usable. It is neither hidden nor allowed to stop the list.vm-specs.jsonis readable, and left out silently when it is not.allod site servewith no site and no--vmis unchanged: the site is the checkout the current directory sits in.Risk
R1. The change is confined to refusal paths that exit before anything is resolved, started or forwarded.
registryPath(), so on a dev VM it lists what that machine's registry holds. Which registry that is belongs to allod/archetypes#119.site_view.goandsite_serve.go, on different lines. Whichever merges second needs master merged into it first.Validation
Run on this branch at
99a55cf:go test ./...,go test -tags site ./...,go test -tags secret ./...,go test -tags site,secret ./..., each with-count=1: all seven packagesokin each of the four runs.go vet ./...andgofmt -l .: no output.allod check:All 11 steps passed (checks: 9 built)."preview_port": "80":site view,site serve --vm vm-one,site view example/bl,site view example/d,site view example. Each exits 1. The second and third nameexample/blogandexample/docs;example, which three ids contain, names none. Two of those runs are quoted above.The last commit changes comments only: no line outside a comment differs from
99a55cf, apart from blank lines. On it the fourgo testruns,go vetandgofmt -lwere repeated and are clean.allod checkand the runs by hand were not repeated on it.Not run: nothing on a second machine. None of these paths reaches
ssh,nixorsystemd-run.Review
R1, so no external reviewer. The integrator's read found the one-pool defect above by running the binary against a registry the tests did not have, and one fix round followed.
Owner request: cut down the verbose comments in this PR, as on allod/archetypes#120. Follow-up commit to come on this branch; no behaviour change.