Skip to content

feat: discover host NICs through nv-redfish adapter ports - #4534

Merged
chet merged 1 commit into
NVIDIA:mainfrom
chet:gh-issue-4469-nv-redfish
Aug 11, 2026
Merged

feat: discover host NICs through nv-redfish adapter ports#4534
chet merged 1 commit into
NVIDIA:mainfrom
chet:gh-issue-4469-nv-redfish

Conversation

@chet

@chet chet commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

This pulls together NVIDIA/nv-redfish#180, NVIDIA/nv-redfish#185, and NVIDIA/libredfish#118.

As it stood, Site Explorer's default nv-redfish path could only match a host NIC from the System EthernetInterfaces collection. Lenovo XCC can leave that collection without a usable MAC while reporting the physical address through NetworkAdapter Ports, which meant the NIC was in Redfish but never made it into host matching.

So, this teaches the default exploration path to fetch those adapter ports when the platform supports the fallback, the ComputerSystem explicitly links the chassis, and there is no usable System MAC. An interface only blocks the fallback when it is enabled (or omits InterfaceEnabled) and has a parseable MAC -- a disabled placeholder no longer hides the linked Port data.

The Port MACs stay on their NetworkAdapter inventory while EndpointExplorationReport::all_mac_addresses() exposes them to host matching. Persisted endpoint lookup indexes that inventory too, so early PXE and the other MAC-based lookup paths can find the host before it is owned. We still don't fabricate System interfaces or treat Port.Id as a boot selector, which keeps the workaround pretty tightly scoped.

Related issues

This supports #4469

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.)

cargo test -p bmc-explorer

cargo test -p carbide-site-explorer 'redfish::tests::' --lib

cargo test -p carbide-site-explorer default_nvredfish_mode_does_not_apply_lenovo_fallback_to_generic_ami --lib

cargo test -p carbide-api-model all_mac_addresses --lib

cargo test -p carbide-api-db find_by_mac_address_includes_adapter_ports --lib -- --nocapture

Additional Notes

Standard AssociatedMACAddresses data wins when it contains a usable MAC. Lenovo's PhysicalPortMacAddress is only read as a fallback, and Port links are fetched independently so one failed member does not hide valid siblings or fail the rest of BMC exploration.

Closes #4469

@copy-pr-bot

copy-pr-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Summary by CodeRabbit

  • New Features

    • Added network-adapter port MAC addresses to site exploration results and API responses.
    • Added Lenovo-specific fallback discovery for chassis-linked adapter ports when system MAC data is unavailable.
    • Preserved port-level MAC data on network adapters and included it in MAC-address searches.
    • Removed duplicate MAC addresses across systems, adapters, and ports.
  • Bug Fixes

    • Improved handling of missing, invalid, disabled, or unavailable MAC addresses without interrupting exploration.
    • Restricted supplemental port discovery to explicitly linked chassis.

Walkthrough

The exploration flow retrieves network-adapter ports from linked chassis for eligible Lenovo systems. It stores port MAC addresses on network adapters, deduplicates report MACs, serializes the new field through API and RPC models, and adds database, simulator, and integration coverage.

Changes

Network adapter port discovery

Layer / File(s) Summary
Port MAC collection
crates/bmc-explorer/..., crates/site-explorer/src/redfish.rs
Eligible Lenovo systems fetch ports from linked chassis. The explorer accepts standard associated MACs, falls back to Lenovo physical-port data, removes duplicates, and skips invalid resources.
Report and RPC modeling
crates/api-model/..., crates/rpc/..., rest-api/proto/...
Port MACs remain on network adapters. Endpoint reports combine unique system and port MACs. API and RPC models serialize the new field.
Port discovery validation
crates/bmc-mock/..., crates/redfish/..., crates/bmc-explorer/tests/..., crates/site-explorer/src/bmc_endpoint_explorer.rs, crates/api-db/...
Mocks and simulators provide linked chassis and port resources. Tests cover MAC precedence, filtering, invalid resources, vendor gating, BlueField behavior, database lookup, and serialization.

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

Sequence Diagram(s)

sequenceDiagram
  participant BMC
  participant RedfishExplorer
  participant ChassisExplorer
  participant AdapterExplorer
  participant EndpointReport
  BMC->>RedfishExplorer: return system chassis links and Ethernet interfaces
  RedfishExplorer->>ChassisExplorer: request ports for eligible linked chassis
  ChassisExplorer->>BMC: fetch network adapters and ports
  BMC-->>AdapterExplorer: return port resources
  AdapterExplorer-->>ChassisExplorer: return deduplicated port MAC addresses
  ChassisExplorer-->>EndpointReport: attach MACs to network adapters
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the primary change: discovering host NICs through nv-redfish network adapter ports.
Description check ✅ Passed The description accurately explains the fallback behavior, scope, data precedence, persistence changes, and added tests.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@chet chet changed the title Discover Host NICs Through NvRedfish Adapter Ports feat: discover host NICs through nv-redfish adapter ports Aug 4, 2026
@chet
chet marked this pull request as ready for review August 4, 2026 20:30
@chet
chet requested a review from a team as a code owner August 4, 2026 20:30
@chet

chet commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full_review, thanks!

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

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

ᕱ⑅ᕱ

✅ 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.

🧹 Nitpick comments (1)
crates/bmc-explorer/tests/integration/network_adapter_port_explore.rs (1)

