Skip to content

refactor(api): clean separation of host DPU policy from observed device mode#3453

Open
chet wants to merge 1 commit into
NVIDIA:mainfrom
chet:gh-issue-3447
Open

refactor(api): clean separation of host DPU policy from observed device mode#3453
chet wants to merge 1 commit into
NVIDIA:mainfrom
chet:gh-issue-3447

Conversation

@chet

@chet chet commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

HostDpuPolicy::{Manage, Nic, Ignore} is now the policy vocabulary across per-host and site configuration, the API model, clients, and site-explorer. Observed hardware state is BlueFieldOperatingMode::{Dpu, Nic}, so intent no longer shares a type name with what a card reports.

This remains backwards compatible across the configuration, wire, storage, and generated-client boundaries:

  • Forge intentionally retains only ExpectedMachine.dpu_mode field 16 and the original DpuMode symbols and numeric values. RPC code translates that stable compatibility shell directly into HostDpuPolicy.
  • Missing, unspecified, and unknown wire values retain the historical Manage default and site-policy inheritance behavior.
  • Configuration and admin JSON serialize canonical manage, nic, and ignore values while continuing to accept the previous use_as_nic value and legacy dpu_mode key and values.
  • Provider-local configuration normalization preserves global < site < environment precedence when old and new keys are mixed.
  • The admin CLI uses --dpu-policy manage|nic|ignore, accepts the previous use-as-nic value and legacy --dpu-mode dpu-mode|nic-mode|no-dpu spellings, and sends only the unchanged field 16 surface so new clients continue to work with old servers.
  • The protobuf and Redfish NicMode boundary retains its symbols and numeric meanings; model code uses BlueFieldOperatingMode for observed state.
  • The existing PostgreSQL column, enum type, and stored labels remain unchanged.
  • The existing registered_zero_dpu_for_nic_mode metric label remains unchanged.

There is deliberately no additive field 19 and no permanent dual-write compatibility window.

The Ignore discovery path also refreshes a stale boot-interface pair from a declared primary host NIC when one is available. This keeps zero-DPU hosts on the same primary-interface behavior as the other policy paths.

Validation includes focused model, configuration, admin CLI, RPC wire/descriptor, PostgreSQL decoding, and metric-label compatibility tests; the exact configuration-documentation regression test; nightly formatting; full workspace Clippy; custom Carbide lints; and independent reviews.

Documentation is split into #3473 for separate technical-writer review and must merge after this code PR.

Tests updated!

This supports #3447

@chet
chet requested a review from a team as a code owner July 13, 2026 21:49
@coderabbitai

coderabbitai Bot commented Jul 13, 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

Walkthrough

This change replaces legacy DPU modes with host and site DPU policies, preserves RPC and configuration compatibility, distinguishes policy from observed BlueField operating mode, and applies resolved policies to Site Explorer ingestion, CLI/API wiring, machine registration, persistence, and tests.

Changes

Host DPU policy migration

Layer / File(s) Summary
Policy contracts and compatibility
crates/api-model/src/expected_machine.rs, crates/site-explorer/src/config.rs, crates/rpc/src/model/expected_machine.rs, crates/api-core/src/cfg/*, crates/rpc/proto/*
Adds HostDpuPolicy, resolves per-host and site policies, stores canonical policy values, and accepts legacy dpu_mode inputs while preserving compatibility fields on the wire.
BlueField operating-mode model
crates/api-model/src/site_explorer/mod.rs, crates/bmc-explorer/*, crates/redfish/*, crates/rpc/src/model/site_explorer.rs
Replaces observed NicMode usage with BlueFieldOperatingMode, including serialization, Redfish conversion, RPC mapping, and reflection compatibility checks.
Policy-driven Site Explorer flow
crates/site-explorer/src/lib.rs, crates/site-explorer/src/endpoint_explorer.rs, crates/site-explorer/src/bmc_endpoint_explorer.rs, crates/preingestion-manager/src/lib.rs
Resolves effective host policies and applies them to zero-DPU ingestion, DPU attachment, operating-mode correction, endpoint gating, and boot-interface persistence.
CLI and machine registration
crates/admin-cli/src/expected_machines/*, crates/admin-cli/src/rpc.rs, crates/machine-a-tron/*
Introduces canonical --dpu-policy handling with legacy aliases, forwards policy values through API requests, renders policy vocabulary, and derives expected NICs and compatibility RPC values from policy.
Validation and regression coverage
crates/site-explorer/tests/integration/*, crates/api-core/tests/*, crates/api-model/src/*, crates/rpc/src/model/*
Updates policy, compatibility, database, operating-mode, zero-DPU, boot-interface, ingestion, and mode-correction tests.

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

Sequence Diagram(s)

sequenceDiagram
  participant Config
  participant ExpectedMachine
  participant SiteExplorer
  participant BlueField
  participant Database
  Config->>ExpectedMachine: provide site and per-host policy
  ExpectedMachine->>SiteExplorer: resolve effective HostDpuPolicy
  SiteExplorer->>BlueField: inspect and optionally set BlueFieldOperatingMode
  SiteExplorer->>Database: persist host, DPU, and boot-interface state
Loading

Possibly related PRs

  • NVIDIA/infra-controller#3486: Updates machine-a-tron NIC and zero-DPU classification plumbing that intersects with this policy-based registration flow.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Title check ✅ Passed It clearly summarizes the refactor from DPU mode to host policy separation and matches the main change set.
Description check ✅ Passed It is on-topic and describes the refactor, compatibility, and tests, despite minor terminology drift.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@chet

chet commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full_review, thanks!

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

@chet, understood — I'll redo the full review of this PR covering the HostDpuPolicy refactor and the updated test matrix.

ᕦ(ò_óˇ)ᕤ

✅ 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/site-explorer/src/lib.rs (1)

3342-3342: 📐 Maintainability & Code Quality | 🔵 Trivial

Log field renamed from host_dpu_mode to host_dpu_policy.

Structured logfmt searches keyed on the old host_dpu_mode field (dashboards/alerts) will silently stop matching after this rename. Worth a quick check that no saved queries or alert rules reference the old key before merging.

🤖 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/site-explorer/src/lib.rs` at line 3342, Check the structured logging
configuration around the host DPU field and update any dashboards, saved
queries, or alert rules that still reference host_dpu_mode to use
host_dpu_policy, preserving the renamed log field in the implementation.
🤖 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/site-explorer/src/lib.rs`:
- Line 3342: Check the structured logging configuration around the host DPU
field and update any dashboards, saved queries, or alert rules that still
reference host_dpu_mode to use host_dpu_policy, preserving the renamed log field
in the implementation.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 882d20b3-a647-4fc0-927a-40286cb382c4

📥 Commits

Reviewing files that changed from the base of the PR and between f70eada and aada16b.

📒 Files selected for processing (2)
  • crates/api-model/src/expected_machine.rs
  • crates/site-explorer/src/lib.rs

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown

🔍 Container Scan Summary

Service Total Critical High Medium Low Other
boot-artifacts-aarch64 3 0 0 3 0 0
boot-artifacts-x86_64 3 0 0 3 0 0
forge-admin-cli-x86_64 259 16 29 79 7 128
machine-a-tron 181 7 17 52 6 99
machine-validation-runner 532 39 113 184 15 181
machine_validation 532 39 113 184 15 181
machine_validation-aarch64 532 39 113 184 15 181
nvmetal-carbide 532 39 113 184 15 181
TOTAL 2574 179 498 873 73 951

Per-CVE detail lives in the per-service grype-* artifacts (JSON + SARIF). Severity counts only — no CVE IDs published here.

@chet

chet commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai Hey! Just making sure the full_review didn't surface any findings? Looks like it didn't? Lemme know. Thanks!

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
gh pr view 3453 --repo NVIDIA/infra-controller --json comments,reviews --jq '.reviews[] | {author: .author.login, body: .body, state: .state}'
echo "---review comments---"
gh api repos/NVIDIA/infra-controller/pulls/3453/comments --jq '.[] | {user: .user.login, path: .path, body: .body}'

Length of output: 3377


@chet, actually the full review did surface one finding — a nitpick on crates/site-explorer/src/lib.rs at Line 3342, flagging that the structured log field was renamed from host_dpu_mode to host_dpu_policy, and recommending a check that no dashboards/alerts/saved queries still key on the old field name before merging.

No actionable/major issues were raised on the HostDpuPolicy refactor logic itself or the test matrix — the core logic held up to scrutiny. Let me know if you'd like me to dig further into that nitpick or anything else.

ヽ(・∀・)ノ

@chet
chet requested a review from polarweasel as a code owner July 14, 2026 04:18
@chet

chet commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full_review, thanks!

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

@chet, understood — kicking off another full review of the PR.

✅ Action performed

Full review finished.

@github-actions

Copy link
Copy Markdown

@github-actions

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-07-14 04:20:07 UTC | Commit: ab33263

@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

🤖 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/admin-cli/src/expected_machines/add/args.rs`:
- Around line 167-174: The dpu_policy argument preserves the legacy flag name
but not its legacy value strings. Update HostDpuPolicy’s clap value metadata to
alias each historical DPU mode value to its corresponding current value,
ensuring old --dpu-mode invocations still parse; alternatively remove the help
text claim that legacy values remain accepted.

In `@crates/admin-cli/src/expected_machines/show/cmd.rs`:
- Around line 160-169: Update the dpu_policy_display conversion in the
expected-machine rendering flow so a successfully decoded
HostDpuPolicy::Unspecified value is explicitly converted to
HostDpuPolicy::Manage before calling to_possible_value(). Preserve the existing
fallback to Manage for absent or invalid wire values and keep the kebab-case
name generation unchanged.

In `@crates/api-core/src/tests/common/api_fixtures/site_explorer.rs`:
- Around line 1501-1505: Update the zero-DPU handling around config.dpus and
data.dpu_policy so it does not claim to preserve every explicit policy when
HostDpuPolicy::Manage cannot distinguish an omitted value from an explicit
Manage value. Either track whether dpu_policy was explicitly provided before
rewriting the default, or narrow the nearby comment and behavior to preserve
only explicitly configured non-Manage policies.
🪄 Autofix (Beta)

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: 3f38556b-6fae-437c-b998-67c9f44f0619

📥 Commits

Reviewing files that changed from the base of the PR and between aada16b and ab33263.

⛔ Files ignored due to path filters (1)
  • rest-api/proto/core/gen/v1/nico_nico.pb.go is excluded by !**/*.pb.go, !**/gen/**, !rest-api/**/*.pb.go
