Skip to content

refactor(bmc-mock): adopt style guide rules for pub/module visibility - #4635

Merged
chet merged 1 commit into
NVIDIA:mainfrom
chet:gh-issue-4550
Aug 6, 2026
Merged

refactor(bmc-mock): adopt style guide rules for pub/module visibility#4635
chet merged 1 commit into
NVIDIA:mainfrom
chet:gh-issue-4550

Conversation

@chet

@chet chet commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

This adopts the new style guide rules around module visibility introduced in #4522, applying the correct visibility throughout BMC Mock.

Primary callouts are:

  • Replace unrestricted pub throughout crates/bmc-mock/src/** with private, pub(super), or pub(crate) visibility based on actual callers.
  • Keep the mock server/router, MachineInfo, injection controls, IPMI simulator, MAC pools, callback backends, and integration-test support public where they cross crate boundaries.
  • Make the hardware and Redfish implementation trees internal while keeping RackElevation and RackUnit available through intentional root re-exports.
  • Remove unused exports, helpers, and nonserialized state, including stale blanket dead-code allowances.
  • Preserve HTTP routes, serialized Redfish responses, supported test fixtures, deterministic MAC allocation, and runtime behavior.

Tests updated!

Related issues

This supports #4550.

This supports the updated Rust visibility scoping guidelines in STYLE_GUIDE.md, established in #4522.

The corresponding Machine-a-tron deployment-guide and setup-script credential-source corrections are tracked in #4633 so they can stay together behind the required reviewer boundary.

Type of Change

  • Add - New feature or capability
  • Change - Changes in existing functionality
  • Fix - Bug fixes
  • Remove - Removed features or deprecated functionality
  • Internal - Internal changes (refactoring, tests, docs, etc.)

Breaking Changes

  • This PR contains breaking changes

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed
  • No testing required (docs, internal refactor, etc.)

All 84 BMC Mock tests passed. I also checked every direct workspace consumer and ran:

cargo test --locked -p bmc-mock --all-targets --all-features
cargo check --locked -p bmc-mock --all-targets --all-features
cargo clippy --locked -p bmc-mock --all-targets --all-features -- -D unreachable-pub
RUSTDOCFLAGS='-D rustdoc::private_intra_doc_links -D rustdoc::broken_intra_doc_links' cargo doc --locked -p bmc-mock --no-deps --all-features
cargo make format-nightly
cargo make clippy
cargo make carbide-lints
git diff --check

Additional Notes

The initial visibility lint identified 397 overbroad declarations across 48 files. Narrowing the crate's root gateways exposed an additional internal Redfish frontier; the final 85-file diff includes that follow-through plus the directly related Machine-a-tron rustdoc correction. The only unrestricted public surfaces left are backed by cross-crate callers, integration-test consumers, or intentional root re-exports.

Local CodeRabbit and read-only Claude reviews completed over the full diff. All applicable findings are incorporated.

Closes #4550

@chet
chet requested review from a team as code owners August 5, 2026 22:46
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Summary by CodeRabbit

  • Documentation

    • Clarified that dpu_bmc_password applies to DPU BMC mocks and uses each model’s factory-default password when unset.
  • Refactor

    • Reduced exposure of internal mock hardware, Redfish, IPMI, routing, injection, and configuration APIs.
    • Removed obsolete public helpers and unused fields.
    • Preserved existing behavior and command-line options, with minor updates to generated hardware metadata.

Walkthrough

The pull request narrows public visibility across the BMC mock’s hardware, routing, state, Redfish, injection, and support APIs. It removes selected unused fields, constants, and state handling while preserving most runtime behavior. It also updates DPU password documentation.

Changes

BMC mock visibility and API cleanup

Layer / File(s) Summary
Module boundaries and shared state
crates/bmc-mock/src/{auth_router.rs,bmc_state.rs,command_line.rs,injection/*,ipmi.rs,json.rs,lib.rs,middleware_router.rs,tar_router.rs}
Internal types, fields, helpers, routers, and modules now use crate, parent-module, or private visibility.
Hardware models and NIC data
crates/bmc-mock/src/hw/*
Hardware models, NIC types, configuration methods, and hardware modules now use narrower visibility. MAT DPU NIC state was removed from generated NIC and PCIe data.
Machine information and support
crates/bmc-mock/src/machine_info.rs, crates/bmc-mock/src/mac_address_pool.rs, crates/bmc-mock/src/test_support/*
Machine-information helpers and support APIs use narrower visibility. Lenovo GB300 NVL MAC allocation consumes ten pool entries without storing them.
Redfish resources and builders
crates/bmc-mock/src/redfish/{mod.rs,resource.rs,collection.rs,chassis.rs,computer_system.rs,manager.rs,network_*.rs,pcie_device.rs,power_*.rs,processor.rs,sensor.rs}
Redfish resources, state types, builders, and builder methods are no longer broadly public. Selected unused fields and builder state were removed.
Redfish services and OEM routes
crates/bmc-mock/src/redfish/{account_service.rs,bios.rs,session_service.rs,update_service.rs,telemetry_service.rs,log_service.rs,serial_*.rs,thermal_subsystem.rs,virtual_media.rs,oem/*}
Service and OEM route helpers use crate or module visibility. Route behavior and serialized responses remain unchanged except for leak-detector state, which now serializes fixed Ok and OK values.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 9.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes address issue #4550 by narrowing BMC Mock visibility while preserving routes, serialized behavior, fixtures, and required interfaces.
Out of Scope Changes check ✅ Passed The changes remain within the visibility refactor, related cleanup, validation updates, and the documented rustdoc correction.
Title check ✅ Passed The title clearly identifies the visibility refactor in the bmc-mock crate.
Description check ✅ Passed The description directly explains the visibility changes, preserved behavior, testing, and related objectives.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@chet

chet commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full_review, thanks!

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

@chet I will perform a complete review of pull request #4635.

🐇

✅ Action performed

Full review finished.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
crates/bmc-mock/src/lib.rs (1)

61-61: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Update the remaining documentation reference. docs/development/machine-a-tron-deployment.md:213 still names DUMMY_FACTORY_DPU_PASSWORD, which no longer exists.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/bmc-mock/src/lib.rs` at line 61, Update the remaining documentation
reference at the machine-a-tron deployment instructions to replace
DUMMY_FACTORY_DPU_PASSWORD with the current configuration or credential name
used by the project; do not change unrelated documentation.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/bmc-mock/src/mac_address_pool.rs`:
- Around line 348-355: Restore public visibility for
MacAddressPool::allocate_range so downstream users retain the existing API,
while preserving its current allocation behavior through allocate_range_config
and Self::new_pool.

In `@crates/bmc-mock/src/machine_info.rs`:
- Around line 717-722: Update PoolConfig::new and the Lenovo-specific allocation
path to reject host_bits values below 4, since Lenovo requires 15 MAC
allocations and smaller pools exhaust. Preserve valid pool creation for
host_bits = 4, and add boundary tests covering rejection at host_bits = 3 and
acceptance at host_bits = 4.

In `@crates/bmc-mock/src/redfish/leak_detector.rs`:
- Around line 49-70: Update LeakDetector and its builder/to_json flow to retain
a configurable detector state instead of hardcoding "DetectorState": "OK";
restore the state-to-Status mapping so Warning and Critical states produce their
corresponding Redfish status values while preserving the existing OK behavior.
Add mock response coverage exercising Warning and Critical states so the
leak-detector collector paths are validated.

---

Outside diff comments:
In `@crates/bmc-mock/src/lib.rs`:
- Line 61: Update the remaining documentation reference at the machine-a-tron
deployment instructions to replace DUMMY_FACTORY_DPU_PASSWORD with the current
configuration or credential name used by the project; do not change unrelated
documentation.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: b8c67dad-13b3-445e-8aa2-e8d7d6a6b44d

📥 Commits

Reviewing files that changed from the base of the PR and between 424d38e and 20c2040.

📒 Files selected for processing (86)
  • crates/bmc-mock/src/auth_router.rs
  • crates/bmc-mock/src/bmc_state.rs
  • crates/bmc-mock/src/command_line.rs
  • crates/bmc-mock/src/hw/bluefield3.rs
  • crates/bmc-mock/src/hw/bluefield4.rs
  • crates/bmc-mock/src/hw/dell_poweredge_r750.rs
  • crates/bmc-mock/src/hw/dell_poweredge_r760_bf4.rs
  • crates/bmc-mock/src/hw/delta_power_shelf.rs
  • crates/bmc-mock/src/hw/dgx_gb300_nvl.rs
  • crates/bmc-mock/src/hw/dgx_vr_nvl.rs
  • crates/bmc-mock/src/hw/generic_ami.rs
  • crates/bmc-mock/src/hw/hpe_proliant_dl380a_gen11.rs
  • crates/bmc-mock/src/hw/lenovo_gb300_nvl.rs
  • crates/bmc-mock/src/hw/liteon_power_shelf.rs
  • crates/bmc-mock/src/hw/mod.rs
  • crates/bmc-mock/src/hw/nic.rs
  • crates/bmc-mock/src/hw/nic_intel_e810.rs
  • crates/bmc-mock/src/hw/nic_intel_i210.rs
  • crates/bmc-mock/src/hw/nic_intel_x550.rs
  • crates/bmc-mock/src/hw/nic_nvidia_cx7.rs
  • crates/bmc-mock/src/hw/nvidia_dgx_h100.rs
  • crates/bmc-mock/src/hw/nvidia_gb200.rs
  • crates/bmc-mock/src/hw/nvidia_gb300.rs
  • crates/bmc-mock/src/hw/nvidia_gbx00.rs
  • crates/bmc-mock/src/hw/nvidia_switch_n5700_ld.rs
  • crates/bmc-mock/src/hw/nvidia_switch_nd5200_ld.rs
  • crates/bmc-mock/src/hw/supermicro_gb300_nvl.rs
  • crates/bmc-mock/src/hw/wiwynn_gb200_nvl.rs
  • crates/bmc-mock/src/hw/wiwynn_gb200_nvl72_rack.rs
  • crates/bmc-mock/src/injection/mod.rs
  • crates/bmc-mock/src/injection/presets.rs
  • crates/bmc-mock/src/injection/store.rs
  • crates/bmc-mock/src/ipmi.rs
  • crates/bmc-mock/src/ipmi_sim.rs
  • crates/bmc-mock/src/json.rs
  • crates/bmc-mock/src/lib.rs
  • crates/bmc-mock/src/mac_address_pool.rs
  • crates/bmc-mock/src/machine_info.rs
  • crates/bmc-mock/src/middleware_router.rs
  • crates/bmc-mock/src/redfish/account_service.rs
  • crates/bmc-mock/src/redfish/assembly.rs
  • crates/bmc-mock/src/redfish/bios.rs
  • crates/bmc-mock/src/redfish/boot_option.rs
  • crates/bmc-mock/src/redfish/chassis.rs
  • crates/bmc-mock/src/redfish/collection.rs
  • crates/bmc-mock/src/redfish/computer_system.rs
  • crates/bmc-mock/src/redfish/ethernet_interface.rs
  • crates/bmc-mock/src/redfish/expander_router.rs
  • crates/bmc-mock/src/redfish/host_interface.rs
  • crates/bmc-mock/src/redfish/leak_detector.rs
  • crates/bmc-mock/src/redfish/log_service.rs
  • crates/bmc-mock/src/redfish/manager.rs
  • crates/bmc-mock/src/redfish/manager_network_protocol.rs
  • crates/bmc-mock/src/redfish/mod.rs
  • crates/bmc-mock/src/redfish/network_adapter.rs
  • crates/bmc-mock/src/redfish/network_device_function.rs
  • crates/bmc-mock/src/redfish/oem/dell/idrac.rs
  • crates/bmc-mock/src/redfish/oem/dell/mod.rs
  • crates/bmc-mock/src/redfish/oem/dell/network_device_function.rs
  • crates/bmc-mock/src/redfish/oem/mod.rs
  • crates/bmc-mock/src/redfish/oem/nvidia/bluefield.rs
  • crates/bmc-mock/src/redfish/oem/nvidia/mod.rs
  • crates/bmc-mock/src/redfish/oem/supermicro/manager.rs
  • crates/bmc-mock/src/redfish/oem/supermicro/mod.rs
  • crates/bmc-mock/src/redfish/pcie_device.rs
  • crates/bmc-mock/src/redfish/power_subsystem.rs
  • crates/bmc-mock/src/redfish/power_supply.rs
  • crates/bmc-mock/src/redfish/processor.rs
  • crates/bmc-mock/src/redfish/resource.rs
  • crates/bmc-mock/src/redfish/secure_boot.rs
  • crates/bmc-mock/src/redfish/sensor.rs
  • crates/bmc-mock/src/redfish/serial_console.rs
  • crates/bmc-mock/src/redfish/serial_interface.rs
  • crates/bmc-mock/src/redfish/service_root.rs
  • crates/bmc-mock/src/redfish/session_service.rs
  • crates/bmc-mock/src/redfish/software_inventory.rs
  • crates/bmc-mock/src/redfish/storage.rs
  • crates/bmc-mock/src/redfish/task_service.rs
  • crates/bmc-mock/src/redfish/telemetry_service.rs
  • crates/bmc-mock/src/redfish/thermal_subsystem.rs
  • crates/bmc-mock/src/redfish/update_service.rs
  • crates/bmc-mock/src/redfish/virtual_media.rs
  • crates/bmc-mock/src/tar_router.rs
  • crates/bmc-mock/src/test_support/mod.rs
  • crates/machine-a-tron/src/config.rs
  • helm-prereqs/setup-machine-a-tron.sh
💤 Files with no reviewable changes (1)
  • crates/bmc-mock/src/ipmi_sim.rs

Comment thread crates/bmc-mock/src/mac_address_pool.rs
Comment thread crates/bmc-mock/src/machine_info.rs
Comment thread crates/bmc-mock/src/redfish/leak_detector.rs

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
crates/bmc-mock/src/mac_address_pool.rs (1)

348-355: 🗄️ Data Integrity & Integration | 🟠 Major

Restore the public MacAddressPool::allocate_range API.

The production method was removed, but Lines 348-355 add the operation only as a private test helper. This keeps local tests passing while downstream callers lose the method at compile time. The cross-crate use of MacAddressPool in crates/machine-a-tron/src/config.rs Line 23 confirms that local call sites do not define the complete API boundary.

Keep a public production wrapper that delegates to allocate_range_config().map(Self::new_pool), or document and version this breaking change.

Proposed compatibility fix
 impl MacAddressPool {
+    pub fn allocate_range(&mut self) -> Result<Self, Error> {
+        self.allocate_range_config().map(Self::new_pool)
+    }
 }

As per coding guidelines and the PR objective, visibility changes must preserve required cross-crate APIs.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/bmc-mock/src/mac_address_pool.rs` around lines 348 - 355, Restore
MacAddressPool::allocate_range as a public production method rather than leaving
the current private test helper. Update the allocate_range method in impl
MacAddressPool to expose the existing wrapper that delegates to
allocate_range_config().map(Self::new_pool), preserving cross-crate callers
without changing the allocation behavior.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/bmc-mock/src/redfish/oem/nvidia/bluefield.rs`:
- Line 41: Make the ModeState declaration private by removing its pub(crate)
visibility modifier, while leaving the struct and its usages within bluefield.rs
unchanged.

---

Duplicate comments:
In `@crates/bmc-mock/src/mac_address_pool.rs`:
- Around line 348-355: Restore MacAddressPool::allocate_range as a public
production method rather than leaving the current private test helper. Update
the allocate_range method in impl MacAddressPool to expose the existing wrapper
that delegates to allocate_range_config().map(Self::new_pool), preserving
cross-crate callers without changing the allocation behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 9ec48681-2a52-4b9b-95e2-db1c0c43ef03

📥 Commits

Reviewing files that changed from the base of the PR and between 424d38e and 855013b.

📒 Files selected for processing (85)
  • crates/bmc-mock/src/auth_router.rs
  • crates/bmc-mock/src/bmc_state.rs
  • crates/bmc-mock/src/command_line.rs
  • crates/bmc-mock/src/hw/bluefield3.rs
  • crates/bmc-mock/src/hw/bluefield4.rs
  • crates/bmc-mock/src/hw/dell_poweredge_r750.rs
  • crates/bmc-mock/src/hw/dell_poweredge_r760_bf4.rs
  • crates/bmc-mock/src/hw/delta_power_shelf.rs
  • crates/bmc-mock/src/hw/dgx_gb300_nvl.rs
  • crates/bmc-mock/src/hw/dgx_vr_nvl.rs
  • crates/bmc-mock/src/hw/generic_ami.rs
  • crates/bmc-mock/src/hw/hpe_proliant_dl380a_gen11.rs
  • crates/bmc-mock/src/hw/lenovo_gb300_nvl.rs
  • crates/bmc-mock/src/hw/liteon_power_shelf.rs
  • crates/bmc-mock/src/hw/mod.rs
  • crates/bmc-mock/src/hw/nic.rs
  • crates/bmc-mock/src/hw/nic_intel_e810.rs
  • crates/bmc-mock/src/hw/nic_intel_i210.rs
  • crates/bmc-mock/src/hw/nic_intel_x550.rs
  • crates/bmc-mock/src/hw/nic_nvidia_cx7.rs
  • crates/bmc-mock/src/hw/nvidia_dgx_h100.rs
  • crates/bmc-mock/src/hw/nvidia_gb200.rs
  • crates/bmc-mock/src/hw/nvidia_gb300.rs
  • crates/bmc-mock/src/hw/nvidia_gbx00.rs
  • crates/bmc-mock/src/hw/nvidia_switch_n5700_ld.rs
  • crates/bmc-mock/src/hw/nvidia_switch_nd5200_ld.rs
  • crates/bmc-mock/src/hw/supermicro_gb300_nvl.rs
  • crates/bmc-mock/src/hw/wiwynn_gb200_nvl.rs
  • crates/bmc-mock/src/hw/wiwynn_gb200_nvl72_rack.rs
  • crates/bmc-mock/src/injection/mod.rs
  • crates/bmc-mock/src/injection/presets.rs
  • crates/bmc-mock/src/injection/store.rs
  • crates/bmc-mock/src/ipmi.rs
  • crates/bmc-mock/src/ipmi_sim.rs
  • crates/bmc-mock/src/json.rs
  • crates/bmc-mock/src/lib.rs
  • crates/bmc-mock/src/mac_address_pool.rs
  • crates/bmc-mock/src/machine_info.rs
  • crates/bmc-mock/src/middleware_router.rs
  • crates/bmc-mock/src/redfish/account_service.rs
  • crates/bmc-mock/src/redfish/assembly.rs
  • crates/bmc-mock/src/redfish/bios.rs
  • crates/bmc-mock/src/redfish/boot_option.rs
  • crates/bmc-mock/src/redfish/chassis.rs
  • crates/bmc-mock/src/redfish/collection.rs
  • crates/bmc-mock/src/redfish/computer_system.rs
  • crates/bmc-mock/src/redfish/ethernet_interface.rs
  • crates/bmc-mock/src/redfish/expander_router.rs
  • crates/bmc-mock/src/redfish/host_interface.rs
  • crates/bmc-mock/src/redfish/leak_detector.rs
  • crates/bmc-mock/src/redfish/log_service.rs
  • crates/bmc-mock/src/redfish/manager.rs
  • crates/bmc-mock/src/redfish/manager_network_protocol.rs
  • crates/bmc-mock/src/redfish/mod.rs
  • crates/bmc-mock/src/redfish/network_adapter.rs
  • crates/bmc-mock/src/redfish/network_device_function.rs
  • crates/bmc-mock/src/redfish/oem/dell/idrac.rs
  • crates/bmc-mock/src/redfish/oem/dell/mod.rs
  • crates/bmc-mock/src/redfish/oem/dell/network_device_function.rs
  • crates/bmc-mock/src/redfish/oem/mod.rs
  • crates/bmc-mock/src/redfish/oem/nvidia/bluefield.rs
  • crates/bmc-mock/src/redfish/oem/nvidia/mod.rs
  • crates/bmc-mock/src/redfish/oem/supermicro/manager.rs
  • crates/bmc-mock/src/redfish/oem/supermicro/mod.rs
  • crates/bmc-mock/src/redfish/pcie_device.rs
  • crates/bmc-mock/src/redfish/power_subsystem.rs
  • crates/bmc-mock/src/redfish/power_supply.rs
  • crates/bmc-mock/src/redfish/processor.rs
  • crates/bmc-mock/src/redfish/resource.rs
  • crates/bmc-mock/src/redfish/secure_boot.rs
  • crates/bmc-mock/src/redfish/sensor.rs
  • crates/bmc-mock/src/redfish/serial_console.rs
  • crates/bmc-mock/src/redfish/serial_interface.rs
  • crates/bmc-mock/src/redfish/service_root.rs
  • crates/bmc-mock/src/redfish/session_service.rs
  • crates/bmc-mock/src/redfish/software_inventory.rs
  • crates/bmc-mock/src/redfish/storage.rs
  • crates/bmc-mock/src/redfish/task_service.rs
  • crates/bmc-mock/src/redfish/telemetry_service.rs
  • crates/bmc-mock/src/redfish/thermal_subsystem.rs
  • crates/bmc-mock/src/redfish/update_service.rs
  • crates/bmc-mock/src/redfish/virtual_media.rs
  • crates/bmc-mock/src/tar_router.rs
  • crates/bmc-mock/src/test_support/mod.rs
  • crates/machine-a-tron/src/config.rs
💤 Files with no reviewable changes (1)
  • crates/bmc-mock/src/ipmi_sim.rs

Comment thread crates/bmc-mock/src/redfish/oem/nvidia/bluefield.rs
This adopts the new style guide rules around module visibility introduced in NVIDIA#4522, applying the correct visibility throughout BMC Mock.

Primary callouts are:
- Replace unrestricted `pub` throughout `crates/bmc-mock/src/**` with private, `pub(super)`, or `pub(crate)` visibility based on actual callers.
- Keep the mock server/router, `MachineInfo`, injection controls, IPMI simulator, MAC pools, callback backends, and integration-test support public where they cross crate boundaries.
- Make the hardware and Redfish implementation trees internal while keeping `RackElevation` and `RackUnit` available through intentional root re-exports.
- Remove unused exports, helpers, and nonserialized state, including stale blanket dead-code allowances.
- Preserve HTTP routes, serialized Redfish responses, supported test fixtures, deterministic MAC allocation, and runtime behavior.

Tests updated!

This supports NVIDIA#4550.

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>
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@chet

chet commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

The remaining deployment-guide reference called out in the review is tracked in #4633 together with the setup-script comment, since those paths share a separate reviewer boundary.

@chet
chet merged commit 850ea3a into NVIDIA:main Aug 6, 2026
64 checks passed
@chet
chet deleted the gh-issue-4550 branch August 6, 2026 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tighten BMC Mock Visibility

3 participants