44-100: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add malformed and duplicate MAC test cases.

The implementation skips malformed port MAC values and deduplicates repeated valid values. The current table does not exercise either recovery path. Add cases that assert malformed input does not fail exploration and repeated MAC values produce one port-derived interface.

As per coding guidelines, “Prefer table-driven tests, using scenarios!, value_scenarios!, check_cases, or check_values for grouped input variants and thorough coverage.”

🤖 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-explorer/tests/integration/network_adapter_port_explore.rs` around
lines 44 - 100, Extend the table-driven cases in the port exploration test to
cover a malformed port MAC that still allows exploration to succeed without
producing an invalid interface, and repeated valid MAC values that result in
exactly one port-derived interface. Use the existing case structure and
assertions, or the project’s established scenario helpers such as scenarios! or
check_cases, while preserving the current standard-data precedence coverage.

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.

Nitpick comments:
In `@crates/bmc-explorer/tests/integration/network_adapter_port_explore.rs`:
- Around line 44-100: Extend the table-driven cases in the port exploration test
to cover a malformed port MAC that still allows exploration to succeed without
producing an invalid interface, and repeated valid MAC values that result in
exactly one port-derived interface. Use the existing case structure and
assertions, or the project’s established scenario helpers such as scenarios! or
check_cases, while preserving the current standard-data precedence coverage.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: de949f59-dfbd-4d39-8008-d6715c850b77

📥 Commits

Reviewing files that changed from the base of the PR and between 6e21d6c and 4797a02.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (10)
  • Cargo.toml
  • crates/bmc-explorer/Cargo.toml
  • crates/bmc-explorer/src/chassis.rs
  • crates/bmc-explorer/src/computer_system.rs
  • crates/bmc-explorer/src/lib.rs
  • crates/bmc-explorer/src/network_adapter.rs
  • crates/bmc-explorer/tests/integration/main.rs
  • crates/bmc-explorer/tests/integration/network_adapter_port_explore.rs
  • crates/bmc-mock/src/test_support/mod.rs
  • crates/site-explorer/src/bmc_endpoint_explorer.rs

@chet
chet force-pushed the gh-issue-4469-nv-redfish branch from 4797a02 to 937a485 Compare August 7, 2026 07:14
@coderabbitai

coderabbitai Bot commented Aug 7, 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 7, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full_review, thanks!

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

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

ᕱ⑅ᕱ

⚠️ Action not completed

Review rate limited.

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

🔐 TruffleHog Secret Scan

No secrets or credentials found!

Your code has been scanned for 700+ types of secrets and credentials. All clear! 🎉

🔗 View scan details

🕐 Last updated: 2026-08-07 07:16:40 UTC | Commit: 937a485

@chet
chet force-pushed the gh-issue-4469-nv-redfish branch from 937a485 to e61689e Compare August 7, 2026 07:52
@chet

chet commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full_review, thanks!

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

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

ᕱ⑅ᕱ

⚠️ Action not completed

Review rate limited.


Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 6 minutes.

@coderabbitai coderabbitai Bot mentioned this pull request Aug 7, 2026
10 tasks
@chet
chet force-pushed the gh-issue-4469-nv-redfish branch from e61689e to 24a19cc Compare August 7, 2026 17:46
@chet

chet commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full_review, thanks!

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

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

ᕱ⑅ᕱ

✅ Action performed

Full review finished.

@coderabbitai coderabbitai Bot mentioned this pull request Aug 7, 2026
10 tasks
@chet
chet force-pushed the gh-issue-4469-nv-redfish branch from 24a19cc to 594639f Compare August 7, 2026 23:22
@chet

chet commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full_review, thanks!

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

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

ᕱ⑅ᕱ

✅ 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: 1

🧹 Nitpick comments (1)
crates/bmc-explorer/src/lib.rs (1)

1190-1253: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use value_scenarios! for this total predicate test.

should_use_network_adapter_port_fallback maps inputs to a boolean and cannot fail. Replace the manual Case loop with value_scenarios! to follow the repository test convention.

As per coding guidelines, “Use table-driven tests for functions mapping inputs to outputs or errors; use scenarios! for fallible operations, value_scenarios! for total operations, and direct helpers when macros obscure intent.”

🤖 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-explorer/src/lib.rs` around lines 1190 - 1253, The
should_use_network_adapter_port_fallback test is a total input-to-boolean
predicate but currently uses a manual Case loop. Replace the Case definition and
iteration in lenovo_network_adapter_port_fallback_is_narrow with the
repository’s value_scenarios! macro, preserving all existing input combinations,
expected results, linked chassis construction, and failure labels.

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/site-explorer/src/redfish.rs`:
- Line 282: Update the vendor handling around is_lenovo_xcc to retain and
inspect the vendor detected by service_root.vendor() before converting it to
BMCVendor, setting the flag for RedfishVendor::Lenovo while keeping LenovoAMI
and LenovoGB300 distinct. Add a LibRedfish test covering vendor: None with a
Lenovo XCC host.

---

Nitpick comments:
In `@crates/bmc-explorer/src/lib.rs`:
- Around line 1190-1253: The should_use_network_adapter_port_fallback test is a
total input-to-boolean predicate but currently uses a manual Case loop. Replace
the Case definition and iteration in
lenovo_network_adapter_port_fallback_is_narrow with the repository’s
value_scenarios! macro, preserving all existing input combinations, expected
results, linked chassis construction, and failure labels.
🪄 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: 85c4d70e-7e5c-4ddf-8e22-56c75f4bd00f

📥 Commits

Reviewing files that changed from the base of the PR and between c7ab1cc and 594639f.

⛔ Files ignored due to path filters (2)
  • Cargo.lock is excluded by !**/*.lock
  • rest-api/proto/core/gen/v1/site_explorer_nico.pb.go is excluded by !**/*.pb.go, !**/gen/**, !rest-api/**/*.pb.go
📒 Files selected for processing (20)
  • Cargo.toml
  • crates/api-model/src/site_explorer/mod.rs
  • crates/api-model/src/test_support/managed_host.rs
  • crates/bmc-explorer/Cargo.toml
  • crates/bmc-explorer/src/chassis.rs
  • crates/bmc-explorer/src/computer_system.rs
  • crates/bmc-explorer/src/lib.rs
  • crates/bmc-explorer/src/network_adapter.rs
  • crates/bmc-explorer/src/test_support.rs
  • crates/bmc-explorer/tests/integration/bluefield3_explore.rs
  • crates/bmc-explorer/tests/integration/main.rs
  • crates/bmc-explorer/tests/integration/network_adapter_port_explore.rs
  • crates/bmc-mock/src/test_support/mod.rs
  • crates/health/src/collectors/entity_metrics.rs
  • crates/redfish/src/libredfish/test_support.rs
  • crates/rpc/proto/site_explorer.proto
  • crates/rpc/src/model/site_explorer.rs
  • crates/site-explorer/src/bmc_endpoint_explorer.rs
  • crates/site-explorer/src/redfish.rs
  • rest-api/proto/core/src/v1/site_explorer_nico.proto

Comment thread crates/site-explorer/src/redfish.rs Outdated
@chet
chet force-pushed the gh-issue-4469-nv-redfish branch from 594639f to f872999 Compare August 7, 2026 23:41
@chet

chet commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full_review, thanks!

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

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

ᕱ⑅ᕱ

✅ 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: 1

🤖 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-explorer/src/computer_system.rs`:
- Around line 132-139: The Ethernet MAC fallback gates must ignore disabled
interfaces. In crates/bmc-explorer/src/computer_system.rs:132-139, update
has_usable_ethernet_mac_address to require
interface.interface_enabled().unwrap_or(true) alongside a parseable MAC; in
crates/site-explorer/src/redfish.rs:1128-1140, update
should_fetch_network_adapter_ports to require interface.interface_enabled !=
Some(false). Preserve the existing fallback behavior for enabled or unspecified
interfaces.
🪄 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: cdf9df47-482d-41fd-99b2-06c184778d73