📒 Files selected for processing (42)
  • crates/admin-cli/src/expected_machines/add/args.rs
  • crates/admin-cli/src/expected_machines/common.rs
  • crates/admin-cli/src/expected_machines/patch/args.rs
  • crates/admin-cli/src/expected_machines/patch/mod.rs
  • crates/admin-cli/src/expected_machines/show/cmd.rs
  • crates/admin-cli/src/expected_machines/tests.rs
  • crates/admin-cli/src/expected_machines/update/mod.rs
  • crates/admin-cli/src/rpc.rs
  • crates/api-core/src/cfg/README.md
  • crates/api-core/src/cfg/file.rs
  • crates/api-core/src/handlers/bmc_endpoint_explorer.rs
  • crates/api-core/src/tests/common/api_fixtures/mod.rs
  • crates/api-core/src/tests/common/api_fixtures/site_explorer.rs
  • crates/api-core/src/tests/expected_machine.rs
  • crates/api-core/src/tests/machine_interfaces.rs
  • crates/api-core/src/tests/preingestion_dpu_nic_mode.rs
  • crates/api-core/src/tests/sku.rs
  • crates/api-db/src/expected_machine.rs
  • crates/api-db/src/expected_machine/tests.rs
  • crates/api-db/src/machine_interface.rs
  • crates/api-model/src/expected_machine.rs
  • crates/api-model/src/machine/mod.rs
  • crates/machine-a-tron/src/api_client.rs
  • crates/machine-a-tron/src/machine_a_tron.rs
  • crates/machine-controller/src/handler.rs
  • crates/rpc/build.rs
  • crates/rpc/proto/forge.proto
  • crates/rpc/src/model/expected_machine.rs
  • crates/site-explorer/src/config.rs
  • crates/site-explorer/src/lib.rs
  • crates/site-explorer/src/machine_creator.rs
  • crates/site-explorer/src/metrics.rs
  • crates/site-explorer/tests/integration/site_explorer.rs
  • crates/site-explorer/tests/integration/zero_dpu.rs
  • docs/glossary.md
  • docs/manuals/nico-admin-cli/commands/expected-machine/expected-machine-add.md
  • docs/manuals/nico-admin-cli/commands/expected-machine/expected-machine-patch.md
  • docs/manuals/vpc/flat_vpcs_zero_dpu.md
  • docs/observability/core_metrics.md
  • docs/provisioning/boot-interfaces-and-dpu-modes.md
  • docs/provisioning/ingesting-hosts.md
  • rest-api/proto/core/src/v1/nico_nico.proto
🚧 Files skipped from review as they are similar to previous changes (1)
  • crates/site-explorer/src/lib.rs

Comment thread crates/admin-cli/src/expected_machines/add/args.rs
Comment thread crates/admin-cli/src/expected_machines/show/cmd.rs Outdated
Comment thread crates/api-core/src/tests/common/api_fixtures/site_explorer.rs
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

@chet, got it — kicking off another full review of the PR now.

✅ 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 (2)
crates/admin-cli/src/expected_machines/show/cmd.rs (1)

160-169: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Still doesn't normalize Unspecified to Manage.

try_from(0) succeeds and returns Some(HostDpuPolicy::Unspecified), so .unwrap_or(Manage) only covers the "field absent" case, not an explicit wire 0. If Unspecified is a skipped ValueEnum variant (typical for proto defaults), to_possible_value() returns None and the table cell renders empty instead of "manage" — the same gap flagged on the predecessor dpu_mode_display/DpuMode version of this code.

🐛 Proposed fix
         let dpu_policy_display = expected_machine
             .dpu_mode
             .and_then(|i| ::rpc::forge::HostDpuPolicy::try_from(i).ok())
+            .filter(|policy| *policy != ::rpc::forge::HostDpuPolicy::Unspecified)
             .unwrap_or(::rpc::forge::HostDpuPolicy::Manage)
             .to_possible_value()
             .map(|pv| pv.get_name().to_owned())
             .unwrap_or_default();
🤖 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/admin-cli/src/expected_machines/show/cmd.rs` around lines 160 - 169,
Update the dpu_policy_display conversion to normalize both an absent value and
an explicitly decoded HostDpuPolicy::Unspecified to HostDpuPolicy::Manage before
calling to_possible_value(). Preserve the existing kebab-case name extraction
and default behavior for other valid policies.
crates/admin-cli/src/expected_machines/add/args.rs (1)

167-174: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Confirm HostDpuPolicy carries clap value aliases for the legacy strings.

visible_alias = "dpu-mode" only preserves the old flag name; it does nothing for the old value strings. The help text claims "legacy --dpu-mode flag and values remain accepted," and docs/manuals/vpc/flat_vpcs_zero_dpu.md repeats the same claim for dpu-mode/nic-mode/no-dpu. Unless HostDpuPolicy's #[derive(ValueEnum)] (defined outside this file, likely in crates/rpc) attaches #[value(alias = "nic-mode")]/#[value(alias = "no-dpu")]/#[value(alias = "dpu-mode")] per variant, --dpu-mode nic-mode will fail to parse — breaking the PR's stated backward-compatibility guarantee for legacy CLI values. A prior review round on this same code shape flagged exactly this gap as unresolved.

#!/bin/bash
set -euo pipefail
rg -n --hidden -S 'enum HostDpuPolicy' crates -g '*.rs' -A 25
rg -n --hidden -S '#\[value\(alias' crates -g '*.rs'
🤖 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/admin-cli/src/expected_machines/add/args.rs` around lines 167 - 174,
Update the HostDpuPolicy ValueEnum definition to attach clap value aliases for
each legacy value: nic-mode, no-dpu, and dpu-mode, mapped to their corresponding
current variants. Ensure parsing accepts these values through the legacy
--dpu-mode flag while preserving the current canonical values and the dpu_policy
argument declaration.
🧹 Nitpick comments (1)
crates/admin-cli/src/expected_machines/tests.rs (1)

500-599: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Add an add regression case for the legacy --dpu-mode alias

The parser still accepts --dpu-mode on add, but the table only exercises the legacy values on patch. Add a legacy add --dpu-mode ... scenario to keep the documented alias covered.

🤖 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/admin-cli/src/expected_machines/tests.rs` around lines 500 - 599, Add
a regression scenario to parse_dpu_policy_to_its_variant in
crates/admin-cli/src/expected_machines/tests.rs (lines 500-599) covering add
with the legacy --dpu-mode alias and asserting it maps to the corresponding
HostDpuPolicy variant; no direct change is required in
docs/manuals/nico-admin-cli/commands/expected-machine/expected-machine-add.md
(lines 117-133).
🤖 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/admin-cli/src/expected_machines/add/args.rs`:
- Around line 167-174: Update the HostDpuPolicy ValueEnum definition to attach
clap value aliases for each legacy value: nic-mode, no-dpu, and dpu-mode, mapped
to their corresponding current variants. Ensure parsing accepts these values
through the legacy --dpu-mode flag while preserving the current canonical values
and the dpu_policy argument declaration.

In `@crates/admin-cli/src/expected_machines/show/cmd.rs`:
- Around line 160-169: Update the dpu_policy_display conversion to normalize
both an absent value and an explicitly decoded HostDpuPolicy::Unspecified to
HostDpuPolicy::Manage before calling to_possible_value(). Preserve the existing
kebab-case name extraction and default behavior for other valid policies.

---

Nitpick comments:
In `@crates/admin-cli/src/expected_machines/tests.rs`:
- Around line 500-599: Add a regression scenario to
parse_dpu_policy_to_its_variant in
crates/admin-cli/src/expected_machines/tests.rs (lines 500-599) covering add
with the legacy --dpu-mode alias and asserting it maps to the corresponding
HostDpuPolicy variant; no direct change is required in
docs/manuals/nico-admin-cli/commands/expected-machine/expected-machine-add.md
(lines 117-133).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 77a51f7f-bb40-4bf2-ab5a-3b83ac9bb987

📥 Commits

Reviewing files that changed from the base of the PR and between c73cd19 and ab33263.

⛔ Files ignored due to path filters (1)
  • rest-api/proto/core/gen/v1/nico_nico.pb.go is excluded by !**/*.pb.go, !**/gen/**, !rest-api/**/*.pb.go
📒 Files selected for processing (42)
  • crates/admin-cli/src/expected_machines/add/args.rs
  • crates/admin-cli/src/expected_machines/common.rs
  • crates/admin-cli/src/expected_machines/patch/args.rs
  • crates/admin-cli/src/expected_machines/patch/mod.rs
  • crates/admin-cli/src/expected_machines/show/cmd.rs
  • crates/admin-cli/src/expected_machines/tests.rs
  • crates/admin-cli/src/expected_machines/update/mod.rs
  • crates/admin-cli/src/rpc.rs
  • crates/api-core/src/cfg/README.md
  • crates/api-core/src/cfg/file.rs
  • crates/api-core/src/handlers/bmc_endpoint_explorer.rs
  • crates/api-core/src/tests/common/api_fixtures/mod.rs
  • crates/api-core/src/tests/common/api_fixtures/site_explorer.rs
  • crates/api-core/src/tests/expected_machine.rs
  • crates/api-core/src/tests/machine_interfaces.rs
  • crates/api-core/src/tests/preingestion_dpu_nic_mode.rs
  • crates/api-core/src/tests/sku.rs
  • crates/api-db/src/expected_machine.rs
  • crates/api-db/src/expected_machine/tests.rs
  • crates/api-db/src/machine_interface.rs
  • crates/api-model/src/expected_machine.rs
  • crates/api-model/src/machine/mod.rs
  • crates/machine-a-tron/src/api_client.rs
  • crates/machine-a-tron/src/machine_a_tron.rs
  • crates/machine-controller/src/handler.rs
  • crates/rpc/build.rs
  • crates/rpc/proto/forge.proto
  • crates/rpc/src/model/expected_machine.rs
  • crates/site-explorer/src/config.rs
  • crates/site-explorer/src/lib.rs
  • crates/site-explorer/src/machine_creator.rs
  • crates/site-explorer/src/metrics.rs
  • crates/site-explorer/tests/integration/site_explorer.rs
  • crates/site-explorer/tests/integration/zero_dpu.rs
  • docs/glossary.md
  • docs/manuals/nico-admin-cli/commands/expected-machine/expected-machine-add.md
  • docs/manuals/nico-admin-cli/commands/expected-machine/expected-machine-patch.md
  • docs/manuals/vpc/flat_vpcs_zero_dpu.md
  • docs/observability/core_metrics.md
  • docs/provisioning/boot-interfaces-and-dpu-modes.md
  • docs/provisioning/ingesting-hosts.md
  • rest-api/proto/core/src/v1/nico_nico.proto

@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

