Repository navigation
api: split admin node_maintenance.rs by route family (pure move) - #568
Conversation
1a61f75 to
123dfd6
Compare
node_maintenance.rs serves three admin route families beside the Direct node registry: node status, health and reconcile; node template pull and delete through the node-api, and listing from the cached template inventory; and the node-api client plumbing the registry and template routes use. Keep the registry handlers, the shared node row and response types, and the node reads in node_maintenance.rs, and move the rest into child modules: node_api, node_status and node_templates. Every line that touches a Direct-only table stays in node_maintenance.rs, so archcheck's direct_tables ratchet is unchanged. Generated by scripts/split_rust_module.py (#562) from the spec in the pull request. Items move verbatim. The only edits keep each item's reach: 137 private items, fields or methods become pub(super). The parent re-exports the moved items, so no caller changes.
The Kind node-api chart comment cites pull_node_template by file. It now lives in node_maintenance/node_templates.rs; require_admin_node_registry stays in node_maintenance.rs.
123dfd6 to
f90d4e1
Compare
nickdujay-pplx
left a comment
There was a problem hiding this comment.
Reviewed at f90d4e12b395b065d4bb0e49ad24f78c03798593; no blocking findings.
Verified all 93 original top-level items survive the split with their contents unchanged apart from the documented visibility adjustments and formatting. Checked public re-exports, route wiring, authorization/substrate guards, serde defaults and deserializers, RPC timeouts/error mapping, and SQL. The Helm values change is comments only.
Validation: reproduced the split across all 4 Rust files and ran the full API suite locally with real PostgreSQL and Redis, all features, and SPACE_CI_REQUIRE_TEST_DEPS=1: 1,826 passed, 0 skipped on macOS. Current CI is green, including all four Kind/Firecracker smoke shards.
No schema, configuration, or protocol migration is introduced, so this does not add a deployment-order or rollback dependency. The documented tracing-target and SQL/diagnostic-location changes remain; I found no exact old-target selectors in this repository.
ReviewNo findings. Verified against What I ran:
The non-Rust edits check out: What I didn't check: whether the grouping is the right one. That's a design call, and I took the body's word for it. I also didn't rebuild or retest the crate; CI is green on this head. |
the-gigi-pplx
left a comment
There was a problem hiding this comment.
Approved. No findings; details in the review comment above.
Summary
crates/libs/api/src/routes/admin/node_maintenance.rs(1,794 code lines) serves three admin route families besides the Direct node registry:This keeps the registry handlers and the shared node types in
node_maintenance.rsand moves the rest into three modules.node_maintenance.rsdrops to 665 code lines; the largest new file isnode_templates.rsat 509. Every line that touches a Direct-only table stays in the parent, so archcheck'sdirect_tablesratchet is unchanged.This is a pure move, generated by
scripts/split_rust_module.py(#562) from the spec below and proved by itsverify. It is part of splitting the largest production modules into smaller ones with one job each.What moved where
node_apinode_statusnode_templatesnode_maintenance.rs(parent)How to check it
The spec (item names, not lines):
The tool is
scripts/split_rust_module.pyfrom #562 (not on main yet).b9fc395e0, runsplit_rust_module.py apply spec.toml && cargo fmt --all. This reproduces the first commit.split_rust_module.py verify origin/main→regenerated and compared 4 files from 1 split parents: identical.verifyderives the spec from the diff, regenerates the split from the merge base, and requires HEAD's Rust files to equal the rustfmt'd result byte for byte.pub(super). Each keeps the reach the item had: one module deeper,pub(super)reaches exactly the old module.Observable changes
Log targets: 8
tracingevents without an explicittarget:now log under the new module paths (pplx_space_api::routes::admin::node_maintenance::<module>instead ofpplx_space_api::routes::admin::node_maintenance). Nothing in the repository selects on these targets exactly.sql!locators: the leading/*module:line*/comments of 6 moved statements now name the new module path.Comment:
space-node-api-local/values.yamlcitedpull_node_templateinnode_maintenance.rs; a docs commit points it atnode_maintenance/node_templates.rs.Diagnostics name new locations:
expect,unwrap,unreachable!, asserts) in moved code name the new file and line;code.filepath,code.linenoandcode.namespace;std::any::type_nameof a moved type names its new module;sql!locators that stay in the parent shift line numbers;The reviews found nothing in the repository that depends on these.
Validation
Run on a Linux development machine at the PR head:
cargo check --workspace --all-targets --all-features --locked: pass, no warnings.run_clippy_checkswith-D warnings: pass.cargo check -p pplx-space-api --no-default-features --all-targets: pass, with one unused-import warning atcontrollers/sandbox/mod.rs:1427that main has too.cargo nextest run -p pplx-space-api --all-featureswith Postgres, Redis andSPACE_CI_REQUIRE_TEST_DEPS=1: 1,827/1,827 passed with--run-ignored all(none skipped). The admin OpenAPI snapshot test passed unchanged.node_maintenance.rsmoves fromlisted_no_growthto a stalefile_sizeentry.Interactions
No open pull request touches
node_maintenance.rs.Follow-ups, kept out of this PR because
verifyallows no other Rust edits: comments inroutes/admin/support.rsandcontrollers/substrate/direct.rsstill citenode_maintenance.rsfor moved handlers.The archcheck
file_sizebaseline entry for this file is now stale (an advisory finding). Split PRs leave that table alone, so they don't conflict with each other there; one follow-up prunes the stale entries after they land.Rollback
Revert the commit(s). No data, configuration, wire or public API change.
🤖 Generated with Claude Code