📥 Commits

Reviewing files that changed from the base of the PR and between 70a9804 and f872999.

⛔ Files ignored due to path filters (1)
  • rest-api/proto/core/gen/v1/site_explorer_nico.pb.go is excluded by !**/*.pb.go, !**/gen/**, !rest-api/**/*.pb.go
📒 Files selected for processing (18)
  • crates/api-model/src/site_explorer/mod.rs
  • crates/api-model/src/test_support/managed_host.rs
  • crates/bmc-explorer/Cargo.toml
  • crates/bmc-explorer/src/chassis.rs
  • crates/bmc-explorer/src/computer_system.rs
  • crates/bmc-explorer/src/lib.rs
  • crates/bmc-explorer/src/network_adapter.rs
  • crates/bmc-explorer/src/test_support.rs
  • crates/bmc-explorer/tests/integration/bluefield3_explore.rs
  • crates/bmc-explorer/tests/integration/main.rs
  • crates/bmc-explorer/tests/integration/network_adapter_port_explore.rs
  • crates/bmc-mock/src/test_support/mod.rs
  • crates/redfish/src/libredfish/test_support.rs
  • crates/rpc/proto/site_explorer.proto
  • crates/rpc/src/model/site_explorer.rs
  • crates/site-explorer/src/bmc_endpoint_explorer.rs
  • crates/site-explorer/src/redfish.rs
  • rest-api/proto/core/src/v1/site_explorer_nico.proto

Comment thread crates/bmc-explorer/src/computer_system.rs
@chet

chet commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full_review, thanks!

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

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

ᕱ⑅ᕱ

✅ 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.

♻️ Duplicate comments (1)
crates/bmc-explorer/src/computer_system.rs (1)

132-139: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Both Lenovo fallback gates ignore disabled interfaces, so a placeholder MAC silently disables the fallback. has_usable_ethernet_mac_address and should_fetch_network_adapter_ports both treat any parseable MAC as usable, without checking interface_enabled. A disabled interface that reports a parseable placeholder MAC (for example 00:00:00:00:00:00) makes both gates report a usable System MAC, so the Lenovo network-adapter-port fallback never triggers even though the value is not a real host MAC. This gap was raised in a past review with a concrete reproduction and remains unresolved.

  • crates/bmc-explorer/src/computer_system.rs#L132-L139: require interface.interface_enabled().unwrap_or(true) alongside a parseable MAC in has_usable_ethernet_mac_address.
  • crates/site-explorer/src/redfish.rs#L1131-L1143: require interface.interface_enabled != Some(false) alongside interface.mac_address.is_some() in should_fetch_network_adapter_ports.