🤖 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/rpc/proto/forge.proto`:
- Around line 6006-6034: Keep ExpectedMachine.dpu_mode declared with the
existing forge.DpuMode type instead of changing it to forge.HostDpuPolicy, while
preserving the compatible enum values and aliases. If the type change is
required, add the repository’s explicit breaking-change waiver for that field so
the buf breaking check accepts it.

In `@crates/site-explorer/src/lib.rs`:
- Around line 1274-1289: The primary boot-interface lookup currently occurs
after the HostDpuPolicy::Ignore early path, so ignored hosts do not refresh
last_explored.boot_interface_mac. Move the boot_interfaces lookup and update
logic before the Ignore check, alongside the existing nic_boot_interfaces
handling, while preserving the Ignore path’s remaining behavior.

In `@crates/site-explorer/src/metrics.rs`:
- Around line 48-49: Update the documentation for the blocker in the metrics
definition to explicitly identify the host policy as Manage, replacing the
broader “not Ignore” wording. Keep the description clear that it applies when
managed DPUs are expected and does not imply UseAsNic is invalid.
🪄 Autofix (Beta)

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: 77a51f7f-bb40-4bf2-ab5a-3b83ac9bb987

📥 Commits

Reviewing files that changed from the base of the PR and between c73cd19 and ab33263.

⛔ Files ignored due to path filters (1)
  • rest-api/proto/core/gen/v1/nico_nico.pb.go is excluded by !**/*.pb.go, !**/gen/**, !rest-api/**/*.pb.go
📒 Files selected for processing (42)
  • crates/admin-cli/src/expected_machines/add/args.rs
  • crates/admin-cli/src/expected_machines/common.rs
  • crates/admin-cli/src/expected_machines/patch/args.rs
  • crates/admin-cli/src/expected_machines/patch/mod.rs
  • crates/admin-cli/src/expected_machines/show/cmd.rs
  • crates/admin-cli/src/expected_machines/tests.rs
  • crates/admin-cli/src/expected_machines/update/mod.rs
  • crates/admin-cli/src/rpc.rs
  • crates/api-core/src/cfg/README.md
  • crates/api-core/src/cfg/file.rs
  • crates/api-core/src/handlers/bmc_endpoint_explorer.rs
  • crates/api-core/src/tests/common/api_fixtures/mod.rs
  • crates/api-core/src/tests/common/api_fixtures/site_explorer.rs
  • crates/api-core/src/tests/expected_machine.rs
  • crates/api-core/src/tests/machine_interfaces.rs
  • crates/api-core/src/tests/preingestion_dpu_nic_mode.rs
  • crates/api-core/src/tests/sku.rs
  • crates/api-db/src/expected_machine.rs
  • crates/api-db/src/expected_machine/tests.rs
  • crates/api-db/src/machine_interface.rs
  • crates/api-model/src/expected_machine.rs
  • crates/api-model/src/machine/mod.rs
  • crates/machine-a-tron/src/api_client.rs
  • crates/machine-a-tron/src/machine_a_tron.rs
  • crates/machine-controller/src/handler.rs
  • crates/rpc/build.rs
  • crates/rpc/proto/forge.proto
  • crates/rpc/src/model/expected_machine.rs
  • crates/site-explorer/src/config.rs
  • crates/site-explorer/src/lib.rs
  • crates/site-explorer/src/machine_creator.rs
  • crates/site-explorer/src/metrics.rs
  • crates/site-explorer/tests/integration/site_explorer.rs
  • crates/site-explorer/tests/integration/zero_dpu.rs
  • docs/glossary.md
  • docs/manuals/nico-admin-cli/commands/expected-machine/expected-machine-add.md
  • docs/manuals/nico-admin-cli/commands/expected-machine/expected-machine-patch.md
  • docs/manuals/vpc/flat_vpcs_zero_dpu.md
  • docs/observability/core_metrics.md
  • docs/provisioning/boot-interfaces-and-dpu-modes.md
  • docs/provisioning/ingesting-hosts.md
  • rest-api/proto/core/src/v1/nico_nico.proto

Comment thread crates/rpc/proto/forge.proto Outdated
Comment thread crates/site-explorer/src/lib.rs
Comment thread crates/site-explorer/src/metrics.rs Outdated
@chet

chet commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full_review, thanks!

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

@chet, on it — kicking off another full review of the PR now.

✅ 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/site-explorer/src/lib.rs (1)

1274-1298: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Ignore-policy hosts still skip the primary boot-interface refresh (past review comment only half-fixed).

A prior review flagged that HostDpuPolicy::Ignore (previously DpuMode) skips the block that refreshes the host's boot-interface hint, and asked to hoist it above the early continue — matching the nic_boot_interfaces treatment. This diff hoists nic_boot_interfaces.extend(...) (Line 1251) above the Ignore fast-path, but the primary boot-interface computation (fetch_host_primary_interface_macboot_interfaces.push(...), Lines 1572-1627) still lives after the Ignore continue (Line 1298), so it never runs for Ignore hosts.

Consequence: db::explored_endpoints::set_boot_interface is never called for Ignore hosts, so explored_endpoints.boot_interface_mac/boot_interface_id are never (re)populated, and the next explore_endpoint(...) call loses its "last known boot interface" hint for these hosts — contradicting the stated intent ("including a zero-DPU host whose primary boots from a plain NIC") that now only actually holds for nic_boot_interfaces.

Hoist the primary-interface lookup above the Ignore continue too (it can safely use an empty DPU list, since Ignore hosts never have managed DPUs), symmetric to the nic_boot_interfaces fix.

🐛 Proposed fix outline
             nic_boot_interfaces.extend(ep.report.complete_boot_interfaces());
 
+            // Resolve/record the primary boot interface before the `Ignore`
+            // fast-path continue, so zero-DPU-by-policy hosts still get their
+            // `explored_endpoints.boot_interface_mac`/`boot_interface_id` hint
+            // refreshed for the next site-explorer iteration.
+            let declared_primary = expected_explored_endpoint_index
+                .matched_expected_machine(&ep.address)
+                .and_then(|expected| expected.data.declared_primary_mac());
+            if let Some(mac_address) = ep
+                .report
+                .fetch_host_primary_interface_mac(&[], declared_primary)
+                && let Some(interface_id) = ep.report.find_interface_id_for_mac(mac_address)
+            {
+                boot_interfaces.push((
+                    ep.address,
+                    MachineBootInterface { mac_address, interface_id: interface_id.to_string() },
+                ));
+            }
+
             let host_dpu_policy = effective_policy(&ep.address);
             if matches!(host_dpu_policy, HostDpuPolicy::Ignore) {
                 ...
                 continue;
             }

Note: the later (non-Ignore) primary-interface block still needs to run with the real dpus_explored_for_host, so this hoisted call is additive, not a full replacement — dedupe carefully to avoid double-pushing for non-Ignore hosts.

Also applies to: 1563-1627

🤖 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/site-explorer/src/lib.rs` around lines 1274 - 1298, Move the
primary-interface lookup using fetch_host_primary_interface_mac above the
HostDpuPolicy::Ignore early continue, passing an empty DPU list and recording
its result in boot_interfaces so Ignore hosts refresh their boot-interface hint.
Retain the existing lookup for non-Ignore hosts with dpus_explored_for_host, but
guard or structure the flow to avoid duplicate boot-interface entries.
🧹 Nitpick comments (1)
crates/rpc/src/model/site_explorer.rs (1)

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

Consolidate the duplicated enum mapping.

Both conversions re-implement the identical Dpu/Nic mapping (one via as i32, the other via .into()). Extracting a single From<model::BlueFieldOperatingMode> for rpc::site_explorer::BlueFieldOperatingMode impl removes the duplication and keeps both call sites in sync if a variant is ever added.

♻️ Proposed consolidation
+impl From<BlueFieldOperatingMode> for rpc::site_explorer::BlueFieldOperatingMode {
+    fn from(mode: BlueFieldOperatingMode) -> Self {
+        match mode {
+            BlueFieldOperatingMode::Dpu => rpc::site_explorer::BlueFieldOperatingMode::Dpu,
+            BlueFieldOperatingMode::Nic => rpc::site_explorer::BlueFieldOperatingMode::Nic,
+        }
+    }
+}
+
 impl From<ExploredMlxDevice> for rpc::site_explorer::ExploredMlxDevice {
     fn from(device: ExploredMlxDevice) -> Self {
         rpc::site_explorer::ExploredMlxDevice {
             ...
-            nic_mode: device.nic_mode.map(|m| match m {
-                BlueFieldOperatingMode::Nic => {
-                    rpc::site_explorer::BlueFieldOperatingMode::Nic as i32
-                }
-                BlueFieldOperatingMode::Dpu => {
-                    rpc::site_explorer::BlueFieldOperatingMode::Dpu as i32
-                }
-            }),
+            nic_mode: device.nic_mode.map(|m| rpc::site_explorer::BlueFieldOperatingMode::from(m) as i32),
         }
     }
 }
 
 impl From<ComputerSystemAttributes> for rpc::site_explorer::ComputerSystemAttributes {
     fn from(attributes: ComputerSystemAttributes) -> Self {
         rpc::site_explorer::ComputerSystemAttributes {
-            nic_mode: attributes.nic_mode.map(|a| match a {
-                BlueFieldOperatingMode::Nic => {
-                    rpc::site_explorer::BlueFieldOperatingMode::Nic.into()
-                }
-                BlueFieldOperatingMode::Dpu => {
-                    rpc::site_explorer::BlueFieldOperatingMode::Dpu.into()
-                }
-            }),
+            nic_mode: attributes.nic_mode.map(|a| rpc::site_explorer::BlueFieldOperatingMode::from(a).into()),
         }
     }
 }
🤖 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/rpc/src/model/site_explorer.rs` around lines 181 - 206, Extract the
duplicated BlueFieldOperatingMode conversion into a single
From<model::BlueFieldOperatingMode> for
rpc::site_explorer::BlueFieldOperatingMode implementation. Update the nic_mode
mappings in the device and ComputerSystemAttributes conversions to reuse this
conversion, preserving the existing Nic and Dpu mappings and numeric output.
🤖 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/site-explorer/src/lib.rs`:
- Around line 1274-1298: Move the primary-interface lookup using
fetch_host_primary_interface_mac above the HostDpuPolicy::Ignore early continue,
passing an empty DPU list and recording its result in boot_interfaces so Ignore
hosts refresh their boot-interface hint. Retain the existing lookup for
non-Ignore hosts with dpus_explored_for_host, but guard or structure the flow to
avoid duplicate boot-interface entries.

---

Nitpick comments:
In `@crates/rpc/src/model/site_explorer.rs`:
- Around line 181-206: Extract the duplicated BlueFieldOperatingMode conversion
into a single From<model::BlueFieldOperatingMode> for
rpc::site_explorer::BlueFieldOperatingMode implementation. Update the nic_mode
mappings in the device and ComputerSystemAttributes conversions to reuse this
conversion, preserving the existing Nic and Dpu mappings and numeric output.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: f09cdc3b-0ecf-4670-adc2-c9e63e5530ca

📥 Commits

Reviewing files that changed from the base of the PR and between ab33263 and ac2c936.

⛔ Files ignored due to path filters (1)
  • rest-api/proto/core/gen/v1/nico_nico.pb.go is excluded by !**/*.pb.go, !**/gen/**, !rest-api/**/*.pb.go
