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, UseAsNic, 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 stays backwards compatible at the input, wire, storage, and generated-client boundaries:

  • Legacy dpu_mode fields, flags, and values continue to deserialize.
  • The protobuf DpuMode and NicMode types, field names, symbols, and numeric meanings remain unchanged as compatibility boundaries.
  • New Rust callers use policy- and observed-state aliases at those protobuf boundaries; existing generated Rust and Go clients retain their legacy names.
  • The existing PostgreSQL column, type, and stored labels remain unchanged.
  • Per-host Manage and omitted policies preserve the existing site-policy inheritance behavior.
  • Observed mode continues to serialize as DpuMode and NicMode.

The canonical configuration and CLI vocabulary is now dpu_policy with manage, use_as_nic, and ignore.

Documentation is split into #3472 for separate technical-writer review.

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

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: a7165f06-a9bd-4149-8194-4f4a36f20c63

📥 Commits

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

⛔ 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

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

The change replaces configured DPU modes with HostDpuPolicy, distinguishes observed hardware state as BlueFieldOperatingMode, preserves legacy wire, JSON, TOML, and CLI compatibility, and updates persistence, RPC conversion, machine registration, and Site Explorer behavior.

Changes

Host DPU policy migration

Layer / File(s) Summary
Policy contracts, compatibility, and persistence
crates/api-model/..., crates/rpc/..., crates/site-explorer/src/config.rs, crates/api-db/...
Adds policy resolution and inheritance, maps omitted policies to Manage, preserves legacy protobuf names and values, and stores policies through the existing database dpu_mode column.
Observed BlueField operating mode
crates/api-model/src/site_explorer/mod.rs, crates/bmc-explorer/..., crates/redfish/..., crates/preingestion-manager/...
Replaces observed NicMode usage with BlueFieldOperatingMode across models, conversions, endpoint APIs, and device handling.
Policy-driven Site Explorer ingestion
crates/site-explorer/src/lib.rs, crates/api-core/src/handlers/..., crates/site-explorer/src/metrics.rs
Resolves effective host policy, handles Ignore hosts, gates zero-DPU ingestion using managed-DPU expectations, attaches DPUs by policy, and configures target operating modes.
CLI and machine registration wiring
crates/admin-cli/..., crates/machine-a-tron/...
Introduces --dpu-policy and policy-shaped request fields while retaining legacy CLI and JSON aliases.
Validation and integration coverage
crates/api-core/..., crates/site-explorer/tests/..., crates/admin-cli/src/expected_machines/tests.rs
Updates configuration, RPC, database, CLI parsing, deserialization, zero-DPU, operating-mode, and Site Explorer integration tests.

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

Sequence Diagram(s)

sequenceDiagram
  participant ExpectedMachine
  participant SiteExplorer
  participant BlueFieldEndpoint
  participant BmcEndpointExplorer
  ExpectedMachine->>SiteExplorer: resolve HostDpuPolicy
  SiteExplorer->>BlueFieldEndpoint: inspect BlueFieldOperatingMode
  SiteExplorer->>SiteExplorer: apply Ignore, UseAsNic, or Manage behavior
  SiteExplorer->>BmcEndpointExplorer: configure target operating mode when needed
  BmcEndpointExplorer->>BlueFieldEndpoint: set NIC or DPU mode
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the refactor from host DPU policy to observed device mode terminology.
Description check ✅ Passed The description is directly aligned with the changeset and clearly describes the policy/mode split and compatibility goals.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@chet

chet 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 13 30 78 7 131
machine-validation-runner 800 40 234 292 36 198
machine_validation 807 40 234 288 36 209
machine_validation-aarch64 800 40 234 292 36 198
nvmetal-carbide 807 40 234 288 36 209
TOTAL 3479 173 966 1244 151 945

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

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
crates/admin-cli/src/expected_machines/show/cmd.rs (1)

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

Use carbide-test-support's table-driven macros for consistency.

This new test loops over a plain tuple array instead of check_values/value_scenarios!, unlike every other DPU-policy test added in this PR (crates/api-model/src/expected_machine.rs, crates/rpc/src/model/expected_machine.rs).