Add a disabled-interface-with-placeholder-MAC scenario to the existing test tables in both files (lenovo_network_adapter_port_fallback_is_narrow and network_adapter_port_fallback_gate_cases) to lock in the fix.

🤖 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-explorer/src/computer_system.rs` around lines 132 - 139, The
Lenovo fallback gates must ignore disabled interfaces with placeholder MACs. In
crates/bmc-explorer/src/computer_system.rs:132-139, update
has_usable_ethernet_mac_address to require
interface.interface_enabled().unwrap_or(true) alongside a parseable MAC; in
crates/site-explorer/src/redfish.rs:1131-1143, update
should_fetch_network_adapter_ports to require interface.interface_enabled !=
Some(false) alongside a present MAC. Add disabled-interface placeholder-MAC
cases to lenovo_network_adapter_port_fallback_is_narrow and
network_adapter_port_fallback_gate_cases.
🤖 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.

Duplicate comments:
In `@crates/bmc-explorer/src/computer_system.rs`:
- Around line 132-139: The Lenovo fallback gates must ignore disabled interfaces
with placeholder MACs. In crates/bmc-explorer/src/computer_system.rs:132-139,
update has_usable_ethernet_mac_address to require
interface.interface_enabled().unwrap_or(true) alongside a parseable MAC; in
crates/site-explorer/src/redfish.rs:1131-1143, update
should_fetch_network_adapter_ports to require interface.interface_enabled !=
Some(false) alongside a present MAC. Add disabled-interface placeholder-MAC
cases to lenovo_network_adapter_port_fallback_is_narrow and
network_adapter_port_fallback_gate_cases.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 806d9c8b-166a-4531-9fef-9a921d0d1733

📥 Commits

Reviewing files that changed from the base of the PR and between 33f2ccf and 183cbbe.

⛔ Files ignored due to path filters (1)
  • rest-api/proto/core/gen/v1/site_explorer_nico.pb.go is excluded by !**/*.pb.go, !**/gen/**, !rest-api/**/*.pb.go
📒 Files selected for processing (18)
  • crates/api-model/src/site_explorer/mod.rs
  • crates/api-model/src/test_support/managed_host.rs
  • crates/bmc-explorer/Cargo.toml
  • crates/bmc-explorer/src/chassis.rs
  • crates/bmc-explorer/src/computer_system.rs
  • crates/bmc-explorer/src/lib.rs
  • crates/bmc-explorer/src/network_adapter.rs
  • crates/bmc-explorer/src/test_support.rs
  • crates/bmc-explorer/tests/integration/bluefield3_explore.rs
  • crates/bmc-explorer/tests/integration/main.rs
  • crates/bmc-explorer/tests/integration/network_adapter_port_explore.rs
  • crates/bmc-mock/src/test_support/mod.rs
  • crates/redfish/src/libredfish/test_support.rs
  • crates/rpc/proto/site_explorer.proto
  • crates/rpc/src/model/site_explorer.rs
  • crates/site-explorer/src/bmc_endpoint_explorer.rs
  • crates/site-explorer/src/redfish.rs
  • rest-api/proto/core/src/v1/site_explorer_nico.proto

@chet
chet force-pushed the gh-issue-4469-nv-redfish branch from 183cbbe to 15f4727 Compare August 10, 2026 18:48
@chet

chet commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full_review, thanks!

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

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

ᕱ⑅ᕱ

⚠️ Action not completed

Review rate limited.


Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 31 minutes.

@chet

chet commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full_review if you can, thanks!

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

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

ᕱ⑅ᕱ

✅ 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.

🧹 Nitpick comments (1)
crates/api-model/src/site_explorer/mod.rs (1)

2565-2594: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use a table-driven test for all_mac_addresses.

This test maps an EndpointExplorationReport input to MAC-address output. Use value_scenarios! or check_values so additional ordering and duplicate cases are simple to add.

As per coding guidelines, “Use table-driven tests for functions mapping inputs to outputs or errors.”

🤖 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/api-model/src/site_explorer/mod.rs` around lines 2565 - 2594, Refactor
all_mac_addresses_combines_system_and_adapter_inventory_without_duplicates into
a table-driven test using the repository’s value_scenarios! or check_values
helper. Represent each EndpointExplorationReport input and expected MAC-address
output as a scenario, preserving the current ordering and duplicate-removal
assertion while making additional cases easy to add.

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.

Nitpick comments:
In `@crates/api-model/src/site_explorer/mod.rs`:
- Around line 2565-2594: Refactor
all_mac_addresses_combines_system_and_adapter_inventory_without_duplicates into
a table-driven test using the repository’s value_scenarios! or check_values
helper. Represent each EndpointExplorationReport input and expected MAC-address
output as a scenario, preserving the current ordering and duplicate-removal
assertion while making additional cases easy to add.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: c68cb694-8f42-4023-86c2-416201892d7b

📥 Commits

Reviewing files that changed from the base of the PR and between 46c6c2c and 15f4727.

⛔ Files ignored due to path filters (1)
  • rest-api/proto/core/gen/v1/site_explorer_nico.pb.go is excluded by !**/*.pb.go, !**/gen/**, !rest-api/**/*.pb.go