📒 Files selected for processing (49)
  • crates/admin-cli/src/expected_machines/add/args.rs
  • crates/admin-cli/src/expected_machines/common.rs
  • crates/admin-cli/src/expected_machines/patch/args.rs
  • crates/admin-cli/src/expected_machines/patch/mod.rs
  • crates/admin-cli/src/expected_machines/show/cmd.rs
  • crates/admin-cli/src/expected_machines/tests.rs
  • crates/admin-cli/src/expected_machines/update/mod.rs
  • crates/admin-cli/src/rpc.rs
  • crates/admin-cli/src/site_explorer/mlx_devices/cmd.rs
  • crates/api-core/src/cfg/README.md
  • crates/api-core/src/cfg/file.rs
  • crates/api-core/src/handlers/bmc_endpoint_explorer.rs
  • crates/api-core/src/test_support/fixture_config.rs
  • crates/api-core/src/tests/common/api_fixtures/mod.rs
  • crates/api-core/src/tests/common/api_fixtures/site_explorer.rs
  • crates/api-core/src/tests/expected_machine.rs
  • crates/api-core/src/tests/machine_interfaces.rs
  • crates/api-core/src/tests/preingestion_dpu_nic_mode.rs
  • crates/api-core/src/tests/sku.rs
  • crates/api-core/tests/integration/explored_mlx_devices.rs
  • crates/api-db/src/expected_machine.rs
  • crates/api-db/src/expected_machine/tests.rs
  • crates/api-db/src/machine_interface.rs
  • crates/api-model/src/expected_machine.rs
  • crates/api-model/src/machine/mod.rs
  • crates/api-model/src/site_explorer/mod.rs
  • crates/api-model/src/test_support/dpu.rs
  • crates/api-model/src/test_support/machine_snapshot.rs
  • crates/bmc-explorer/src/computer_system.rs
  • crates/machine-a-tron/src/api_client.rs
  • crates/machine-a-tron/src/machine_a_tron.rs
  • crates/machine-controller/src/handler.rs
  • crates/preingestion-manager/src/lib.rs
  • crates/redfish/src/libredfish/conv.rs
  • crates/rpc/build.rs
  • crates/rpc/proto/forge.proto
  • crates/rpc/src/model/expected_machine.rs
  • crates/rpc/src/model/site_explorer.rs
  • crates/rpc/src/protos/mod.rs
  • crates/site-explorer/src/bmc_endpoint_explorer.rs
  • crates/site-explorer/src/config.rs
  • crates/site-explorer/src/endpoint_explorer.rs
  • crates/site-explorer/src/lib.rs
  • crates/site-explorer/src/machine_creator.rs
  • crates/site-explorer/src/metrics.rs
  • crates/site-explorer/src/test_support/mock_endpoint_explorer.rs
  • crates/site-explorer/tests/integration/site_explorer.rs
  • crates/site-explorer/tests/integration/zero_dpu.rs
  • rest-api/proto/core/src/v1/nico_nico.proto
🚧 Files skipped from review as they are similar to previous changes (24)
  • crates/api-db/src/expected_machine/tests.rs
  • crates/api-core/src/cfg/README.md
  • crates/api-core/src/tests/machine_interfaces.rs
  • crates/admin-cli/src/rpc.rs
  • crates/api-core/src/tests/common/api_fixtures/mod.rs
  • crates/machine-a-tron/src/api_client.rs
  • crates/machine-a-tron/src/machine_a_tron.rs
  • crates/site-explorer/src/machine_creator.rs
  • crates/site-explorer/src/metrics.rs
  • crates/admin-cli/src/expected_machines/show/cmd.rs
  • crates/api-db/src/expected_machine.rs
  • crates/machine-controller/src/handler.rs
  • crates/api-core/src/tests/sku.rs
  • crates/site-explorer/tests/integration/zero_dpu.rs
  • crates/api-db/src/machine_interface.rs
  • crates/api-core/src/cfg/file.rs
  • crates/site-explorer/src/config.rs
  • crates/admin-cli/src/expected_machines/patch/args.rs
  • crates/rpc/src/model/expected_machine.rs
  • crates/api-core/src/tests/common/api_fixtures/site_explorer.rs
  • crates/admin-cli/src/expected_machines/add/args.rs
  • crates/api-model/src/expected_machine.rs
  • crates/admin-cli/src/expected_machines/tests.rs
  • crates/site-explorer/tests/integration/site_explorer.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.

Caution

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

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

1274-1299: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Ignore hosts still skip boot-interface refresh. The continue here still bypasses the declared_primary / fetch_host_primary_interface_mac / boot_interfaces.push(...) path, so explored_endpoints.boot_interface_* is never refreshed for zero-DPU hosts even when a primary NIC is resolvable. Hoist the boot-interface lookup above this fast-path, or make the asymmetry explicit if Ignore should not update that hint.

🤖 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/site-explorer/src/lib.rs` around lines 1274 - 1299, The
HostDpuPolicy::Ignore fast path bypasses boot-interface refresh for zero-DPU
hosts. Update the surrounding exploration flow so declared_primary and
fetch_host_primary_interface_mac run before this continue, and
boot_interfaces.push updates explored_endpoints.boot_interface_* when the
primary NIC is resolvable; otherwise explicitly preserve the intended no-refresh
behavior.
🤖 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.

Outside diff comments:
In `@crates/site-explorer/src/lib.rs`:
- Around line 1274-1299: The HostDpuPolicy::Ignore fast path bypasses
boot-interface refresh for zero-DPU hosts. Update the surrounding exploration
flow so declared_primary and fetch_host_primary_interface_mac run before this
continue, and boot_interfaces.push updates explored_endpoints.boot_interface_*
when the primary NIC is resolvable; otherwise explicitly preserve the intended
no-refresh behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: dbfef57c-f48a-403c-b63e-ac7072c20ed0

📥 Commits

Reviewing files that changed from the base of the PR and between da30d63 and ac2c936.

⛔ Files ignored due to path filters (1)
  • rest-api/proto/core/gen/v1/nico_nico.pb.go is excluded by !**/*.pb.go, !**/gen/**, !rest-api/**/*.pb.go
📒 Files selected for processing (49)
  • crates/admin-cli/src/expected_machines/add/args.rs
  • crates/admin-cli/src/expected_machines/common.rs
  • crates/admin-cli/src/expected_machines/patch/args.rs
  • crates/admin-cli/src/expected_machines/patch/mod.rs
  • crates/admin-cli/src/expected_machines/show/cmd.rs
  • crates/admin-cli/src/expected_machines/tests.rs
  • crates/admin-cli/src/expected_machines/update/mod.rs
  • crates/admin-cli/src/rpc.rs
  • crates/admin-cli/src/site_explorer/mlx_devices/cmd.rs
  • crates/api-core/src/cfg/README.md
  • crates/api-core/src/cfg/file.rs
  • crates/api-core/src/handlers/bmc_endpoint_explorer.rs
  • crates/api-core/src/test_support/fixture_config.rs
  • crates/api-core/src/tests/common/api_fixtures/mod.rs
  • crates/api-core/src/tests/common/api_fixtures/site_explorer.rs
  • crates/api-core/src/tests/expected_machine.rs
  • crates/api-core/src/tests/machine_interfaces.rs
  • crates/api-core/src/tests/preingestion_dpu_nic_mode.rs
  • crates/api-core/src/tests/sku.rs
  • crates/api-core/tests/integration/explored_mlx_devices.rs
  • crates/api-db/src/expected_machine.rs
  • crates/api-db/src/expected_machine/tests.rs
  • crates/api-db/src/machine_interface.rs
  • crates/api-model/src/expected_machine.rs
  • crates/api-model/src/machine/mod.rs
  • crates/api-model/src/site_explorer/mod.rs
  • crates/api-model/src/test_support/dpu.rs
  • crates/api-model/src/test_support/machine_snapshot.rs
  • crates/bmc-explorer/src/computer_system.rs
  • crates/machine-a-tron/src/api_client.rs
  • crates/machine-a-tron/src/machine_a_tron.rs
  • crates/machine-controller/src/handler.rs
  • crates/preingestion-manager/src/lib.rs
  • crates/redfish/src/libredfish/conv.rs
  • crates/rpc/build.rs
  • crates/rpc/proto/forge.proto
  • crates/rpc/src/model/expected_machine.rs
  • crates/rpc/src/model/site_explorer.rs
  • crates/rpc/src/protos/mod.rs
  • crates/site-explorer/src/bmc_endpoint_explorer.rs
  • crates/site-explorer/src/config.rs
  • crates/site-explorer/src/endpoint_explorer.rs
  • crates/site-explorer/src/lib.rs
  • crates/site-explorer/src/machine_creator.rs
  • crates/site-explorer/src/metrics.rs
  • crates/site-explorer/src/test_support/mock_endpoint_explorer.rs
  • crates/site-explorer/tests/integration/site_explorer.rs
  • crates/site-explorer/tests/integration/zero_dpu.rs
  • rest-api/proto/core/src/v1/nico_nico.proto

@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/api-core/src/cfg/README.md (1)

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

Slightly confusing repetition of dpu_mode in the legacy-compat note.

The sentence "The legacy dpu_mode field and dpu_mode / nic_mode / no_dpu values remain accepted during deserialization" uses dpu_mode twice with two different meanings (the legacy field name vs. the legacy value alias for manage), which can read as a typo/duplication rather than two distinct facts.

✏️ Suggested rewording for clarity
-| `dpu_policy` | `Option<HostDpuPolicy>` | — | Site-wide policy for DPU hardware: `manage`, `use_as_nic`, or `ignore`. Per-host `use_as_nic` and `ignore` override it; per-host `manage` inherits it for backward compatibility. When omitted, the site default is `manage`. The legacy `dpu_mode` field and `dpu_mode` / `nic_mode` / `no_dpu` values remain accepted during deserialization. |
+| `dpu_policy` | `Option<HostDpuPolicy>` | — | Site-wide policy for DPU hardware: `manage`, `use_as_nic`, or `ignore`. Per-host `use_as_nic` and `ignore` override it; per-host `manage` inherits it for backward compatibility. When omitted, the site default is `manage`. The legacy field name `dpu_mode`, and its legacy enum values `dpu_mode` / `nic_mode` / `no_dpu`, remain accepted during deserialization. |

As per path instructions, "Review Markdown for correctness, clarity, spelling, grammar, working links, and whether commands/examples are realistic and safe."

🤖 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-core/src/cfg/README.md` at line 313, Clarify the
legacy-compatibility note in the dpu_policy documentation by distinguishing the
legacy dpu_mode field from the accepted legacy value aliases, avoiding repeated
ambiguous use of dpu_mode while preserving all listed compatibility behavior.

Source: Path instructions

crates/site-explorer/tests/integration/site_explorer.rs (1)

2658-2659: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Trim the duplicated local imports

In each regression test, the function-local use only needs HostDpuPolicy; ExpectedMachine, ExpectedMachineData, and BlueFieldOperatingMode are already in module scope. Keeping the local import to the new symbol reduces noise without changing behavior.

