Repository navigation
internal-api: split data_plane_sessions.rs by RPC family (pure move) - #566
Merged
Merged
Conversation
ac-pplx
force-pushed
the
ac/split-internal-api-data-plane-sessions
branch
from
October 16, 2026 06:46
23e5b1a to
5545b28
Compare
data_plane_sessions.rs serves five unrelated ClusterApi RPC families: session route resolution, process binding and reconnects, revocation, runtime access, and the ECW sandbox service route with its reset and credential checks. Move each family, and the route-row and route-token helpers they share, into its own child module: session_route, route_rows, route_token, service_route, service_route_reset, ecw_authorization, process_binding, revocation and runtime_access. 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: 132 private items, fields or methods become pub(super); 8 pub(super) ones become pub(crate). The parent re-exports the moved items, so no caller changes.
…ssions.rs The split moves all seven direct_tables matches in data_plane_sessions.rs into data_plane_sessions/route_rows.rs. Re-key the ratchet entry to the new file with the same cap of 7.
node_api_backend_endpoint now lives in data_plane_sessions/route_rows.rs; repoint the network policy comment that cites it.
ac-pplx
force-pushed
the
ac/split-internal-api-data-plane-sessions
branch
from
October 16, 2026 07:12
5545b28 to
978be44
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: 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/internal/api/server/src/data_plane_sessions.rs(1,780 code lines) serves five unrelated ClusterApi RPC families. All of them are called only fromadapter.rs:This moves each family, and the route-row and route-token helpers they share, into its own module.
data_plane_sessions.rsdrops to 111 code lines; the largest new file isservice_route.rsat 388.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
session_routeroute_rowsroute_tokenservice_routeservice_route_resetecw_authorizationprocess_bindingrevocationruntime_accessdata_plane_sessions.rs(parent)required,optional), and the ingress activation helperssession_routeandservice_routeshareHow 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 10 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); 8pub(super)→pub(crate). Each keeps the reach the item had: one module deeper,pub(super)reaches exactly the old module.Observable changes
Log targets: none change; no moved event or span lacks an explicit
target:.sql!locators: the leading/*module:line*/comments of 12 moved statements now name the new module path.archcheck
direct_tablesratchet: all 7 lines that read a Direct-only table move todata_plane_sessions/route_rows.rs. A separate commit re-keys that baseline entry with the same cap, 7. Archcheck reports the re-keyed entry as an advisoryno_new_entriesfinding for a reviewer to accept, as the rule intends for a moved entry.Comment:
networkpolicy.yamlcitednode_api_backend_endpointindata_plane_sessions.rs; a docs commit points it atdata_plane_sessions/route_rows.rs.Diagnostics name new locations:
expect,unwrap,unreachable!, asserts) in moved code name the new file and line;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, no warnings.run_clippy_checkswith-D warnings: pass.cargo check -p pplx-space-internal-api-server --no-default-features --all-targets: pass.cargo nextest run -p pplx-space-internal-api-server --all-featureswith Postgres andSPACE_CI_REQUIRE_TEST_DEPS=1: 332/332 passed, none skipped.file_sizeentry below, and the re-keyeddirect_tablesentry above.Interactions
No open pull request touches
data_plane_sessions.rs.Follow-ups, kept out of this PR because
verifyallows no other Rust edits: imports indata_plane_sessions.rsthat only the child modules use could move to them.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