📒 Files selected for processing (18)
  • crates/api-model/src/site_explorer/mod.rs
  • crates/api-model/src/test_support/managed_host.rs
  • crates/bmc-explorer/Cargo.toml
  • crates/bmc-explorer/src/chassis.rs
  • crates/bmc-explorer/src/computer_system.rs
  • crates/bmc-explorer/src/lib.rs
  • crates/bmc-explorer/src/network_adapter.rs
  • crates/bmc-explorer/src/test_support.rs
  • crates/bmc-explorer/tests/integration/bluefield3_explore.rs
  • crates/bmc-explorer/tests/integration/main.rs
  • crates/bmc-explorer/tests/integration/network_adapter_port_explore.rs
  • crates/bmc-mock/src/test_support/mod.rs
  • crates/redfish/src/libredfish/test_support.rs
  • crates/rpc/proto/site_explorer.proto
  • crates/rpc/src/model/site_explorer.rs
  • crates/site-explorer/src/bmc_endpoint_explorer.rs
  • crates/site-explorer/src/redfish.rs
  • rest-api/proto/core/src/v1/site_explorer_nico.proto

@chet
chet force-pushed the gh-issue-4469-nv-redfish branch from 15f4727 to f0864f2 Compare August 10, 2026 21:49
@chet

chet commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full_review, thanks!

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

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

ᕱ⑅ᕱ

✅ 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.

🧹 Nitpick comments (1)
crates/api-model/src/site_explorer/mod.rs (1)

2565-2595: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Strengthen the test to actually exercise chassis MAC chaining.

The test seeds system_mac and adapter_mac in both systems[0].ethernet_interfaces and chassis[0].network_adapters[0].port_mac_addresses. Because the two sources contain the exact same MACs, the assertion assert_eq!(report.all_mac_addresses(), vec![system_mac, adapter_mac]) passes even if the .chain(...) call over self.chassis is removed from all_mac_addresses. The test name states it verifies combining system and adapter inventory, but it only proves deduplication, not that adapter MACs are actually included.

Use a MAC that exists only in port_mac_addresses and not in any ethernet_interfaces, so the assertion fails if the chassis chain is dropped.

🧪 Proposed fix to make the test meaningful
     fn all_mac_addresses_combines_system_and_adapter_inventory_without_duplicates() {
         let system_mac = "02:aa:bb:cc:dd:01".parse().unwrap();
         let adapter_mac = "94:6d:ae:53:cb:9b".parse().unwrap();
+        let unique_adapter_mac = "02:aa:bb:cc:dd:02".parse().unwrap();
         let report = EndpointExplorationReport {
             systems: vec![ComputerSystem {
                 ethernet_interfaces: vec![
                     EthernetInterface {
                         mac_address: Some(system_mac),
                         ..Default::default()
                     },
                     EthernetInterface {
                         mac_address: Some(adapter_mac),
                         ..Default::default()
                     },
                 ],
                 ..Default::default()
             }],
             chassis: vec![Chassis {
                 network_adapters: vec![NetworkAdapter {
-                    port_mac_addresses: vec![system_mac, adapter_mac],
+                    port_mac_addresses: vec![adapter_mac, unique_adapter_mac],
                     ..Default::default()
                 }],
                 ..Default::default()
             }],
             ..Default::default()
         };

-        assert_eq!(report.all_mac_addresses(), vec![system_mac, adapter_mac]);
+        assert_eq!(
+            report.all_mac_addresses(),
+            vec![system_mac, adapter_mac, unique_adapter_mac]
+        );
     }
