Repository navigation
fix(sessions): one source for the zone's node-row labels - #2094
Conversation
The zone's node-row labels were spelled as bare literals in three places: minimald's switch read the host row's zone name from its own HOST_MIN_INTERNAL, minvmd's box registry keyed the node namespace from its own NODE_NAMESPACE, and sessions' reserved-name list re-spelled both labels by hand. A label changed in one registry but not the others would leave the reserved list silently out of date. The zone now owns the labels: zone_answer carries HOST_ROW_LABEL, HOST_ROW_NAME and NODE_ROW_LABEL, both daemons read their constants from it, and the store's reserved names read the same constants. A test pins the reserved list to every node-row label so a new label added to the zone fails the build until the list carries it, and a pin in the zone asserts the host row's zone name is its label under the apex. No behavior changes: every constant keeps its exact value. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 5 included reviews per hour; 0 remain after this review. < 8000 /details>📝 WalkthroughWalkthroughThe sessions zone module now defines shared constants for the host and managed-node row names. The daemon, VM registry, and reserved session-name list use those constants instead of duplicate literals. Tests check the names and their use in the reserved list. ChangesZone row-name constants
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Refactor Suggested reviewers: Merge Risk: ⚪ Minimal · up to The shared row-name constants preserve existing behavior across the inspected consumers; no merge-blocking risk was identified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
A rabbit checks the names in place, Comment |
… zone minvmd's answerer HOST_NAME, minimald's DNS HOSTNAME_SUFFIX and the CLI resolver's ZONE spelled the zone name by hand; they now alias the sessions zone_answer constants. Every value stays byte-identical, pinned by a test per crate. The minimald test also pins sandbox2's host-net /etc/hosts name and the gvproxy config's zone record to the zone.
|
/review |
|
Approved: no findings at Nothing to do. Clobber: none: |
|
/review |
Routing-Key: inbox-route/I_kwDOSUhdos8AAAABVj7BcA
Summary
The zone's node-row labels were spelled as bare literals in three places:
the host daemon kept the host row's zone name in its own constant, the VM
daemon's box registry keyed its node namespace from its own constant, and
the sessions store's reserved-name list re-spelled both labels by hand — so
a label changed in one registry could silently drift from the others.
The zone now owns the labels.
sessions::core::zone_answercarriesHOST_ROW_LABEL,HOST_ROW_NAME,NODE_ROW_LABEL, and theNODE_ROW_LABELSlist; both daemons readtheir constants from it, and
RESERVED_SESSION_NAMESreads the sameconstants. A new store test iterates
NODE_ROW_LABELSand pins the reserved list toevery entry, so a label added there without a matching reserved entry fails
the test, and a zone test pins the host row's name as its label under the
apex.
No behavior changes: every constant keeps its exact value.
The same drift sat at three more sites, now folded onto the zone too:
minvmd's answererHOST_NAMEaliasesHOST_ROW_NAME, andminimald'sDNS
HOSTNAME_SUFFIXand the CLI resolver'sZONEaliasZONE_APEX. Atest per crate pins each value byte for byte; the
minimaldtest also pinssandbox2's host-net/etc/hostsname and the gvproxy config's zone record(crates that do not depend on
sessions) to the zone's constants. Those twokeep their own literals; the Linux-only
minimaldtest is what ties them tothe zone.
Verification
cargo fmt --all --check --manifest-path target/Cargo.toml— cleancargo clippy --workspace --all-targets --locked --manifest-path target/Cargo.toml -- -D warnings— clean, no warningscargo test --locked --manifest-path target/Cargo.toml -p sessions -p minimald -p minvmd— sessions 582/582 pass (including both new tests); minvmd box_registry 22/22 pass; minimald 875 pass plus a set of 11–13 failures that reproduce identically on unmodifiedmain(A/B-verified by reverting the edits and re-running), all in unrelated networking tests that fail only when run together in this environmentSummary by CodeRabbit