🤖 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/site-explorer/tests/integration/site_explorer.rs` around lines 2658 -
2659, Update the function-local imports in each regression test to import only
HostDpuPolicy. Remove ExpectedMachine, ExpectedMachineData, and
BlueFieldOperatingMode from those local use statements, relying on their
existing module-scope imports without changing test behavior.
🤖 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-core/src/cfg/README.md`:
- Line 313: Clarify the legacy-compatibility note in the dpu_policy
documentation by distinguishing the legacy dpu_mode field from the accepted
legacy value aliases, avoiding repeated ambiguous use of dpu_mode while
preserving all listed compatibility behavior.

In `@crates/site-explorer/tests/integration/site_explorer.rs`:
- Around line 2658-2659: Update the function-local imports in each regression
test to import only HostDpuPolicy. Remove ExpectedMachine, ExpectedMachineData,
and BlueFieldOperatingMode from those local use statements, relying on their
existing module-scope imports without changing test behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 42625445-91a6-4f77-beab-644890b074f2

📥 Commits

Reviewing files that changed from the base of the PR and between ac2c936 and 060ed1a.

⛔ Files ignored due to path filters (1)
  • rest-api/proto/core/gen/v1/nico_nico.pb.go is excluded by !**/*.pb.go, !**/gen/**, !rest-api/**/*.pb.go
📒 Files selected for processing (49)
  • crates/admin-cli/src/expected_machines/add/args.rs
  • crates/admin-cli/src/expected_machines/common.rs
  • crates/admin-cli/src/expected_machines/patch/args.rs
  • crates/admin-cli/src/expected_machines/patch/mod.rs
  • crates/admin-cli/src/expected_machines/show/cmd.rs
  • crates/admin-cli/src/expected_machines/tests.rs
  • crates/admin-cli/src/expected_machines/update/mod.rs
  • crates/admin-cli/src/rpc.rs
  • crates/admin-cli/src/site_explorer/mlx_devices/cmd.rs
  • crates/api-core/src/cfg/README.md
  • crates/api-core/src/cfg/file.rs
  • crates/api-core/src/handlers/bmc_endpoint_explorer.rs
  • crates/api-core/src/test_support/fixture_config.rs
  • crates/api-core/src/tests/common/api_fixtures/mod.rs
  • crates/api-core/src/tests/common/api_fixtures/site_explorer.rs
  • crates/api-core/src/tests/expected_machine.rs
  • crates/api-core/src/tests/machine_interfaces.rs
  • crates/api-core/src/tests/preingestion_dpu_nic_mode.rs
  • crates/api-core/src/tests/sku.rs
  • crates/api-core/tests/integration/explored_mlx_devices.rs
  • crates/api-db/src/expected_machine.rs
  • crates/api-db/src/expected_machine/tests.rs
  • crates/api-db/src/machine_interface.rs
  • crates/api-model/src/expected_machine.rs
  • crates/api-model/src/machine/mod.rs
  • crates/api-model/src/site_explorer/mod.rs
  • crates/api-model/src/test_support/dpu.rs
  • crates/api-model/src/test_support/machine_snapshot.rs
  • crates/bmc-explorer/src/computer_system.rs
  • crates/machine-a-tron/src/api_client.rs
  • crates/machine-a-tron/src/machine_a_tron.rs
  • crates/machine-controller/src/handler.rs
  • crates/preingestion-manager/src/lib.rs
  • crates/redfish/src/libredfish/conv.rs
  • crates/rpc/build.rs
  • crates/rpc/proto/forge.proto
  • crates/rpc/src/model/expected_machine.rs
  • crates/rpc/src/model/site_explorer.rs
  • crates/rpc/src/protos/mod.rs
  • crates/site-explorer/src/bmc_endpoint_explorer.rs
  • crates/site-explorer/src/config.rs
  • crates/site-explorer/src/endpoint_explorer.rs
  • crates/site-explorer/src/lib.rs
  • crates/site-explorer/src/machine_creator.rs
  • crates/site-explorer/src/metrics.rs
  • crates/site-explorer/src/test_support/mock_endpoint_explorer.rs
  • crates/site-explorer/tests/integration/site_explorer.rs
  • crates/site-explorer/tests/integration/zero_dpu.rs
  • rest-api/proto/core/src/v1/nico_nico.proto
🚧 Files skipped from review as they are similar to previous changes (42)
  • crates/admin-cli/src/expected_machines/update/mod.rs
  • crates/api-core/src/tests/machine_interfaces.rs
  • crates/rpc/build.rs
  • crates/api-db/src/expected_machine/tests.rs
  • crates/api-model/src/test_support/dpu.rs
  • crates/admin-cli/src/rpc.rs
  • crates/api-db/src/expected_machine.rs
  • crates/site-explorer/src/test_support/mock_endpoint_explorer.rs
  • crates/site-explorer/src/endpoint_explorer.rs
  • crates/api-core/src/tests/common/api_fixtures/site_explorer.rs
  • crates/admin-cli/src/expected_machines/show/cmd.rs
  • crates/api-model/src/test_support/machine_snapshot.rs
  • crates/rpc/proto/forge.proto
  • crates/machine-a-tron/src/api_client.rs
  • crates/admin-cli/src/expected_machines/patch/mod.rs
  • crates/site-explorer/src/machine_creator.rs
  • rest-api/proto/core/src/v1/nico_nico.proto
  • crates/machine-a-tron/src/machine_a_tron.rs
  • crates/preingestion-manager/src/lib.rs
  • crates/redfish/src/libredfish/conv.rs
  • crates/api-core/src/tests/common/api_fixtures/mod.rs
  • crates/site-explorer/src/metrics.rs
  • crates/machine-controller/src/handler.rs
  • crates/api-core/src/handlers/bmc_endpoint_explorer.rs
  • crates/api-core/src/tests/sku.rs
  • crates/admin-cli/src/site_explorer/mlx_devices/cmd.rs
  • crates/api-core/tests/integration/explored_mlx_devices.rs
  • crates/api-core/src/tests/preingestion_dpu_nic_mode.rs
  • crates/site-explorer/src/config.rs
  • crates/rpc/src/protos/mod.rs
  • crates/admin-cli/src/expected_machines/common.rs
  • crates/api-db/src/machine_interface.rs
  • crates/api-core/src/cfg/file.rs
  • crates/admin-cli/src/expected_machines/add/args.rs
  • crates/api-model/src/expected_machine.rs
  • crates/site-explorer/src/bmc_endpoint_explorer.rs
  • crates/admin-cli/src/expected_machines/patch/args.rs
  • crates/rpc/src/model/site_explorer.rs
  • crates/api-model/src/site_explorer/mod.rs
  • crates/admin-cli/src/expected_machines/tests.rs
  • crates/rpc/src/model/expected_machine.rs
  • crates/site-explorer/src/lib.rs

@chet

chet commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full_review, thanks!

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

@chet, understood — kicking off another full review of the PR now.

✅ 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/rpc/src/model/site_explorer.rs (1)

500-511: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Use a table-driven check for the enum conversion.

Express the Dpu/Nic conversion cases through check_cases or value_scenarios! rather than separate assertions. As per coding guidelines, “Use table-driven tests for functions mapping inputs to outputs, errors, or observable results.”

