refactor(health,observability): adopt style guide rules for pub/module visibility - #4665
Merged
Conversation
…e visibility This adopts the new style guide rules around `pub` and module visibility introduced in NVIDIA#4522, applying the correct visibility throughout Health and its supporting observability crates. Primary callouts are: - Replace unrestricted `pub` across `health`, `nras`, `logfmt`, `sqlx-query-tracing`, `secrets`, `log-parser`, and `dpu-otel-agent` with private, `pub(super)`, `pub(crate)`, or path-scoped visibility based on actual callers. - Keep downstream library interfaces and cross-module Health seams available while narrowing NVUE, gNMI, OTLP, and test-support internals to the modules that use them. - Move the NRAS integration helpers under `tests/common/` so Cargo no longer builds them as standalone zero-test binaries, then scope their fixtures and mocks to the integration test crate. - Remove the unused JWKS `crv` field and stale dead-code allowances whose Health callers are already in place. - Leave generated Health protobufs, HTTP/OTLP behavior, serialized responses, and other runtime behavior unchanged. Tests updated! This supports NVIDIA#4556. 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
|
✅ Action performedFull review finished. |
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 (24)
💤 Files with no reviewable changes (3)
Summary by CodeRabbit
WalkthroughThe change narrows Rust visibility across health, observability, and NRAS crates. It also centralizes NRAS integration-test fixtures and mocks. Runtime behavior remains unchanged. ChangesVisibility Scope Tightening
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
chet
enabled auto-merge (squash)
August 6, 2026 14:33
ianderson-nvidia
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
puband module visibility introduced in #4522, applying the correct visibility throughout Health and its supporting observability crates.Primary callouts are:
pubacrosshealth,nras,logfmt,sqlx-query-tracing,secrets,log-parser, anddpu-otel-agentwith private,pub(super),pub(crate), or path-scoped visibility based on actual callers.tests/common/so Cargo no longer builds them as standalone zero-test binaries, then scope their fixtures and mocks to the integration test crate.crvfield and stale dead-code allowances whose Health callers are already in place.Tests updated!
Related issues
This supports #4556.
This supports the updated Rust visibility scoping guidelines in
STYLE_GUIDE.md, established in #4522.Type of Change
Breaking Changes
Testing
All 517 targeted unit and integration tests passed. I also ran:
cargo test --locked -p carbide-health -p nras -p logfmt -p sqlx-query-tracing -p carbide-secrets -p carbide-log-parser -p carbide-dpu-otel-agent --all-features cargo clippy --locked -p carbide-health -p nras -p logfmt -p sqlx-query-tracing -p carbide-secrets -p carbide-log-parser -p carbide-dpu-otel-agent --all-targets --all-features -- --force-warn unreachable-pub cargo make format-nightly cargo make clippy cargo make carbide-lints git diff --checkAdditional Notes
The initial visibility lint identified 86 overbroad declarations across 17 hand-authored files. The final 24-file diff also includes the adjacent field and module boundaries exposed during review, the NRAS test-helper move, and the dead-code audit. No hand-authored visibility finding remains in the seven scoped crates.
The remaining strict-lint findings are unchanged from the baseline: 65 generated Health protobuf declarations and seven declarations in dependency crates owned by other campaign tasks. Generated Health protobufs remain untouched for #4547, and lint enforcement remains with #4558.
Local CodeRabbit returned no findings. The read-only Claude review completed over the full diff, and its applicable internal SSE, field, and module scoping suggestions are incorporated.
Closes #4556