Repository navigation
common-svc: split bootstrap.rs by facility (pure move) - #567
Merged
Merged
Conversation
bootstrap.rs collects five unrelated facilities that services use at startup: gRPC request parameter recording and logging, Unix socket binding, the HTTP trace layer, the gRPC trace layer and shutdown signal handling. Keep the gRPC server builder and health service in bootstrap.rs and move each facility into its own child module: grpc_request_params, unix_socket, http_trace, grpc_trace and shutdown. 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: 42 private items, fields or methods become pub(super). The parent re-exports the moved items, so no caller changes.
Two chart comments cite bootstrap.rs for replacing a node-local socket by rename. That code now lives in bootstrap/unix_socket.rs.
ac-pplx
force-pushed
the
ac/split-common-svc-bootstrap
branch
from
October 16, 2026 06:47
e4a801a to
cef5cb4
Compare
ac-pplx
marked this pull request as ready for review
October 16, 2026 14:49
Collaborator
ReviewNo findings. Verified against What I ran:
The non-Rust edits check out: the rename-based socket replacement is at 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
approved these changes
Oct 16, 2026
the-gigi-pplx
left a comment
Collaborator
There was a problem hiding this comment.
Approved. No findings; details in the review comment above.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
crates/libs/common/svc/src/bootstrap.rs(1,071 code lines) is named for when services use it, not for what it does. It holds five unrelated facilities with different callers:This keeps the gRPC server builder and health service in
bootstrap.rsand moves each facility into its own module.bootstrap.rsdrops to 77 code lines; the largest new file isunix_socket.rsat 338.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
grpc_request_paramsunix_sockethttp_tracegrpc_traceshutdownbootstrap.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 6 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: 9
tracingevents and 2 spans without an explicittarget:now log under the new module paths (pplx_space_common_svc::bootstrap::<module>instead ofpplx_space_common_svc::bootstrap). Nothing in the repository selects on these targets exactly.Request spans: the
grpc.serverandhttp.serverrequest spans every server opens are created inbootstrap/grpc_trace.rsandbootstrap/http_trace.rs; their names and fields are unchanged, only their callsite metadata.Comments: two Kind chart templates (
space-runtime-manager-local's daemonset andspace-node-service's_helpers.tpl) citedbootstrap.rsfor socket replacement by rename; a docs commit points both atbootstrap/unix_socket.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;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.run_clippy_checkswith-D warnings, including the common-svc--no-default-featuresrun: pass.cargo nextest run -p pplx-space-common-svc --all-featureswith Postgres andSPACE_CI_REQUIRE_TEST_DEPS=1: 278/278 passed, none skipped. The existingbootstrap/tests.rscalls the moved private helpers through the parent's re-exports, unchanged. No tests of this package are in the privileged group.cargo test --doc -p pplx-space-common-svc: 48/48 passed.file_sizeentry below.bootstrap::Xand the crate-root re-exports still resolve.Interactions
No open pull request touches
bootstrap.rs.Follow-ups, kept out of this PR because
verifyallows no other Rust edits: imports inbootstrap.rsthat only the child modules use could move to them; and a comment inpeer_auth.rsthat already named a non-existentGrpcServerMakeSpanbefore this PR.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