🤖 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/rpc/src/model/site_explorer.rs` around lines 500 - 511, Replace the
separate BlueFieldOperatingMode conversion assertions in the existing test with
a table-driven check using check_cases or value_scenarios!, covering both Dpu
and Nic inputs and their expected rpc::site_explorer::BlueFieldOperatingMode
outputs. Keep the existing as_str_name assertion unchanged.

Source: Coding guidelines

crates/api-model/src/expected_machine.rs (1)

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

Lock canonical policy serialization across both Serde boundaries.

The compatibility suites validate legacy input but do not protect canonical output with serialize→deserialize round trips.

  • crates/api-model/src/expected_machine.rs#L514-L567: verify model policies serialize as manage, use_as_nic, and ignore, including default/omitted ExpectedMachine behavior.
  • crates/rpc/src/model/expected_machine.rs#L453-L476: verify the RPC alias emits the same canonical strings and round-trips each variant.

As per path instructions, conversion and Serde compatibility tests must include round-trips and boundary/unset behavior.

🤖 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/expected_machine.rs` around lines 514 - 567, The
compatibility tests around host_dpu_policy_deserializes_new_and_legacy_values
and expected_machine_deserializes_new_and_legacy_policy_fields must also lock
canonical serialization. In crates/api-model/src/expected_machine.rs lines
514-567, add serialize→deserialize round trips for every HostDpuPolicy variant,
assert canonical strings manage, use_as_nic, and ignore, and cover
omitted/default ExpectedMachine behavior. In
crates/rpc/src/model/expected_machine.rs lines 453-476, add equivalent
canonical-string assertions and round trips for the RPC alias; no other
conversion behavior needs changing.

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/api-model/src/expected_machine.rs`:
- Around line 514-567: The compatibility tests around
host_dpu_policy_deserializes_new_and_legacy_values and
expected_machine_deserializes_new_and_legacy_policy_fields must also lock
canonical serialization. In crates/api-model/src/expected_machine.rs lines
514-567, add serialize→deserialize round trips for every HostDpuPolicy variant,
assert canonical strings manage, use_as_nic, and ignore, and cover
omitted/default ExpectedMachine behavior. In
crates/rpc/src/model/expected_machine.rs lines 453-476, add equivalent
canonical-string assertions and round trips for the RPC alias; no other
conversion behavior needs changing.

In `@crates/rpc/src/model/site_explorer.rs`:
- Around line 500-511: Replace the separate BlueFieldOperatingMode conversion
assertions in the existing test with a table-driven check using check_cases or
value_scenarios!, covering both Dpu and Nic inputs and their expected
rpc::site_explorer::BlueFieldOperatingMode outputs. Keep the existing
as_str_name assertion unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 36f001c5-464e-44ca-b40e-04e074bf3cde

📥 Commits

Reviewing files that changed from the base of the PR and between 1eb3a7f and ea74e95.

⛔ Files ignored due to path filters (1)
  • rest-api/proto/core/gen/v1/nico_nico.pb.go is excluded by !**/*.pb.go, !**/gen/**, !rest-api/**/*.pb.go
📒 Files selected for processing (49)
  • crates/admin-cli/src/expected_machines/add/args.rs
  • crates/admin-cli/src/expected_machines/common.rs
  • crates/admin-cli/src/expected_machines/patch/args.rs
  • crates/admin-cli/src/expected_machines/patch/mod.rs
  • crates/admin-cli/src/expected_machines/show/cmd.rs
  • crates/admin-cli/src/expected_machines/tests.rs
  • crates/admin-cli/src/expected_machines/update/mod.rs
  • crates/admin-cli/src/rpc.rs
  • crates/admin-cli/src/site_explorer/mlx_devices/cmd.rs
  • crates/api-core/src/cfg/README.md
  • crates/api-core/src/cfg/file.rs
  • crates/api-core/src/handlers/bmc_endpoint_explorer.rs
  • crates/api-core/src/test_support/fixture_config.rs
  • crates/api-core/src/tests/common/api_fixtures/mod.rs
  • crates/api-core/src/tests/common/api_fixtures/site_explorer.rs
  • crates/api-core/src/tests/expected_machine.rs
  • crates/api-core/src/tests/machine_interfaces.rs
  • crates/api-core/src/tests/preingestion_dpu_nic_mode.rs
  • crates/api-core/src/tests/sku.rs
  • crates/api-core/tests/integration/explored_mlx_devices.rs
  • crates/api-db/src/expected_machine.rs
  • crates/api-db/src/expected_machine/tests.rs
  • crates/api-db/src/machine_interface.rs
  • crates/api-model/src/expected_machine.rs
  • crates/api-model/src/machine/mod.rs
  • crates/api-model/src/site_explorer/mod.rs
  • crates/api-model/src/test_support/dpu.rs
  • crates/api-model/src/test_support/machine_snapshot.rs
  • crates/bmc-explorer/src/computer_system.rs
  • crates/machine-a-tron/src/api_client.rs
  • crates/machine-a-tron/src/machine_a_tron.rs
  • crates/machine-controller/src/handler.rs
  • crates/preingestion-manager/src/lib.rs
  • crates/redfish/src/libredfish/conv.rs
  • crates/rpc/build.rs
  • crates/rpc/proto/forge.proto
  • crates/rpc/src/model/expected_machine.rs
  • crates/rpc/src/model/site_explorer.rs
  • crates/rpc/src/protos/mod.rs
  • crates/site-explorer/src/bmc_endpoint_explorer.rs
  • crates/site-explorer/src/config.rs
  • crates/site-explorer/src/endpoint_explorer.rs
  • crates/site-explorer/src/lib.rs
  • crates/site-explorer/src/machine_creator.rs
  • crates/site-explorer/src/metrics.rs
  • crates/site-explorer/src/test_support/mock_endpoint_explorer.rs
  • crates/site-explorer/tests/integration/site_explorer.rs
  • crates/site-explorer/tests/integration/zero_dpu.rs
  • rest-api/proto/core/src/v1/nico_nico.proto

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

@chet, understood — kicking off another full review of the PR now.

✅ Action performed

Full review finished.

@chet

chet commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full_review, thanks!

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

@chet, understood — kicking off another full review of the PR now.

✅ 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/machine-a-tron/src/api_client.rs (1)

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

Reuse the shared From conversion.

This duplicates the HostDpuPolicy -> rpc::forge::DpuMode mapping already defined in crates/rpc/src/model/expected_machine.rs. Use rpc::forge::DpuMode::from(policy) as i32 to prevent mapping drift.

Proposed refactor
-                dpu_mode: dpu_policy.map(|policy| match policy {
-                    HostDpuPolicy::Manage => rpc::forge::DpuMode::DpuMode as i32,
-                    HostDpuPolicy::UseAsNic => rpc::forge::DpuMode::NicMode as i32,
-                    HostDpuPolicy::Ignore => rpc::forge::DpuMode::NoDpu as i32,
-                }),
+                dpu_mode: dpu_policy.map(|policy| rpc::forge::DpuMode::from(policy) as i32),
🤖 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/machine-a-tron/src/api_client.rs` around lines 526 - 530, Replace the
inline match in the dpu_mode mapping with the shared HostDpuPolicy conversion,
using rpc::forge::DpuMode::from(policy) as i32 within the existing
dpu_policy.map closure. Preserve the current optional mapping 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/site-explorer/tests/integration/zero_dpu.rs`:
- Around line 369-370: Update the comment describing the zero-DPU scenario near
register_zero_dpu_expected_machine to match the helper’s seeded
HostDpuPolicy::Ignore value, replacing the incorrect UseAsNic reference. Keep
the test behavior and helper unchanged.

---

Nitpick comments:
In `@crates/machine-a-tron/src/api_client.rs`:
- Around line 526-530: Replace the inline match in the dpu_mode mapping with the
shared HostDpuPolicy conversion, using rpc::forge::DpuMode::from(policy) as i32
within the existing dpu_policy.map closure. Preserve the current optional
mapping behavior.
🪄 Autofix (Beta)

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: 4e1fea5f-f8d2-437a-9aa8-ee227e38159d

📥 Commits

Reviewing files that changed from the base of the PR and between 097a4a0 and 31bd1ca.

⛔ Files ignored due to path filters (2)
  • Cargo.lock is excluded by !**/*.lock
  • rest-api/proto/core/gen/v1/nico_nico.pb.go is excluded by !**/*.pb.go, !**/gen/**, !rest-api/**/*.pb.go
📒 Files selected for processing (54)
  • crates/admin-cli/src/expected_machines/add/args.rs
  • crates/admin-cli/src/expected_machines/common.rs
  • crates/admin-cli/src/expected_machines/patch/args.rs
  • crates/admin-cli/src/expected_machines/patch/mod.rs
  • crates/admin-cli/src/expected_machines/replace_all/mod.rs
  • crates/admin-cli/src/expected_machines/show/cmd.rs
  • crates/admin-cli/src/expected_machines/tests.rs
  • crates/admin-cli/src/expected_machines/update/mod.rs
  • crates/admin-cli/src/rpc.rs
  • crates/admin-cli/src/site_explorer/mlx_devices/cmd.rs
  • crates/api-core/src/cfg/README.md
  • crates/api-core/src/cfg/file.rs
  • crates/api-core/src/handlers/bmc_endpoint_explorer.rs
  • crates/api-core/src/test_support/fixture_config.rs
  • crates/api-core/src/tests/common/api_fixtures/mod.rs
  • crates/api-core/src/tests/common/api_fixtures/site_explorer.rs
  • crates/api-core/src/tests/expected_machine.rs
  • crates/api-core/src/tests/machine_interfaces.rs
  • crates/api-core/src/tests/preingestion_dpu_nic_mode.rs
  • crates/api-core/src/tests/sku.rs
  • crates/api-core/tests/integration/explored_mlx_devices.rs
  • crates/api-db/src/expected_machine.rs
  • crates/api-db/src/expected_machine/tests.rs
  • crates/api-db/src/machine_interface.rs
  • crates/api-integration-tests/tests/lib.rs
  • crates/api-model/src/expected_machine.rs
  • crates/api-model/src/machine/mod.rs
  • crates/api-model/src/machine_boot_interface.rs
  • crates/api-model/src/site_explorer/mod.rs
  • crates/api-model/src/test_support/dpu.rs
  • crates/api-model/src/test_support/machine_snapshot.rs
  • crates/bmc-explorer/src/computer_system.rs
  • crates/machine-a-tron/Cargo.toml
  • crates/machine-a-tron/src/api_client.rs
  • crates/machine-a-tron/src/machine_a_tron.rs
  • crates/machine-controller/src/boot_interface.rs
  • crates/machine-controller/src/handler.rs
  • crates/preingestion-manager/src/lib.rs
  • crates/redfish/src/boot_interface.rs
  • crates/redfish/src/libredfish/conv.rs
  • crates/rpc/proto/forge.proto
  • crates/rpc/src/model/expected_machine.rs
  • crates/rpc/src/model/site_explorer.rs
  • crates/rpc/src/protos/mod.rs
  • crates/site-explorer/src/bmc_endpoint_explorer.rs
  • crates/site-explorer/src/config.rs
  • crates/site-explorer/src/endpoint_explorer.rs
  • crates/site-explorer/src/lib.rs
  • crates/site-explorer/src/machine_creator.rs
  • crates/site-explorer/src/metrics.rs
  • crates/site-explorer/src/test_support/mock_endpoint_explorer.rs
  • crates/site-explorer/tests/integration/site_explorer.rs
  • crates/site-explorer/tests/integration/zero_dpu.rs
  • rest-api/proto/core/src/v1/nico_nico.proto

Comment thread crates/site-explorer/tests/integration/zero_dpu.rs Outdated
@chet
chet force-pushed the gh-issue-3447 branch 2 times, most recently from 2fec248 to 0681024 Compare July 16, 2026 05:30
@chet

chet commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full_review, thanks!

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

@chet, understood — kicking off another full review of the PR now.

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

Caution

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

⚠️ Outside diff range comments (2)
crates/site-explorer/src/lib.rs (1)

1620-1645: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Warning message mislabels the gate as "not Ignore" — it's actually Manage-specific.

The surrounding comment (L1621-1634) correctly explains the effective policy is Manage, but the emitted tracing::warn! text says "its DPU policy is not Ignore" — which is also true for UseAsNic, a policy that does not trigger this blocker. The suggested remediation only offers dpu_policy = "ignore", but use_as_nic achieves the same zero-DPU opt-in and should be mentioned too.

✏️ Suggested wording fix
-                            "cannot identify managed host: site explorer sees no DPUs on this host and its DPU policy is not `Ignore`; declare `dpu_policy = \"ignore\"` to ingest as zero-DPU",
+                            "cannot identify managed host: site explorer sees no DPUs on this host and its DPU policy resolves to `Manage` (the default); declare `dpu_policy = \"ignore\"` or `\"use_as_nic\"` to ingest as zero-DPU",
🤖 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/site-explorer/src/lib.rs` around lines 1620 - 1645, Update the
tracing::warn! message in the host DPU policy branch guarded by
host_dpu_policy.expects_managed_dpus() so it identifies the blocking policy as
Manage-specific rather than saying the policy is merely not Ignore. Include both
Ignore and UseAsNic as valid zero-DPU opt-in alternatives in the remediation
text.
crates/site-explorer/src/metrics.rs (1)

1-1: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Both sites describe the zero-DPU gate as "not Ignore" instead of naming the actual gated policy, Manage. UseAsNic is also "not Ignore" yet is never gated by NoDpuReportedByHost (only Manage, via expects_managed_dpus(), triggers it) — the imprecise wording risks steering operators toward ignore when use_as_nic may be the correct choice. The accurate phrasing already exists in crates/site-explorer/tests/integration/site_explorer.rs#L395-398.

  • crates/site-explorer/src/metrics.rs#L35-52: reword the NoDpuReportedByHost doc comment to say the effective policy "resolves to Manage (the default)" rather than "is not Ignore".
  • crates/site-explorer/src/lib.rs#L1620-1645: reword the tracing::warn! message at L1639 to name Manage explicitly, and mention both ignore and use_as_nic as valid zero-DPU opt-ins.
🤖 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/site-explorer/src/metrics.rs` at line 1, Update the
NoDpuReportedByHost documentation in metrics.rs to state that the policy
resolves to Manage by default, replacing the imprecise “not Ignore” wording.
Update the tracing::warn! message in the relevant lib.rs handling to name Manage
explicitly and identify both ignore and use_as_nic as valid zero-DPU opt-ins,
matching the established integration-test phrasing.
♻️ Duplicate comments (1)
crates/site-explorer/src/metrics.rs (1)

35-52: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Doc still says "not Ignore" — should say "Manage" (the actual gate).

