registry: validate the optional preview_port field #17
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/inventory!17
Loading…
Reference in a new issue
No description provided.
Delete branch "agent/preview-port"
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?
The repository registry may now say which port a site is previewed on, and the registry check refuses a port that is malformed or used twice. Nothing changes on a running machine: no entry in
scripts/repositories.jsongains the field, and every script that reads the registry reads it as before.preview_port. Therepository-registrycheck refuses a value that is not an integer from 1024 to 65535, and refuses two repositories with the same one.vm-specs.json, every machine definition, and every existing rule of the check.allod/toolschange for the same issue lands.Refs allod/tools#240
Risk
R1. The change is confined to one flake check and the README. The worst credible failure is the check refusing a valid registry or accepting an invalid port; the first is visible at once as a red check, the second ends at
allod site previewfailing to bind. No machine state, secret or provisioning path is touched.Validation
nix build .#checks.x86_64-linux.repository-registry -L --no-link --rebuild: exit 0. The three new lines areOK: an invalid preview_port fails with its pinned diagnostic,OK: two repositories sharing a preview_port fail with a pinned diagnostic,OK: a valid preview_port passes validation.nix flake check:all checks passed!.ERROR: a preview_port outside 1024-65535 still passed validation. Restored.ERROR: two repositories sharing a preview_port still passed validation. Restored.null, so it also shows the field's presence is tested withhas(): a// emptytest would read that entry as having no port and accept it.Consumers of the registry
The issue asks for confirmation that readers are unaffected by an extra field. Every reader under the ten workspace repositories was read; each names the fields it wants, and the registry already carries one optional field,
hookspath.allod/toolscmd/allod/registry.gojson.Unmarshalinto a struct withcheckoutonly; unknown keys are ignoredallod/toolsgit-hooks/setup-tracked-hooksjqselect(.value.hookspath and .value.checkout), prints those two fieldsallod/nexusscripts/lib/resolve-repos.shjqon.source,.remote,.checkoutby name;bootstrap-vm,verify-vm,forge-ssh-key,vm-ssh-host-key,nexus-host-keyandrefresh-local-authgo through itallod/nexusscripts/pi-providerjqpredicate over the same three named fieldsNo Nix code imports the file, nothing decodes it strictly, and nothing writes it back. A copy of
allod/nexustests/registry-resolver.shwith"preview_port": 8080added to one fixture entry passed 15 of 15.Not run with the field in their fixtures:
allod/nexustests/pi-provider.sh,allod/toolstests/git-hooks/setup-tracked-hooks.shandtests/allod-patch.sh. Their readers are the ones in the table.No external review pass: R1.