refactor(shared): adopt style guide rules around pub/module visibility - #4664
Merged
Conversation
This adopts the new style guide rules around module visibility introduced in NVIDIA#4522, applying the correct visibility throughout the remaining shared model and tooling crates. Primary callouts are: - Resolve all 47 compiler-proven findings across `xtask`, `api-model`, `uuid`, `api-db`, `libmlx`, `mqttea`, `libnmxm`, `libnmxc`, and `api` with private or `pub(super)` visibility based on actual callers. - Keep API/model DTO fields, intentional re-exports, UUID macros, and test-support surfaces public where downstream crates still use them. - Scope SQL row helpers, SLA constants, UUID wire adapters, xtask command internals, library implementation types, and test fixtures to the modules that use them. - Make the Switch and PowerShelf SLA modules private after direct caller review, along with the remaining private fields in the MQTT test messages. - Leave generated source, serialized data, wire contracts, and runtime behavior unchanged. Tests pass! This supports NVIDIA#4557. This supports the updated Rust visibility scoping guidelines in `STYLE_GUIDE.md`, established in NVIDIA#4522. Signed-off-by: Chet Nichols III <chetn@nvidia.com>
Contributor
Author
|
@coderabbitai full_review, thanks! |
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (31)
Summary by CodeRabbit
WalkthroughThe pull request narrows Rust visibility across internal database APIs, model constants, library wrappers, protobuf compatibility types, test fixtures, and xtask interfaces. Signatures, data shapes, values, and runtime behavior remain unchanged. ChangesVisibility narrowing
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Contributor
|
🐇 ✅ Action performedFull review finished. |
10 tasks
chet
enabled auto-merge (squash)
August 6, 2026 14:33
poroh
approved these changes
Aug 6, 2026
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.
This adopts the new style guide rules around module visibility introduced in #4522, applying the correct visibility throughout the remaining shared model and tooling crates.
Primary callouts are:
xtask,api-model,uuid,api-db,libmlx,mqttea,libnmxm,libnmxc, andapiwith private orpub(super)visibility based on actual callers.Tests pass!
Related issues
This supports #4557.
This supports the updated Rust visibility scoping guidelines in
STYLE_GUIDE.md, established in #4522.Type of Change
Breaking Changes
Testing
The targeted unit, integration, and doc-test suites for all nine crates passed, including a post-review rerun for
api-modelandmqttea. I also ran:Additional Notes
The current
mainbaseline identified 47 overbroad declarations across these nine crates. The final 31-file diff also narrows adjacent fields and module boundaries with direct caller evidence. Nounreachable_pubwarning remains in the owned source trees.Public API/model DTO fields, intentional re-exports, UUID/version macros, generated source, and test support with downstream consumers remain unchanged. This does not change serialized data, wire contracts, or runtime behavior.
Local CodeRabbit returned zero findings. The independent read-only Claude review found two applicable follow-through items around private MQTT test fields and the Switch/PowerShelf SLA module boundaries; both are incorporated.
The review also proposed spelling the crate-root
loggingchild boundary aspub(crate)instead ofpub(super). That stayspub(super)because theSTYLE_GUIDE.mdcaller table maps parent-module callers and descendants topub(super); although both spellings reach the same callers for a crate-root child,pub(super)records the actual relationship.Closes #4557