♻️ Proposed refactor
 #[cfg(test)]
 mod tests {
-    use rpc::forge::HostDpuPolicy;
+    use carbide_test_support::{Check, check_values};
+    use rpc::forge::HostDpuPolicy;

     use super::dpu_policy_display;

     #[test]
     fn dpu_policy_display_uses_canonical_policy_vocabulary() {
-        for (wire_value, expected) in [
-            (None, "manage"),
-            (Some(HostDpuPolicy::Unspecified as i32), "manage"),
-            (Some(HostDpuPolicy::Manage as i32), "manage"),
-            (Some(HostDpuPolicy::UseAsNic as i32), "use-as-nic"),
-            (Some(HostDpuPolicy::Ignore as i32), "ignore"),
-            (Some(i32::MAX), "manage"),
-        ] {
-            assert_eq!(dpu_policy_display(wire_value), expected);
-        }
+        check_values(
+            [
+                Check { scenario: "absent wire value", input: None, expect: "manage" },
+                Check { scenario: "unspecified sentinel", input: Some(HostDpuPolicy::Unspecified as i32), expect: "manage" },
+                Check { scenario: "manage", input: Some(HostDpuPolicy::Manage as i32), expect: "manage" },
+                Check { scenario: "use as nic", input: Some(HostDpuPolicy::UseAsNic as i32), expect: "use-as-nic" },
+                Check { scenario: "ignore", input: Some(HostDpuPolicy::Ignore as i32), expect: "ignore" },
+                Check { scenario: "unknown discriminant", input: Some(i32::MAX), expect: "manage" },
+            ],
+            dpu_policy_display,
+        );
     }
 }

As per coding guidelines, "Use table-driven tests for functions mapping inputs to outputs, errors, or observable results. In Rust tests, prefer carbide-test-support's scenarios!, value_scenarios!, check_cases, and check_values appropriately."

🤖 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 215 - 234,
Update the test dpu_policy_display_uses_canonical_policy_vocabulary to use
carbide-test-support’s table-driven value_scenarios! or check_values macro,
matching the patterns used by the other DPU-policy tests. Preserve all existing
wire-value and expected-output cases, including unspecified, unknown, and None
values.

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/site_explorer.rs`:
- Around line 396-398: Update the doc comment above the relevant integration
test to state that hosts are skipped only when ExpectedMachine resolves to
HostDpuPolicy::Manage, while Ignore and UseAsNic bypass the strict zero-DPU
gate. Preserve the existing warning and NoDpuReportedByHost metric details.

---

Nitpick comments:
In `@crates/admin-cli/src/expected_machines/show/cmd.rs`:
- Around line 215-234: Update the test
dpu_policy_display_uses_canonical_policy_vocabulary to use
carbide-test-support’s table-driven value_scenarios! or check_values macro,
matching the patterns used by the other DPU-policy tests. Preserve all existing
wire-value and expected-output cases, including unspecified, unknown, and None
values.
🪄 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: ad1df007-a6e8-4564-be50-8a496d4c12d3

📥 Commits

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

⛔ 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

Comment thread crates/site-explorer/tests/integration/site_explorer.rs Outdated
…ce mode

`HostDpuPolicy::{Manage, UseAsNic, 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 stays backwards compatible at the input, wire, storage, and generated-client boundaries:

- Legacy `dpu_mode` fields, flags, and values continue to deserialize.
- The protobuf `DpuMode` and `NicMode` types, field names, symbols, and numeric meanings remain unchanged as compatibility boundaries.
- New Rust callers use policy- and observed-state aliases at those protobuf boundaries; existing generated Rust and Go clients retain their legacy names.
- The existing PostgreSQL column, type, and stored labels remain unchanged.
- Per-host `Manage` and omitted policies preserve the existing site-policy inheritance behavior.
- Observed mode continues to serialize as `DpuMode` and `NicMode`.

The canonical configuration and CLI vocabulary is now `dpu_policy` with `manage`, `use_as_nic`, and `ignore`.

Tests updated!

This supports NVIDIA#3447

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

Copy link
Copy Markdown
Contributor

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
putComment timed out

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.

1 participant