🤖 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/api-model/src/site_explorer/mod.rs` around lines 2565 - 2595, Update
the test
all_mac_addresses_combines_system_and_adapter_inventory_without_duplicates so at
least one MAC address exists only in
chassis[0].network_adapters[0].port_mac_addresses and is absent from
systems[0].ethernet_interfaces. Adjust the expected vector to include that
chassis-only address while preserving duplicate coverage, ensuring the assertion
fails if all_mac_addresses removes the self.chassis chain.
🤖 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.

Nitpick comments:
In `@crates/api-model/src/site_explorer/mod.rs`:
- Around line 2565-2595: Update the test
all_mac_addresses_combines_system_and_adapter_inventory_without_duplicates so at
least one MAC address exists only in
chassis[0].network_adapters[0].port_mac_addresses and is absent from
systems[0].ethernet_interfaces. Adjust the expected vector to include that
chassis-only address while preserving duplicate coverage, ensuring the assertion
fails if all_mac_addresses removes the self.chassis chain.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 7925a129-99c7-4d09-8bf3-7c4ec2370e5b

📥 Commits

Reviewing files that changed from the base of the PR and between 7d3ffbd and f0864f2.

⛔ Files ignored due to path filters (1)
  • rest-api/proto/core/gen/v1/site_explorer_nico.pb.go is excluded by !**/*.pb.go, !**/gen/**, !rest-api/**/*.pb.go
📒 Files selected for processing (20)
  • crates/api-db/migrations/20260810143726_index_explored_endpoint_port_macs.sql
  • crates/api-db/src/explored_endpoints.rs
  • crates/api-model/src/site_explorer/mod.rs
  • crates/api-model/src/test_support/managed_host.rs
  • crates/bmc-explorer/Cargo.toml
  • crates/bmc-explorer/src/chassis.rs
  • crates/bmc-explorer/src/computer_system.rs
  • crates/bmc-explorer/src/lib.rs
  • crates/bmc-explorer/src/network_adapter.rs
  • crates/bmc-explorer/src/test_support.rs
  • crates/bmc-explorer/tests/integration/bluefield3_explore.rs
  • crates/bmc-explorer/tests/integration/main.rs
  • crates/bmc-explorer/tests/integration/network_adapter_port_explore.rs
  • crates/bmc-mock/src/test_support/mod.rs
  • crates/redfish/src/libredfish/test_support.rs
  • crates/rpc/proto/site_explorer.proto
  • crates/rpc/src/model/site_explorer.rs
  • crates/site-explorer/src/bmc_endpoint_explorer.rs
  • crates/site-explorer/src/redfish.rs
  • rest-api/proto/core/src/v1/site_explorer_nico.proto

Site Explorer's default nv-redfish path can now find an ordinary host NIC when the System EthernetInterfaces collection has no usable MACs but the chassis NetworkAdapter Ports do.

The fallback keeps System interfaces authoritative, prefers standard Port MACs before Lenovo OEM data, and fetches Port links independently so one failed member does not hide valid siblings.

This supports NVIDIA#4469

Signed-off-by: Chet Nichols III <chetn@nvidia.com>
@chet
chet force-pushed the gh-issue-4469-nv-redfish branch from f0864f2 to c346085 Compare August 11, 2026 00:04
@chet

chet commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full_review, thanks!

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

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

ᕱ⑅ᕱ

✅ 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.

🧹 Nitpick comments (2)
crates/bmc-explorer/src/network_adapter.rs (2)

1-1: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Both the nv-redfish and legacy libredfish port-MAC extraction paths dedup MAC addresses with the same if !result.contains(&mac_address) { result.push(mac_address); } pattern, and neither path has a test that proves this guard actually collapses a repeated MAC into a single entry. The referenced STYLE_GUIDE.md documentation explicitly requires conversion tests for "populated, duplicate, and empty port MAC lists"; the "duplicate" case is missing at both sites.

  • crates/bmc-explorer/src/network_adapter.rs#L172-219: add an integration test case (in crates/bmc-explorer/tests/integration/network_adapter_port_explore.rs) where two ports on the same adapter (or one port's AssociatedMACAddresses list) report the same MAC address, and assert the adapter's port_mac_addresses contains exactly one entry.
  • crates/site-explorer/src/redfish.rs#L1145-1201: add the equivalent case for fetch_network_adapter_port_mac_addresses, asserting a single deduplicated entry when the simulator returns a repeated MAC across ports.

As per path instructions, STYLE_GUIDE.md states: "add or update focused conversion tests for populated, duplicate, and empty port MAC lists."

🤖 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-explorer/src/network_adapter.rs` at line 1, Add focused
duplicate-MAC conversion tests for both network adapter paths: the integration
coverage around the port exploration flow in network_adapter_port_explore.rs and
the fetch_network_adapter_port_mac_addresses test flow in redfish.rs. Configure
repeated MAC data across ports or within AssociatedMACAddresses, then assert
port_mac_addresses contains exactly one entry; preserve existing populated and
empty cases.

Source: Path instructions


172-219: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add a duplicate-MAC test case for port_mac_addresses.