UseAsNic is also "not Ignore", yet crates/site-explorer/src/lib.rs only fires NoDpuReportedByHost when host_dpu_policy.expects_managed_dpus() is true (i.e., Manage). This is the exact concern raised in a prior round on this same range, which was marked addressed — but the wording here is unchanged. Compare with the corrected doc in crates/site-explorer/tests/integration/site_explorer.rs ("resolves to Manage").

✏️ Suggested wording fix
-    /// Host BMC reports no BlueField PCIe devices but the host policy is not
-    /// `Ignore`. We expect DPUs but didn't
+    /// Host BMC reports no BlueField PCIe devices and the effective host
+    /// policy resolves to `Manage` (the default). We expect DPUs but didn't
     /// find any -- likely a misconfiguration or DPU-discovery bug.
🤖 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/site-explorer/src/metrics.rs` around lines 35 - 52, Update the
NoDpuReportedByHost documentation to say the host policy resolves to `Manage`,
replacing the inaccurate “not `Ignore`” wording. Keep the explanation aligned
with the expects_managed_dpus() gate and preserve the existing rationale about
missing expected DPUs.
🧹 Nitpick comments (1)
crates/api-core/src/cfg/file.rs (1)

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

Use the repository’s scenario macros for these mapping tests.

Replace the handwritten case loops with scenarios! for fallible Figment/serde operations and value_scenarios! for total mappings.

  • crates/api-core/src/cfg/file.rs#L4223-L4241: express policy parsing cases with scenarios!.
  • crates/api-core/src/cfg/file.rs#L4249-L4275: express layered-precedence cases with scenarios!.
  • crates/api-core/src/cfg/file.rs#L4280-L4303: express serialization cases with scenarios!.
  • crates/admin-cli/src/site_explorer/mlx_devices/cmd.rs#L203-L254: express operating_as_nic cases with value_scenarios!.

As per coding guidelines, mapping tests must use carbide-test-support scenario helpers. As per path instructions, formatting and serde-boundary logic should use the repository’s table-driven test conventions.

🤖 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-core/src/cfg/file.rs` around lines 4223 - 4241, The mapping tests
currently use handwritten case loops instead of repository scenario helpers. In
crates/api-core/src/cfg/file.rs ranges 4223-4241, 4249-4275, and 4280-4303,
replace the policy parsing, layered-precedence, and serialization case tables
with scenarios! while preserving their existing fallible Figment/serde
assertions; in crates/admin-cli/src/site_explorer/mlx_devices/cmd.rs range
203-254, replace the operating_as_nic mapping cases with value_scenarios! for
the total mapping.

Sources: Coding guidelines, 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.

Outside diff comments:
In `@crates/site-explorer/src/lib.rs`:
- Around line 1620-1645: Update the tracing::warn! message in the host DPU
policy branch guarded by host_dpu_policy.expects_managed_dpus() so it identifies
the blocking policy as Manage-specific rather than saying the policy is merely
not Ignore. Include both Ignore and UseAsNic as valid zero-DPU opt-in
alternatives in the remediation text.

In `@crates/site-explorer/src/metrics.rs`:
- Line 1: Update the NoDpuReportedByHost documentation in metrics.rs to state
that the policy resolves to Manage by default, replacing the imprecise “not
Ignore” wording. Update the tracing::warn! message in the relevant lib.rs
handling to name Manage explicitly and identify both ignore and use_as_nic as
valid zero-DPU opt-ins, matching the established integration-test phrasing.

---

Duplicate comments:
In `@crates/site-explorer/src/metrics.rs`:
- Around line 35-52: Update the NoDpuReportedByHost documentation to say the
host policy resolves to `Manage`, replacing the inaccurate “not `Ignore`”
wording. Keep the explanation aligned with the expects_managed_dpus() gate and
preserve the existing rationale about missing expected DPUs.

---

Nitpick comments:
In `@crates/api-core/src/cfg/file.rs`:
- Around line 4223-4241: The mapping tests currently use handwritten case loops
instead of repository scenario helpers. In crates/api-core/src/cfg/file.rs
ranges 4223-4241, 4249-4275, and 4280-4303, replace the policy parsing,
layered-precedence, and serialization case tables with scenarios! while
preserving their existing fallible Figment/serde assertions; in
crates/admin-cli/src/site_explorer/mlx_devices/cmd.rs range 203-254, replace the
operating_as_nic mapping cases with value_scenarios! for the total mapping.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 9a852967-5061-4698-9c28-c9e3a60f47bc

📥 Commits

Reviewing files that changed from the base of the PR and between 0d28ae5 and 0681024.

⛔ Files ignored due to path filters (2)
  • Cargo.lock is excluded by !**/*.lock
  • rest-api/proto/core/gen/v1/nico_nico.pb.go is excluded by !**/*.pb.go, !**/gen/**, !rest-api/**/*.pb.go
📒 Files selected for processing (54)
  • crates/admin-cli/src/expected_machines/add/args.rs
  • crates/admin-cli/src/expected_machines/common.rs
  • crates/admin-cli/src/expected_machines/patch/args.rs
  • crates/admin-cli/src/expected_machines/patch/mod.rs
  • crates/admin-cli/src/expected_machines/replace_all/mod.rs
  • crates/admin-cli/src/expected_machines/show/cmd.rs
  • crates/admin-cli/src/expected_machines/tests.rs
  • crates/admin-cli/src/expected_machines/update/mod.rs
  • crates/admin-cli/src/rpc.rs
  • crates/admin-cli/src/site_explorer/mlx_devices/cmd.rs
  • crates/api-core/src/cfg/README.md
  • crates/api-core/src/cfg/file.rs
  • crates/api-core/src/handlers/bmc_endpoint_explorer.rs
  • crates/api-core/src/test_support/fixture_config.rs
  • crates/api-core/src/tests/common/api_fixtures/mod.rs
  • crates/api-core/src/tests/common/api_fixtures/site_explorer.rs
  • crates/api-core/src/tests/expected_machine.rs
  • crates/api-core/src/tests/machine_interfaces.rs
  • crates/api-core/src/tests/preingestion_dpu_nic_mode.rs
  • crates/api-core/src/tests/sku.rs
  • crates/api-core/tests/integration/explored_mlx_devices.rs
  • crates/api-db/src/expected_machine.rs
  • crates/api-db/src/expected_machine/tests.rs
  • crates/api-db/src/machine_interface.rs
  • crates/api-integration-tests/tests/lib.rs
  • crates/api-model/src/expected_machine.rs
  • crates/api-model/src/machine/mod.rs
  • crates/api-model/src/machine_boot_interface.rs
  • crates/api-model/src/site_explorer/mod.rs
  • crates/api-model/src/test_support/dpu.rs
  • crates/api-model/src/test_support/machine_snapshot.rs
  • crates/bmc-explorer/src/computer_system.rs
  • crates/machine-a-tron/Cargo.toml
  • crates/machine-a-tron/src/api_client.rs
  • crates/machine-a-tron/src/machine_a_tron.rs
  • crates/machine-controller/src/boot_interface.rs
  • crates/machine-controller/src/handler.rs
  • crates/preingestion-manager/src/lib.rs
  • crates/redfish/src/boot_interface.rs
  • crates/redfish/src/libredfish/conv.rs
  • crates/rpc/proto/forge.proto
  • crates/rpc/src/model/expected_machine.rs
  • crates/rpc/src/model/site_explorer.rs
  • crates/rpc/src/protos/mod.rs
  • crates/site-explorer/src/bmc_endpoint_explorer.rs
  • crates/site-explorer/src/config.rs
  • crates/site-explorer/src/endpoint_explorer.rs
  • crates/site-explorer/src/lib.rs
  • crates/site-explorer/src/machine_creator.rs
  • crates/site-explorer/src/metrics.rs
  • crates/site-explorer/src/test_support/mock_endpoint_explorer.rs
  • crates/site-explorer/tests/integration/site_explorer.rs
  • crates/site-explorer/tests/integration/zero_dpu.rs
  • rest-api/proto/core/src/v1/nico_nico.proto

@chet

chet commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full_review, thanks!

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

@chet, understood — kicking off another full review of the PR now. As before, note that repeated full reviews on an otherwise unchanged diff are likely to surface the same result (only the Line 3342 host_dpu_policy log field rename nitpick, no actionable issues) unless new commits have been pushed. Let me know if you'd like me to focus on anything specific this time.

✅ 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

🤖 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/admin-cli/src/expected_machines/add/args.rs`:
- Around line 169-175: Update the help text for the dpu_policy argument to state
that explicit manage selects normal DPU management, while omitting the option
inherits the site-wide [site_explorer] dpu_policy setting. Keep the existing
descriptions for use-as-nic, ignore, and legacy --dpu-mode mappings unchanged.

In `@crates/admin-cli/src/expected_machines/patch/args.rs`:
- Line 194: Update the help text for the per-host DPU policy argument in the
argument definition containing the help string so `manage` is described as
explicitly managing DPUs, not inheriting site policy. Clarify that only an unset
value preserves or inherits the existing site/per-host policy, while retaining
the descriptions for `use-as-nic`, `ignore`, and legacy `--dpu-mode` mappings.

In `@crates/api-model/src/machine_boot_interface.rs`:
- Around line 29-33: Revise the documentation near MachineBootInterface and
from_parts so it does not claim interface_id can be used alone after a
transition. Describe the fallback only when both interface_id and mac_address
remain available, unless the model is first changed to support an optional MAC
or separate identifier type.
🪄 Autofix (Beta)

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: fbaa2f4e-22f7-45bc-a6f1-4f7ae1d433b2

📥 Commits

Reviewing files that changed from the base of the PR and between 0d28ae5 and 9abd091.

⛔ Files ignored due to path filters (2)
  • Cargo.lock is excluded by !**/*.lock
  • rest-api/proto/core/gen/v1/nico_nico.pb.go is excluded by !**/*.pb.go, !**/gen/**, !rest-api/**/*.pb.go
📒 Files selected for processing (54)
  • crates/admin-cli/src/expected_machines/add/args.rs
  • crates/admin-cli/src/expected_machines/common.rs
  • crates/admin-cli/src/expected_machines/patch/args.rs
  • crates/admin-cli/src/expected_machines/patch/mod.rs
  • crates/admin-cli/src/expected_machines/replace_all/mod.rs
  • crates/admin-cli/src/expected_machines/show/cmd.rs
  • crates/admin-cli/src/expected_machines/tests.rs
  • crates/admin-cli/src/expected_machines/update/mod.rs
  • crates/admin-cli/src/rpc.rs
  • crates/admin-cli/src/site_explorer/mlx_devices/cmd.rs
  • crates/api-core/src/cfg/README.md
  • crates/api-core/src/cfg/file.rs
  • crates/api-core/src/handlers/bmc_endpoint_explorer.rs
  • crates/api-core/src/test_support/fixture_config.rs
  • crates/api-core/src/tests/common/api_fixtures/mod.rs
  • crates/api-core/src/tests/common/api_fixtures/site_explorer.rs
  • crates/api-core/src/tests/expected_machine.rs
  • crates/api-core/src/tests/machine_interfaces.rs
  • crates/api-core/src/tests/preingestion_dpu_nic_mode.rs
  • crates/api-core/src/tests/sku.rs
  • crates/api-core/tests/integration/explored_mlx_devices.rs
  • crates/api-db/src/expected_machine.rs
  • crates/api-db/src/expected_machine/tests.rs
  • crates/api-db/src/machine_interface.rs
  • crates/api-integration-tests/tests/lib.rs
  • crates/api-model/src/expected_machine.rs
  • crates/api-model/src/machine/mod.rs
  • crates/api-model/src/machine_boot_interface.rs
  • crates/api-model/src/site_explorer/mod.rs
  • crates/api-model/src/test_support/dpu.rs
  • crates/api-model/src/test_support/machine_snapshot.rs
  • crates/bmc-explorer/src/computer_system.rs
  • crates/machine-a-tron/Cargo.toml
  • crates/machine-a-tron/src/api_client.rs
  • crates/machine-a-tron/src/machine_a_tron.rs
  • crates/machine-controller/src/boot_interface.rs
  • crates/machine-controller/src/handler.rs
  • crates/preingestion-manager/src/lib.rs
  • crates/redfish/src/boot_interface.rs
  • crates/redfish/src/libredfish/conv.rs
  • crates/rpc/proto/forge.proto
  • crates/rpc/src/model/expected_machine.rs
  • crates/rpc/src/model/site_explorer.rs
  • crates/rpc/src/protos/mod.rs
  • crates/site-explorer/src/bmc_endpoint_explorer.rs
  • crates/site-explorer/src/config.rs
  • crates/site-explorer/src/endpoint_explorer.rs
  • crates/site-explorer/src/lib.rs
  • crates/site-explorer/src/machine_creator.rs
  • crates/site-explorer/src/metrics.rs
  • crates/site-explorer/src/test_support/mock_endpoint_explorer.rs
  • crates/site-explorer/tests/integration/site_explorer.rs
  • crates/site-explorer/tests/integration/zero_dpu.rs
  • rest-api/proto/core/src/v1/nico_nico.proto

Comment thread crates/admin-cli/src/expected_machines/add/args.rs
Comment thread crates/admin-cli/src/expected_machines/patch/args.rs Outdated
Comment thread crates/api-model/src/machine_boot_interface.rs
@chet

chet commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full_review, thanks!

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

@chet, kicking off another full review. As noted previously, since the diff hasn't changed since the last pass, this will likely surface the same single nitpick (the host_dpu_policy structured log field rename at Line 3342 in crates/site-explorer/src/lib.rs) with no new actionable findings. If you've pushed new commits or want me to focus on a specific area, let me know and I'll target the review accordingly.

✅ 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

Caution

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

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

3476-3524: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Do not treat an unknown mode as satisfying UseAsNic.

When host_dpu_policy is UseAsNic but bluefield_operating_mode() returns None, this function returns Ok(true). The caller can then register a zero-DPU host without confirming or applying NIC mode, leaving an attached BlueField operating as a DPU. Block ingestion or explicitly apply the requested NIC mode instead of reporting successful convergence.

🤖 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/site-explorer/src/lib.rs` around lines 3476 - 3524, The None branch of
the bluefield_operating_mode match must not report success when host_dpu_policy
is UseAsNic. Update this branch to block ingestion or invoke set_nic_mode with
BlueFieldOperatingMode::Nic, and only preserve the existing Ok(true) behavior
for policies where an unknown observed mode is acceptable.
🤖 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/api-model/src/expected_machine.rs`:
- Around line 78-92: The flattened dpu_policy field needs map-shaped
serialization to match its custom deserialization. Add a serialize_with handler
for dpu_policy alongside deserialize_host_dpu_policy that emits the canonical
field structure, and add coverage for ExpectedMachineData serialization
confirming dpu_policy is encoded successfully under its canonical name.

---

Outside diff comments:
In `@crates/site-explorer/src/lib.rs`:
- Around line 3476-3524: The None branch of the bluefield_operating_mode match
must not report success when host_dpu_policy is UseAsNic. Update this branch to
block ingestion or invoke set_nic_mode with BlueFieldOperatingMode::Nic, and
only preserve the existing Ok(true) behavior for policies where an unknown
observed mode is acceptable.
🪄 Autofix (Beta)

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: 42beb26b-6bb1-4da4-a718-95884b3db9e3

📥 Commits

Reviewing files that changed from the base of the PR and between 0d28ae5 and 0fd9618.

⛔ Files ignored due to path filters (2)
  • Cargo.lock is excluded by !**/*.lock
  • rest-api/proto/core/gen/v1/nico_nico.pb.go is excluded by !**/*.pb.go, !**/gen/**, !rest-api/**/*.pb.go
📒 Files selected for processing (54)
  • crates/admin-cli/src/expected_machines/add/args.rs
  • crates/admin-cli/src/expected_machines/common.rs
  • crates/admin-cli/src/expected_machines/patch/args.rs
  • crates/admin-cli/src/expected_machines/patch/mod.rs
  • crates/admin-cli/src/expected_machines/replace_all/mod.rs
  • crates/admin-cli/src/expected_machines/show/cmd.rs
  • crates/admin-cli/src/expected_machines/tests.rs
  • crates/admin-cli/src/expected_machines/update/mod.rs
  • crates/admin-cli/src/rpc.rs
  • crates/admin-cli/src/site_explorer/mlx_devices/cmd.rs
  • crates/api-core/src/cfg/README.md
  • crates/api-core/src/cfg/file.rs
  • crates/api-core/src/handlers/bmc_endpoint_explorer.rs
  • crates/api-core/src/test_support/fixture_config.rs
  • crates/api-core/src/tests/common/api_fixtures/mod.rs
  • crates/api-core/src/tests/common/api_fixtures/site_explorer.rs
  • crates/api-core/src/tests/expected_machine.rs
  • crates/api-core/src/tests/machine_interfaces.rs
  • crates/api-core/src/tests/preingestion_dpu_nic_mode.rs
  • crates/api-core/src/tests/sku.rs
  • crates/api-core/tests/integration/explored_mlx_devices.rs
  • crates/api-db/src/expected_machine.rs
  • crates/api-db/src/expected_machine/tests.rs
  • crates/api-db/src/machine_interface.rs
  • crates/api-integration-tests/tests/lib.rs
  • crates/api-model/src/expected_machine.rs
  • crates/api-model/src/machine/mod.rs
  • crates/api-model/src/machine_boot_interface.rs
  • crates/api-model/src/site_explorer/mod.rs
  • crates/api-model/src/test_support/dpu.rs
  • crates/api-model/src/test_support/machine_snapshot.rs
  • crates/bmc-explorer/src/computer_system.rs
  • crates/machine-a-tron/Cargo.toml
  • crates/machine-a-tron/src/api_client.rs
  • crates/machine-a-tron/src/machine_a_tron.rs
  • crates/machine-controller/src/boot_interface.rs
  • crates/machine-controller/src/handler.rs
  • crates/preingestion-manager/src/lib.rs
  • crates/redfish/src/boot_interface.rs
  • crates/redfish/src/libredfish/conv.rs
  • crates/rpc/proto/forge.proto
  • crates/rpc/src/model/expected_machine.rs
  • crates/rpc/src/model/site_explorer.rs
  • crates/rpc/src/protos/mod.rs
  • crates/site-explorer/src/bmc_endpoint_explorer.rs
  • crates/site-explorer/src/config.rs
  • crates/site-explorer/src/endpoint_explorer.rs
  • crates/site-explorer/src/lib.rs
  • crates/site-explorer/src/machine_creator.rs
  • crates/site-explorer/src/metrics.rs
  • crates/site-explorer/src/test_support/mock_endpoint_explorer.rs
  • crates/site-explorer/tests/integration/site_explorer.rs
  • crates/site-explorer/tests/integration/zero_dpu.rs
  • rest-api/proto/core/src/v1/nico_nico.proto

Comment thread crates/api-model/src/expected_machine.rs
@chet

chet commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

Good catch: this is a real pre-existing behavior, not a regression from this refactor. origin/main has the same DpuMode::NicMode plus observed None path returning Ok(true); this PR maps it 1:1 to HostDpuPolicy::UseAsNic. Fixing it needs a separate behavioral change because BF4 intentionally has no observable mode and is allowed to pair, while returning false here would incorrectly drive a reset without having issued a mode change. I am leaving this PR behavior-compatible and deferring unknown-mode reconciliation to a focused follow-up with direct- and fallback-match coverage.

@chet

chet commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full_review, thanks!

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

@chet, understood — kicking off another full review now. As before, since the diff appears unchanged since the last pass, this will likely resurface the same single nitpick (the host_dpu_policy structured log field rename at Line 3342 in crates/site-explorer/src/lib.rs) with no new actionable findings, unless new commits have landed. Also, thanks for the detailed context on the BF4/UseAsNic observed-mode behavior — that's a fair rationale for deferring the reconciliation fix to a focused follow-up rather than bundling it here.

✅ Action performed

Full review finished.

@chet
chet force-pushed the gh-issue-3447 branch 3 times, most recently from 74935d1 to 98ebf04 Compare July 17, 2026 06:20
…ce mode

`HostDpuPolicy::{Manage, Nic, Ignore}` is now the policy vocabulary across per-host and site configuration, the API model, clients, and site-explorer. Observed hardware state is `BlueFieldOperatingMode::{Dpu, Nic}`, so intent no longer shares a type name with what a card reports.

This remains backwards compatible across the configuration, wire, storage, and generated-client boundaries:

- `ExpectedMachine.dpu_mode` remains protobuf field 16 with the original `DpuMode` symbols and numeric values. RPC code translates that stable shell directly into `HostDpuPolicy`.

- Missing, unspecified, and unknown wire values retain the historical `Manage` default and site-policy inheritance behavior.

- Configuration and admin JSON serialize the canonical `manage`, `nic`, and `ignore` values while accepting the previous `use_as_nic` value and legacy `dpu_mode` key and values. Provider-local normalization also preserves global < site < environment precedence when old and new keys are mixed.

- The CLI exposes `--dpu-policy manage|nic|ignore` while accepting the previous `use-as-nic` value and legacy `--dpu-mode dpu-mode|nic-mode|no-dpu` spellings.

- Old generated clients and old servers continue to interoperate because clients send only the unchanged field 16 compatibility surface.

- The protobuf and Redfish `NicMode` boundary retains its symbols and numeric meanings; model code uses `BlueFieldOperatingMode` for the observed state.

- The existing PostgreSQL column, type, and stored labels remain unchanged.

`Ignore` hosts with a declared primary NIC also refresh a stale boot-interface pair before their early exit, keeping zero-DPU boot targeting aligned with the other policy paths.

Tests updated!

This supports NVIDIA#3447

Signed-off-by: Chet Nichols III <chetn@nvidia.com>
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.

2 participants