port_mac_addresses dedups MAC addresses across ports with if !result.contains(&mac_address) { result.push(mac_address); }, but no test exercises two ports (or one port's AssociatedMACAddresses list) reporting the same MAC. Add a case to the integration suite that supplies a duplicate MAC across two ports and asserts a single entry in the result.

This finding is expanded in the consolidated comment covering the parallel implementation in crates/site-explorer/src/redfish.rs.
As per path instructions, STYLE_GUIDE.md states: "add or update focused conversion tests for populated, duplicate, and empty port MAC lists."

🤖 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-explorer/src/network_adapter.rs` around lines 172 - 219, Add a
focused integration test for NetworkAdapter::port_mac_addresses that provides
the same MAC through two distinct Port resources and asserts the returned vector
contains that MAC exactly once. Keep the test alongside the existing
populated/empty port MAC conversion tests and preserve first-seen ordering.

Source: Path instructions

🤖 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.

Nitpick comments:
In `@crates/bmc-explorer/src/network_adapter.rs`:
- Line 1: Add focused duplicate-MAC conversion tests for both network adapter
paths: the integration coverage around the port exploration flow in
network_adapter_port_explore.rs and the fetch_network_adapter_port_mac_addresses
test flow in redfish.rs. Configure repeated MAC data across ports or within
AssociatedMACAddresses, then assert port_mac_addresses contains exactly one
entry; preserve existing populated and empty cases.
- Around line 172-219: Add a focused integration test for
NetworkAdapter::port_mac_addresses that provides the same MAC through two
distinct Port resources and asserts the returned vector contains that MAC
exactly once. Keep the test alongside the existing populated/empty port MAC
conversion tests and preserve first-seen ordering.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: a3749a7b-773b-4848-afbb-e0ba92b9c16d

📥 Commits

Reviewing files that changed from the base of the PR and between 9c20f22 and c346085.

⛔ Files ignored due to path filters (1)
  • rest-api/proto/core/gen/v1/site_explorer_nico.pb.go is excluded by !**/*.pb.go, !**/gen/**, !rest-api/**/*.pb.go
📒 Files selected for processing (20)
  • crates/api-db/migrations/20260810143726_index_explored_endpoint_port_macs.sql
  • crates/api-db/src/explored_endpoints.rs
  • crates/api-model/src/site_explorer/mod.rs
  • crates/api-model/src/test_support/managed_host.rs
  • crates/bmc-explorer/Cargo.toml
  • crates/bmc-explorer/src/chassis.rs
  • crates/bmc-explorer/src/computer_system.rs
  • crates/bmc-explorer/src/lib.rs
  • crates/bmc-explorer/src/network_adapter.rs
  • crates/bmc-explorer/src/test_support.rs
  • crates/bmc-explorer/tests/integration/bluefield3_explore.rs
  • crates/bmc-explorer/tests/integration/main.rs
  • crates/bmc-explorer/tests/integration/network_adapter_port_explore.rs
  • crates/bmc-mock/src/test_support/mod.rs
  • crates/redfish/src/libredfish/test_support.rs
  • crates/rpc/proto/site_explorer.proto
  • crates/rpc/src/model/site_explorer.rs
  • crates/site-explorer/src/bmc_endpoint_explorer.rs
  • crates/site-explorer/src/redfish.rs
  • rest-api/proto/core/src/v1/site_explorer_nico.proto

@chet
chet merged commit c79d042 into NVIDIA:main Aug 11, 2026
122 checks passed
Sinck pushed a commit to Sinck/infra-controller that referenced this pull request Aug 11, 2026
@chet
chet deleted the gh-issue-4469-nv-redfish branch August 11, 2026 17:41
nv-dmendoza pushed a commit that referenced this pull request Aug 11, 2026
> [!IMPORTANT]
> This PR cherry-picks two commits into `release/v2.1`:
> - c79d042 (#4534) -- discover host
NICs through nv-redfish adapter ports
> - e9c13b3 (#4788) -- verify pull
request secret-scan ranges

Site Explorer's default nv-redfish path can now find an ordinary host
NIC when the System EthernetInterfaces collection has no usable MACs but
the chassis NetworkAdapter Ports do. The fallback keeps System
interfaces authoritative, prefers standard Port MACs before Lenovo OEM
data, and fetches Port links independently so one failed member does not
hide valid siblings.

#4788 rides along because it fixes the secret-scan failure this branch
hits. `copy-pr-bot` can rewrite its synthetic PR branch, so
`github.event.before` is unusable and TruffleHog falls back to scanning
the whole repository -- on this branch that surfaced 117 unrelated
findings and failed `REST Secret Scan with TruffleHog` (and with it the
`rest-ci-pass` rollup) on every recent `release/v2.1` PR, merged ones
included. The resolver computes the current PR's merge-base and head for
both Core and REST synthetic scans, so the scan is scoped to this PR's
own commits.

## Related issues

This supports #4469 and
#4786

## Type of Change

- [x] **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

- [x] Unit tests added/updated
- [x] Integration tests added/updated
- [ ] Manual testing performed
- [ ] No testing required (docs, internal refactor, etc.)

`cargo test -p bmc-explorer` (30 passed, including the new
`network_adapter_port_explore` suite) and `cargo test -p
carbide-site-explorer 'redfish::tests::' --lib` (6 passed) pass on the
branch. `bash .github/ci/test-resolve-pr-scan-range.sh` passes, and both
workflow files still parse.

## Additional Notes

**#4534 -- three conflicts, all visibility drift.** `release/v2.1` does
not have #4662 (`refactor(bmc/console): adopt style guide rules for
pub/module visibility`), so `bmc-explorer` here still uses `pub` where
`main` uses `pub(crate)`. `chassis.rs` and `network_adapter.rs` keep
this branch's `pub` and take only the new `fetch_network_adapter_ports`
method and `ports` field; #4662 is style-only and is intentionally not
pulled in. `bluefield3_explore.rs` conflicted because #4534's new test
anchors directly after
`explore_bluefield3_ignores_invalid_system_interface_mac`, which belongs
to a different commit that is not on this branch -- only #4534's own
`explore_bluefield3_preserves_oem_mode_and_base_mac` is added here.

**#4788 -- one conflict in `.github/workflows/ci.yaml`,** because this
branch already carries #4715's earlier Core-only workaround. Resolved to
keep release-specific workflow behavior: #4788's resolver now backs
synthetic PR scans in both Core (`ci.yaml`) and REST (`rest-ci.yml`),
the existing Core tag-scan branch is preserved, and the resolver plus
its focused test come along. The surrounding CI steps in that hunk
(`check-ci-permissions.sh`, `check-core-ci-permissions.sh`,
`check-stale-ci-permissions.sh`, `check-ci-concurrency.sh`,
`test_check_ci_gate.py`, `check_ci_gate.py`) are from other commits and
reference scripts that do not exist on this branch, so they are
deliberately left out -- every script referenced by `ci.yaml` here
resolves.

**Migration is additive and safe.**
`20260810143726_index_explored_endpoint_port_macs.sql` sorts after this
branch's latest migration (`20260731143022`), so it appends without
disturbing existing checksums. It drops and recreates
`explored_endpoints_mac_addresses_idx`, and that index's pre-state is
byte-identical on `release/v2.1` and `main` (both from
`20260708172302_squash_snapshot.sql`), so the rebuild behaves the same
here.

**No dependency bump needed.** The adapter-port support this relies on
is already on the branch -- `nv-redfish` is pinned at `0.14.2`, matching
`main` (via #4785).
chet added a commit that referenced this pull request Aug 14, 2026
…4968)

Lenovo XCC can report usable onboard `ComputerSystem.EthernetInterfaces`
while exposing an installed ConnectX NIC only through a linked chassis
`NetworkAdapter.Port`. The adapter-Port fetch treated any usable System
MAC as proof that inventory was complete, so the declared NoDpu boot NIC
never reached `predicted_machine_interfaces`.

So, this leaves the existing no-usable-System-MAC fallback intact and
adds a separate supplemental case inside the same verified Lenovo +
`ComputerSystem.Links.Chassis` boundary. That case collects adapter
Ports even when usable System interfaces exist. Site Explorer still uses
System interfaces as Host candidates; it adds a Port MAC alongside them
only when that MAC was actually reported by hardware and
`ExpectedMachine` declares it as a Host interface. It does not
synthesize `EthernetInterfaces`, treat the declaration as an override,
or use a Port ID as a boot-interface ID.

A refreshed report can now add that MAC to an existing predicted host,
keep its boot target MAC-only, and leave already-managed hosts alone.
Retained boot metadata is consulted only when a predicted host has no
primary, so an unrelated stale record cannot replace a settled primary.

This means verified Lenovo XCC hosts fetch Ports from the explicitly
linked chassis on each exploration. That extra inventory work stays
behind the vendor + linked-chassis boundary because a generic chassis
Port is not necessarily a host/PXE interface.

Tests added!

## Related issues

This supports #4952

## Type of Change

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

## Breaking Changes

- [ ] **This PR contains breaking changes**

## Testing

- [x] Unit tests added/updated
- [x] Integration tests added/updated
- [ ] Manual testing performed
- [ ] No testing required (docs, internal refactor, etc.)

```bash
cargo test -p bmc-explorer -p carbide-site-explorer --lib
make core/tests TEST_ARGS="-p carbide-site-explorer --test integration zero_dpu::test_ -- --nocapture"
cargo make clippy
carbide-lints --all-targets --all-features
cargo make format-nightly
cargo make check-licenses
cargo make check-bans
cargo xtask check-workspace-deps
taplo fmt --check crates/site-explorer/Cargo.toml
```

## Additional Notes

This is the caller-side follow-up to #4469 and #4534, using the
adapter-Port inventory exposed by
[NVIDIA/nv-redfish#180](NVIDIA/nv-redfish#180).

Signed-off-by: Chet Nichols III <chetn@nvidia.com>
nv-dmendoza pushed a commit that referenced this pull request Aug 14, 2026
> [!IMPORTANT]
> This PR cherry-picks commit 1badba5
(#4968) into `release/v2.1`.

Lenovo XCC can report usable onboard `ComputerSystem.EthernetInterfaces`
while exposing an installed ConnectX NIC only through a linked chassis
`NetworkAdapter.Port`. The adapter-Port fetch treated any System MAC as
proof that inventory was complete, so the declared NoDpu boot NIC never
reached `predicted_machine_interfaces`.

So, this keeps the verified Lenovo + `ComputerSystem.Links.Chassis`
boundary, but collects adapter Ports as supplemental inventory even when
System interfaces exist. Site Explorer still uses System interfaces as
Host candidates; it adds a Port MAC alongside them only when that MAC
was actually reported by hardware and `ExpectedMachine` declares it as a
Host interface. It does not synthesize `EthernetInterfaces`, treat the
declaration as an override, or use a Port ID as a boot-interface ID.

A refreshed report can now add that MAC to an existing predicted host,
keep its boot target MAC-only, and leave already-managed hosts alone.
Retained boot metadata is consulted only when a predicted host has no
primary, so an unrelated stale record cannot replace a settled primary.

## Related issues

This supports #4952

## Type of Change

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

## Breaking Changes

- [ ] **This PR contains breaking changes**

## Testing

- [x] Unit tests added/updated
- [x] Integration tests added/updated
- [ ] Manual testing performed
- [ ] No testing required (docs, internal refactor, etc.)

`cargo test -p bmc-explorer -p carbide-site-explorer --lib` and the
`zero_dpu` integration tests pass on the branch.

## Additional Notes

**One conflict, in `crates/bmc-explorer/src/lib.rs`.** It was the test
module's `use super::{...}` list: the incoming side also imports
`should_fetch_bf4_chassis_except_irot_nic`, which #4968 does not add and
this branch does not have -- it comes from the BlueField-4 IRoT chassis
work on `main`. Resolved to this branch's existing names plus #4968's
new `should_fetch_supplemental_network_adapter_ports`; nothing else
references the BF4 helper here. The rest of the pick applied cleanly.

**Prerequisite is already on this branch.** #4968 builds on the
adapter-Port fetch from #4534, which landed here in #4832, so
`fetch_network_adapter_ports` is present and this is a true follow-on
rather than a partial backport.

`crates/site-explorer` picks up an `axum` dev dependency; it resolves
against this branch's existing workspace pin (`0.8.4`), so no
`Cargo.toml` workspace change was needed.
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.

Discover Host NICs Through NvRedfish Adapter Ports

2 participants