Skip to content

refactor: make tracing logs consistently structured and searchable#3479

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

refactor: make tracing logs consistently structured and searchable#3479
chet wants to merge 1 commit into
NVIDIA:mainfrom
chet:gh-issue-3476

Conversation

@chet

@chet chet commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Along with making tracing events consistently structured, this starts establishing a common set of field names wherever the values make that practical -- easier searches and docs now, and a useful step toward deriving log schemas later.

  • Convert roughly 1,500 direct tracing events across more than 50 crates to stable messages with semantic structured fields.
  • Standardize common keys such as error, machine_id, bmc_ip_address, and type-derived identifiers while keeping role names where they add real context.
  • Keep event messages focused on the event itself rather than narrating attached fields such as IDs or addresses.
  • Document the structured-logging convention and core field vocabulary in STYLE_GUIDE.md, including IDs, addresses, states, counts, quantities, field formatting, and narrow presentation-oriented exceptions.
  • Preserve trace levels, intentional Display, Debug, custom formatting, CLI output, child-process streams, aligned or multiline displays, and logging fixtures where the rendered text is itself the payload.

Verification

  • cargo make format-nightly
  • cargo make clippy
  • cargo make carbide-lints
  • Earlier sweep: tests across 24 affected libraries, all 1,442 API-core library tests, and a nine-library regression matrix.
  • Final standard-key follow-up: all 25 DHCP-server tests passed plus a syntax-aware residual audit of tracing keys.
  • Final API-core rerun: 1,360 tests passed; 85 DB-backed tests failed together after the local Postgres server terminated template-migration connections with SQLSTATE 57P01 and stopped responding. Five tests were ignored.
  • Paired local CodeRabbit and independent Claude reviews, followed by a thread-aware audit of the remaining cloud-review comments and an independent post-fix sanity pass.
  • Final feedback loop: all verified findings addressed, formatter/Clippy/Carbide gates rerun, and the last local CodeRabbit review completed with no findings.

This supports #3476

@chet chet requested a review from a team as a code owner July 14, 2026 08:35
@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

Review Change Stack

Important

Review skipped

Too many files!

This PR contains 376 files, which is 76 over the limit of 300.

To get a review, narrow the scope:
• coderabbit review --type committed # exclude uncommitted changes
• coderabbit review --dir # limit to a subdirectory
• coderabbit review --base # compare against a closer base

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 0b66f52e-82bb-4abd-8448-1c914d1274d6

📥 Commits

Reviewing files that changed from the base of the PR and between eb4ea22 and e86b163.

📒 Files selected for processing (376)
  • STYLE_GUIDE.md
  • crates/admin-cli/src/machine/show/cmd.rs
  • crates/admin-cli/src/rpc.rs
  • crates/agent/src/agent_platform.rs
  • crates/agent/src/astra_weave.rs
  • crates/agent/src/containerd/container.rs
  • crates/agent/src/containerd/image.rs
  • crates/agent/src/dhcp_server_grpc_client.rs
  • crates/agent/src/dpu/interface.rs
  • crates/agent/src/dpu/link.rs
  • crates/agent/src/dpu/route.rs
  • crates/agent/src/ethernet_virtualization.rs
  • crates/agent/src/extension_services/dpu_extension_service_observability.rs
  • crates/agent/src/extension_services/k8s_pod_handler.rs
  • crates/agent/src/hbn.rs
  • crates/agent/src/health.rs
  • crates/agent/src/health/bgp.rs
  • crates/agent/src/host_machine_id.rs
  • crates/agent/src/instance_metadata_endpoint.rs
  • crates/agent/src/instrumentation.rs
  • crates/agent/src/lib.rs
  • crates/agent/src/machine_inventory_updater.rs
  • crates/agent/src/main_loop.rs
  • crates/agent/src/managed_files.rs
  • crates/agent/src/mtu.rs
  • crates/agent/src/netlink.rs
  • crates/agent/src/network_monitor.rs
  • crates/agent/src/nvue.rs
  • crates/agent/src/ovs.rs
  • crates/agent/src/periodic_config_fetcher.rs
  • crates/agent/src/tests/common/mod.rs
  • crates/agent/src/tests/full.rs
  • crates/agent/src/tests/test_network_monitor.rs
  • crates/agent/src/traffic_intercept_bridging.rs
  • crates/agent/src/upgrade.rs
  • crates/agent/src/util.rs
  • crates/agent/src/weave_ew_vpc_mock_server.rs
  • crates/api-core/src/api.rs
  • crates/api-core/src/attestation/measured_boot.rs
  • crates/api-core/src/attestation/tpm_ca_cert.rs
  • crates/api-core/src/credentials/bmc_session_manager.rs
  • crates/api-core/src/db_init.rs
  • crates/api-core/src/dhcp/discover.rs
  • crates/api-core/src/dhcp/v6.rs
  • crates/api-core/src/dpa/handler.rs
  • crates/api-core/src/dynamic_settings.rs
  • crates/api-core/src/errors.rs
  • crates/api-core/src/handlers/api.rs
  • crates/api-core/src/handlers/astra.rs
  • crates/api-core/src/handlers/attestation.rs
  • crates/api-core/src/handlers/bmc_endpoint_explorer.rs
  • crates/api-core/src/handlers/bmc_metadata.rs
  • crates/api-core/src/handlers/client_resolution.rs
  • crates/api-core/src/handlers/component_manager.rs
  • crates/api-core/src/handlers/dns.rs
  • crates/api-core/src/handlers/dpu.rs
  • crates/api-core/src/handlers/dpu_remediation.rs
  • crates/api-core/src/handlers/expected_machine.rs
  • crates/api-core/src/handlers/extension_service.rs
  • crates/api-core/src/handlers/finder.rs
  • crates/api-core/src/handlers/firmware.rs
  • crates/api-core/src/handlers/instance.rs
  • crates/api-core/src/handlers/instance_type.rs
  • crates/api-core/src/handlers/machine.rs
  • crates/api-core/src/handlers/machine_discovery.rs
  • crates/api-core/src/handlers/machine_identity.rs
  • crates/api-core/src/handlers/machine_interface.rs
  • crates/api-core/src/handlers/machine_interface_address.rs
  • crates/api-core/src/handlers/machine_scout.rs
  • crates/api-core/src/handlers/machine_validation.rs
  • crates/api-core/src/handlers/managed_host.rs
  • crates/api-core/src/handlers/rack.rs
  • crates/api-core/src/handlers/redfish.rs
  • crates/api-core/src/handlers/scout_stream.rs
  • crates/api-core/src/handlers/secrets.rs
  • crates/api-core/src/handlers/site_explorer.rs
  • crates/api-core/src/handlers/spx_partition.rs
  • crates/api-core/src/handlers/svpc.rs
  • crates/api-core/src/handlers/tenant_identity_config.rs
  • crates/api-core/src/handlers/tenant_keyset.rs
  • crates/api-core/src/handlers/uefi.rs
  • crates/api-core/src/handlers/vpc.rs
  • crates/api-core/src/instance/mod.rs
  • crates/api-core/src/ipxe.rs
  • crates/api-core/src/listener.rs
  • crates/api-core/src/logging/setup.rs
  • crates/api-core/src/machine_identity/token_exchange.rs
  • crates/api-core/src/machine_update_manager/dpu_nic_firmware.rs
  • crates/api-core/src/machine_update_manager/host_firmware.rs
  • crates/api-core/src/machine_update_manager/mod.rs
  • crates/api-core/src/machine_validation/mod.rs
  • crates/api-core/src/measured_boot/metrics_collector/mod.rs
  • crates/api-core/src/mqtt_state_change_hook/hook.rs
  • crates/api-core/src/mqtt_state_change_hook/republisher.rs
  • crates/api-core/src/run.rs
  • crates/api-core/src/scout_stream.rs
  • crates/api-core/src/setup.rs
  • crates/api-core/src/tests/common/api_fixtures/dpu.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/common/api_fixtures/test_machine/mod.rs
  • crates/api-core/src/tests/dns.rs
  • crates/api-core/src/tests/dpu_reprovisioning.rs
  • crates/api-core/src/tests/instance.rs
  • crates/api-core/src/tests/machine_network.rs
  • crates/api-core/src/tests/sku.rs
  • crates/api-core/tests/integration/machine_bmc_metadata.rs
  • crates/api-db/src/bmc_metadata.rs
  • crates/api-db/src/carbide_version.rs
  • crates/api-db/src/dns/resource_record.rs
  • crates/api-db/src/expected_power_shelf.rs
  • crates/api-db/src/expected_switch.rs
  • crates/api-db/src/host_naming/mod.rs
  • crates/api-db/src/instance.rs
  • crates/api-db/src/instance_address.rs
  • crates/api-db/src/lib.rs
  • crates/api-db/src/machine.rs
  • crates/api-db/src/machine_interface.rs
  • crates/api-db/src/machine_topology.rs
  • crates/api-db/src/measured_boot/bundle.rs
  • crates/api-db/src/network_segment.rs
  • crates/api-db/src/resource_pool.rs
  • crates/api-db/src/vpc_dpu_loopback.rs
  • crates/api-db/src/work_lock_manager.rs
  • crates/api-integration-tests/tests/lib.rs
  • crates/api-model/src/dpa_interface/mod.rs
  • crates/api-model/src/firmware.rs
  • crates/api-model/src/instance/status/infiniband.rs
  • crates/api-model/src/instance/status/network.rs
  • crates/api-model/src/instance/status/nvlink.rs
  • crates/api-model/src/instance/status/spx.rs
  • crates/api-model/src/machine/mod.rs
  • crates/api-model/src/machine/nvlink.rs
  • crates/api-model/src/machine/spx.rs
  • crates/api-model/src/power_manager.rs
  • crates/api-model/src/site_explorer/mod.rs
  • crates/api-test-helper/src/domain.rs
  • crates/api-test-helper/src/instance.rs
  • crates/api-test-helper/src/machine.rs
  • crates/api-test-helper/src/machine_a_tron.rs
  • crates/api-test-helper/src/subnet.rs
  • crates/api-test-helper/src/tenant.rs
  • crates/api-test-helper/src/vpc.rs
  • crates/api-test-helper/src/vpc_prefix.rs
  • crates/api-web/src/attestation.rs
  • crates/api-web/src/auth.rs
  • crates/api-web/src/compute_allocation.rs
  • crates/api-web/src/domain.rs
  • crates/api-web/src/dpa.rs
  • crates/api-web/src/dpu_versions.rs
  • crates/api-web/src/expected_machine.rs
  • crates/api-web/src/expected_power_shelf.rs
  • crates/api-web/src/expected_rack.rs
  • crates/api-web/src/expected_switch.rs
  • crates/api-web/src/explored_endpoint.rs
  • crates/api-web/src/firmware.rs
  • crates/api-web/src/health.rs
  • crates/api-web/src/health_history.rs
  • crates/api-web/src/ib_fabric.rs
  • crates/api-web/src/ib_partition.rs
  • crates/api-web/src/instance.rs
  • crates/api-web/src/instance_type.rs
  • crates/api-web/src/interface.rs
  • crates/api-web/src/ipam.rs
  • crates/api-web/src/ipxe_template.rs
  • crates/api-web/src/lib.rs
  • crates/api-web/src/machine.rs
  • crates/api-web/src/machine_validation.rs
  • crates/api-web/src/managed_host.rs
  • crates/api-web/src/network_device.rs
  • crates/api-web/src/network_security_group.rs
  • crates/api-web/src/network_segment.rs
  • crates/api-web/src/network_status.rs
  • crates/api-web/src/nvlink.rs
  • crates/api-web/src/operating_system.rs
  • crates/api-web/src/power_shelf.rs
  • crates/api-web/src/rack.rs
  • crates/api-web/src/redfish_actions.rs
  • crates/api-web/src/redfish_browser.rs
  • crates/api-web/src/resource_pool.rs
  • crates/api-web/src/search.rs
  • crates/api-web/src/sku.rs
  • crates/api-web/src/spx_partition.rs
  • crates/api-web/src/state_history.rs
  • crates/api-web/src/switch.rs
  • crates/api-web/src/tenant.rs
  • crates/api-web/src/tenant_keyset.rs
  • crates/api-web/src/ufm_browser.rs
  • crates/api-web/src/vpc.rs
  • crates/bmc-explorer/src/chassis.rs
  • crates/bmc-explorer/src/computer_system.rs
  • crates/bmc-explorer/src/manager.rs
  • crates/bmc-mock/src/combined_server.rs
  • crates/bmc-mock/src/combined_service.rs
  • crates/bmc-mock/src/injection/store.rs
  • crates/bmc-mock/src/main.rs
  • crates/bmc-mock/src/middleware_router.rs
  • crates/bmc-mock/src/redfish/expander_router.rs
  • crates/bmc-mock/src/tar_router.rs
  • crates/bmc-mock/src/tls.rs
  • crates/bmc-proxy/src/bmc_proxy.rs
  • crates/bmc-proxy/src/metrics.rs
  • crates/bmc-proxy/src/setup.rs
  • crates/component-manager/src/nsm.rs
  • crates/component-manager/src/psm.rs
  • crates/component-manager/src/rms.rs
  • crates/dhcp-server/src/cache.rs
  • crates/dhcp-server/src/grpc_server.rs
  • crates/dhcp-server/src/main.rs
  • crates/dhcp-server/src/modes/controller.rs
  • crates/dhcp-server/src/packet_handler.rs
  • crates/dhcp-server/src/util.rs
  • crates/dns-record/src/lib.rs
  • crates/dns/src/lib.rs
  • crates/dns/src/main.rs
  • crates/dpa-manager/src/card_handler/astra.rs
  • crates/dpa-manager/src/card_handler/svpc.rs
  • crates/dpa-manager/src/lib.rs
  • crates/dpa/src/lib.rs
  • crates/dpf/src/bin/api_harness.rs
  • crates/dpf/src/sdk.rs
  • crates/dpf/src/watcher.rs
  • crates/dpu-fmds-shared/src/machine_identity.rs
  • crates/dpu-otel-agent/src/lib.rs
  • crates/dpu-remediation/src/remediation.rs
  • crates/dsx-exchange-consumer/src/api_client.rs
  • crates/firmware/src/config.rs
  • crates/firmware/src/downloader.rs
  • crates/fmds/src/http_request_metrics.rs
  • crates/fmds/src/main.rs
  • crates/fmds/src/nic_init.rs
  • crates/fmds/src/phone_home.rs
  • crates/health/src/api_client.rs
  • crates/health/src/bmc.rs
  • crates/health/src/collectors/discovery.rs
  • crates/health/src/collectors/entity_metrics.rs
  • crates/health/src/collectors/gpu_inventory.rs
  • crates/health/src/collectors/leak_detector.rs
  • crates/health/src/collectors/logs/periodic.rs
  • crates/health/src/collectors/nvue/gnmi/client.rs
  • crates/health/src/collectors/nvue/gnmi/on_change_processor.rs
  • crates/health/src/collectors/nvue/gnmi/sample_processor.rs
  • crates/health/src/collectors/sensors.rs
  • crates/health/src/discovery/cleanup.rs
  • crates/health/src/discovery/context.rs
  • crates/health/src/discovery/spawn.rs
  • crates/health/src/endpoint/cluster.rs
  • crates/health/src/endpoint/sources.rs
  • crates/health/src/metrics.rs
  • crates/health/src/otlp/drain.rs
  • crates/health/src/otlp/metrics_drain.rs
  • crates/health/src/sink/log_file.rs
  • crates/host-support/src/hardware_enumeration.rs
  • crates/host-support/src/hardware_enumeration/dpu.rs
  • crates/host-support/src/hardware_enumeration/gpu.rs
  • crates/host-support/src/hardware_enumeration/tpm.rs
  • crates/host-support/src/registration.rs
  • crates/http-connector/src/connector.rs
  • crates/http-connector/src/resolver.rs
  • crates/ib-fabric/src/lib.rs
  • crates/ib-partition-controller/src/handler.rs
  • crates/ipmi/src/tool.rs
  • crates/kms-provider/src/providers/transit.rs
  • crates/libmlx/src/device/discovery.rs
  • crates/libmlx/src/firmware/flasher.rs
  • crates/libmlx/src/firmware/reset.rs
  • crates/libmlx/src/firmware/source.rs
  • crates/libnmxc/src/lib.rs
  • crates/libnmxm/src/lib.rs
  • crates/logfmt/benches/logfmt_layer.rs
  • crates/machine-a-tron/src/api_client.rs
  • crates/machine-a-tron/src/api_throttler.rs
  • crates/machine-a-tron/src/bmc_mock_wrapper.rs
  • crates/machine-a-tron/src/dhcp_wrapper.rs
  • crates/machine-a-tron/src/host_machine.rs
  • crates/machine-a-tron/src/machine_a_tron.rs
  • crates/machine-a-tron/src/machine_state_machine.rs
  • crates/machine-a-tron/src/machine_utils.rs
  • crates/machine-a-tron/src/main.rs
  • crates/machine-a-tron/src/mock_ssh_server.rs
  • crates/machine-a-tron/src/subnet.rs
  • crates/machine-a-tron/src/tui.rs
  • crates/machine-a-tron/src/vpc.rs
  • crates/machine-controller/src/dpf.rs
  • crates/machine-controller/src/handler.rs
  • crates/machine-controller/src/handler/attestation.rs
  • crates/machine-controller/src/handler/bios_config.rs
  • crates/machine-controller/src/handler/dpf.rs
  • crates/machine-controller/src/handler/host_boot_config.rs
  • crates/machine-controller/src/handler/machine_validation.rs
  • crates/machine-controller/src/handler/power.rs
  • crates/machine-controller/src/handler/sku.rs
  • crates/machine-validation/src/machine_validation.rs
  • crates/metrics-endpoint/src/lib.rs
  • crates/metrics-utils/src/lib.rs
  • crates/mqttea-example/src/main.rs
  • crates/mqttea/src/auth/oauth2_provider.rs
  • crates/mqttea/src/client/core.rs
  • crates/mqttea/src/client/messages.rs
  • crates/mqttea/src/registry/core.rs
  • crates/network-segment-controller/src/handler.rs
  • crates/nvlink-manager/src/lib.rs
  • crates/nvlink-manager/src/switch_cert_monitor.rs
  • crates/power-shelf-controller/src/configuring.rs
  • crates/power-shelf-controller/src/deleting.rs
  • crates/power-shelf-controller/src/fetching_data.rs
  • crates/power-shelf-controller/src/initializing.rs
  • crates/preingestion-manager/src/bfb_rshim_copier.rs
  • crates/preingestion-manager/src/lib.rs
  • crates/preingestion-manager/tests/integration/host_bmc_firmware.rs
  • crates/rack-controller/src/created.rs
  • crates/rack-controller/src/discovering.rs
  • crates/rack-controller/src/error_state.rs
  • crates/rack-controller/src/handler.rs
  • crates/rack-controller/src/lib.rs
  • crates/rack-controller/src/maintenance.rs
  • crates/rack-controller/src/ready.rs
  • crates/rack-controller/src/validating.rs
  • crates/rpc-utils/src/managed_host_display.rs
  • crates/rpc/src/errors.rs
  • crates/rpc/src/forge_tls_client.rs
  • crates/rpc/src/model/dpu_remediation.rs
  • crates/rpc/src/model/machine/mod.rs
  • crates/rvs/src/artifact/io.rs
  • crates/rvs/src/bin/carbide-rvs.rs
  • crates/rvs/src/rack/tray.rs
  • crates/rvs/src/validation/io.rs
  • crates/scout/src/attestation.rs
  • crates/scout/src/deprovision/scrabbing.rs
  • crates/scout/src/firmware_upgrade.rs
  • crates/scout/src/main.rs
  • crates/scout/src/mlx_device.rs
  • crates/scout/src/register.rs
  • crates/scout/src/stream.rs
  • crates/scout/src/tpm.rs
  • crates/secrets/src/forge_vault.rs
  • crates/secrets/src/local_credentials/file.rs
  • crates/site-explorer/src/bmc_endpoint_explorer.rs
  • crates/site-explorer/src/boot_order_tracker.rs
  • crates/site-explorer/src/explored_endpoint_index.rs
  • crates/site-explorer/src/lib.rs
  • crates/site-explorer/src/machine_creator.rs
  • crates/site-explorer/src/redfish.rs
  • crates/site-explorer/src/switch_creator.rs
  • crates/site-explorer/src/test_support/mock_endpoint_explorer.rs
  • crates/site-explorer/tests/integration/power_shelf.rs
  • crates/site-explorer/tests/integration/site_explorer.rs
  • crates/site-explorer/tests/integration/switch.rs
  • crates/spdm-controller/src/handler.rs
  • crates/ssh-console-mock-api-server/src/lib.rs
  • crates/ssh-console/src/bmc/client.rs
  • crates/ssh-console/src/bmc/connection.rs
  • crates/ssh-console/src/bmc/connection_impl/ipmi.rs
  • crates/ssh-console/src/bmc/connection_impl/ssh.rs
  • crates/ssh-console/src/bmc/message_proxy.rs
  • crates/ssh-console/src/config.rs
  • crates/ssh-console/src/console_logger.rs
  • crates/ssh-console/src/frontend.rs
  • crates/ssh-console/src/metrics.rs
  • crates/ssh-console/src/ssh_cert_parsing.rs
  • crates/ssh-console/src/ssh_server.rs
  • crates/ssh-console/tests/util/ipmi_sim.rs
  • crates/ssh-console/tests/util/mod.rs
  • crates/state-controller/src/controller.rs
  • crates/state-controller/src/controller/periodic_enqueuer.rs
  • crates/state-controller/src/controller/processor.rs
  • crates/switch-controller/src/certificate.rs
  • crates/switch-controller/src/configuring.rs
  • crates/switch-controller/src/created.rs
  • crates/switch-controller/src/deleting.rs
  • crates/switch-controller/src/error_state.rs
  • crates/switch-controller/src/fetch_info.rs
  • crates/switch-controller/src/initializing.rs
  • crates/switch-controller/src/ready.rs
  • crates/switch-controller/src/validating.rs
  • crates/vpc-prefix-controller/src/handler.rs

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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 pull request standardizes tracing across application, controller, service, library, mock, and test code by replacing interpolated messages with stable messages and structured fields. It also documents the conventions and exceptions in STYLE_GUIDE.md.

Changes

Structured tracing migration

Layer / File(s) Summary
Logging conventions
STYLE_GUIDE.md
Defines stable literal event messages, structured dynamic fields, shorthand formatting, semantic field naming, formatter-key restrictions, and payload-formatting exceptions.
Runtime instrumentation
crates/agent/..., crates/api-core/..., crates/api-db/..., crates/machine-controller/..., crates/preingestion-manager/..., crates/site-explorer/...
Converts operational logs and error reports to structured tracing fields while preserving control flow.
Supporting components and tests
crates/*
Applies the same logging format across networking, hardware, firmware, MQTT, controllers, mocks, helpers, and integration tests.
Focused observability refactors
crates/health/src/discovery/*, crates/api-db/src/work_lock_manager.rs, crates/ib-fabric/src/lib.rs
Standardizes collector stop reasons, task logging, failure-stage fields, and selected tracing imports.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related issues

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 97.12% 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 The title accurately summarizes the dominant change: standardizing tracing logs into structured, searchable events.
Description check ✅ Passed The description is directly aligned with the change set and its verification notes; it is detailed and on-topic.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

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

Caution

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

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

387-438: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Model failure_stage as an enum.

failure_stage has a closed set of values (build_client, health_check, load_ports, and load_partitions) but is represented as &'static str. Introduce an internal enum with Display, pass variants at these call sites, and log it with %failure_stage so invalid stage values cannot be introduced accidentally.

As per coding guidelines, finite Rust values should be modeled with enums rather than raw strings.

Also applies to: 456-468

🤖 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/ib-fabric/src/lib.rs` around lines 387 - 438, Replace the raw
`&'static str` failure-stage parameter used by `note_fabric_error` with an
internal enum covering `build_client`, `health_check`, `load_ports`, and
`load_partitions`; implement `Display` for that enum, pass the corresponding
variants at every visible call site, and format the stage with `%failure_stage`
in logging.

Source: Coding guidelines

crates/nvlink-manager/src/lib.rs (1)

2381-2397: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Do not skip DB persistence for a created NMX-C partition. If partition_id is missing or does not fit i32, this path records success and commits the transaction while leaving the new external partition without a database row. That leaves reconciliation with an inconsistent source of truth; either widen the stored ID type or fail the operation with a recovery path instead of continueing.

🤖 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/nvlink-manager/src/lib.rs` around lines 2381 - 2397, The NMX-C
partition creation flow must not commit success when the partition ID is missing
or cannot fit the database type. Update the handling around
matching_partition.partition_id and the i32::try_from conversion to use a
compatible wider stored ID or fail the operation through the existing
recovery/error path, ensuring no successful transaction commits without
persisting the created partition.
🧹 Nitpick comments (13)
crates/machine-controller/src/handler.rs (1)

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

Avoid discarding the Result with let _ =.

This path intentionally treats rshim failure as non-blocking, but let _ = obscures that intent. Use an explicit if let Err(e) branch (or .ok()) so the ignored failure is deliberate and readable.

As per coding guidelines, intentionally ignored results should use .ok() rather than discarding them with let _.

🤖 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-controller/src/handler.rs` at line 4101, Update the rshim
enablement error-handling chain around the tracing call to avoid discarding the
Result with let _. Use .ok() to explicitly mark the non-blocking failure as
intentionally ignored, while preserving the existing info-level error logging.

Source: Coding guidelines

crates/agent/src/upgrade.rs (1)

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

Record errors directly instead of eagerly flattening them.

error = format!("{err:#}") allocates and converts the report into an untyped string, contrary to the structured-field convention. Use error = ?err for debug/chain context, or %err when display formatting is intended, including at Line 146.

Also applies to: 83-86, 146-146

🤖 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/agent/src/upgrade.rs` around lines 72 - 75, Update the error fields in
the upgrade error logs, including the branches around the shown log and line
146, to record the error directly with structured tracing syntax instead of
eagerly calling format!. Use debug capture for chained report context (or
display capture where explicitly intended), preserving the existing messages and
control flow.

Source: Coding guidelines

crates/api-core/src/scout_stream.rs (1)

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

Apply tracing shorthand consistently across the refactor. These explicit same-name assignments are valid but redundant and conflict with the repository logging convention.

  • crates/api-core/src/scout_stream.rs#L103-L106: replace machine_id = %machine_id with %machine_id.
  • crates/api-core/src/scout_stream.rs#L120-L125: replace same-name machine_id and flow_uuid assignments with shorthand.
  • crates/api-core/src/scout_stream.rs#L128-L133: replace same-name machine_id, flow_uuid, and response assignments with shorthand.
  • crates/api-core/src/scout_stream.rs#L140-L143: replace machine_id = %machine_id with %machine_id.
  • crates/api-core/src/scout_stream.rs#L150-L153: replace machine_id = %machine_id with %machine_id.
  • crates/api-core/src/scout_stream.rs#L156-L158: replace machine_id = %machine_id with %machine_id.
  • crates/api-core/src/scout_stream.rs#L218-L220: replace same-name machine_id and flow_uuid assignments with shorthand.
  • crates/api-core/src/scout_stream.rs#L270-L274: replace same-name machine_id and response assignments with shorthand.
  • crates/api-core/src/scout_stream.rs#L278-L282: replace same-name machine_id and flow_uuid_pb assignments with shorthand.
  • crates/api-core/src/handlers/machine_discovery.rs#L421-L421: replace stable_machine_id = %stable_machine_id with %stable_machine_id.
  • crates/api-test-helper/src/machine_a_tron.rs#L78-L78: replace desired_firmware = ?desired_firmware with ?desired_firmware.
  • crates/api-core/src/handlers/site_explorer.rs#L261-L261: replace bmc_ip = %bmc_ip with %bmc_ip.
  • crates/firmware/src/config.rs#L69-L69: replace key = %key with %key.
  • crates/firmware/src/config.rs#L186-L186: replace firmware_directory = ?firmware_directory with ?firmware_directory.
  • crates/firmware/src/config.rs#L207-L207: replace metadata_path = ?metadata_path with ?metadata_path.

As per coding guidelines, use native shorthand for tracing::Value fields.

🤖 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/scout_stream.rs` around lines 103 - 106, Replace
redundant same-name tracing field assignments with native shorthand while
preserving each field’s existing `%` or `?` formatter: update machine_id,
flow_uuid, response, and flow_uuid_pb in crates/api-core/src/scout_stream.rs at
103-106, 120-125, 128-133, 140-143, 150-153, 156-158, 218-220, 270-274, and
278-282; stable_machine_id in crates/api-core/src/handlers/machine_discovery.rs
at 421-421; desired_firmware in crates/api-test-helper/src/machine_a_tron.rs at
78-78; bmc_ip in crates/api-core/src/handlers/site_explorer.rs at 261-261; and
key, firmware_directory, and metadata_path in crates/firmware/src/config.rs at
69-69, 186-186, and 207-207.

Source: Coding guidelines

crates/api-db/src/machine_interface.rs (1)

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

Preserve the relay list as a structured value.

relays = %relaystr records a preformatted comma-separated string instead of the existing &[IpAddr]. Use relays = ?relays at both sites so the structured event retains the endpoint collection; keep relaystr only where the warning logs still require it.

Proposed change
 tracing::info!(
     %mac_address,
-    relays = %relaystr,
+    relays = ?relays,
     "Found no existing machine with mac address using networks with relays",
 );

As per coding guidelines and the PR objective, dynamic endpoint values should remain structured and searchable rather than being preformatted into a string.

Also applies to: 669-673

🤖 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-db/src/machine_interface.rs` around lines 610 - 614, Update the
info log in the machine lookup flow, and the corresponding log at the other
relay-reporting site, to record the original relays collection with structured
debug formatting (`relays = ?relays`) instead of the preformatted relaystr
string. Retain relaystr only for warning logs that explicitly require the
formatted representation.

Source: Coding guidelines

crates/agent/src/tests/full.rs (1)

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

Retain the error as a structured tracing value.

format!("{e:#}") eagerly allocates and converts the report into an untyped string. Prefer error = ?e or error = %e, depending on the desired rendering.

Proposed fix
-            tracing::error!(error = format!("{e:#}"), "Failed to start DPU agent");
+            tracing::error!(error = ?e, "Failed to start DPU agent");

As per coding guidelines, dynamic values should use tracing’s %field/?field forms rather than pre-rendered strings.

🤖 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/agent/src/tests/full.rs` at line 339, Update the tracing::error! call
in the DPU agent startup failure path to pass the captured error e directly as a
structured field, using tracing’s ? or % formatting syntax instead of
format!("{e:#}"). Preserve the existing "Failed to start DPU agent" message.

Sources: Coding guidelines, Path instructions

crates/api-core/src/machine_update_manager/host_firmware.rs (1)

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

Apply native tracing shorthand consistently.

These fields are valid but unnecessarily spell out same-name variables. Use the shorthand forms required by the repository convention.

  • crates/api-core/src/machine_update_manager/host_firmware.rs#L76-L79: use ?fw_config_snapshot.
  • crates/api-core/src/machine_update_manager/host_firmware.rs#L189-L192: use ?firmware_config.
  • crates/api-core/src/tests/dpu_reprovisioning.rs#L1359-L1362: use ?last_reboot_requested.
  • crates/dpu-remediation/src/remediation.rs#L231-L234: use ?error.
  • crates/machine-a-tron/src/host_machine.rs#L407-L410: use ?request.
  • crates/machine-a-tron/src/host_machine.rs#L429-L430: use dpu_index.
  • crates/machine-a-tron/src/host_machine.rs#L671-L674: use %machine_id.

As per coding guidelines, use native shorthand for tracing::Value fields.

🤖 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/machine_update_manager/host_firmware.rs` around lines 76
- 79, Update the affected tracing fields to use native same-name shorthand: in
crates/api-core/src/machine_update_manager/host_firmware.rs lines 76-79 for
fw_config_snapshot and lines 189-192 for firmware_config;
crates/api-core/src/tests/dpu_reprovisioning.rs lines 1359-1362 for
last_reboot_requested; crates/dpu-remediation/src/remediation.rs lines 231-234
for error; and crates/machine-a-tron/src/host_machine.rs lines 407-410 for
request, 429-430 for dpu_index, and 671-674 for machine_id. Preserve the
existing tracing levels and messages while using the appropriate debug or
display shorthand.

Sources: Coding guidelines, Path instructions

crates/api-core/src/handlers/svpc.rs (1)

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

Use Display formatting for the error field.

CarbideError is logged with ?e here, while adjacent handlers use %e. Change this to error = %e for consistent human-readable error output.

🤖 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/handlers/svpc.rs` around lines 424 - 428, Update the
tracing::error! call in the DPA device handler to format the CarbideError field
with Display syntax, changing the error field from debug formatting to %e while
preserving the existing device_info field and message.

Source: Coding guidelines

crates/api-core/src/handlers/extension_service.rs (1)

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

Use one consistent error field name for credential cleanup failures.

The create/update paths emit delete_error, while the delete path emits error for the same failure class. Standardize on one key so log queries and dashboards do not need two schemas.

This supports the PR objective of stable, searchable structured logging.

Also applies to: 390-393, 524-528

🤖 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/handlers/extension_service.rs` around lines 143 - 146,
Standardize credential cleanup failure logging on the existing delete_error
field name. Update the affected tracing::warn! calls in the create, update, and
delete paths, including the referenced locations, so each uses delete_error for
the deletion error value while preserving the existing messages and behavior.
crates/api-core/src/handlers/astra.rs (1)

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

Standardize Display formatting for String-valued tracing fields. These fields use Debug formatting for values that are plain strings, which can introduce quoting and inconsistent log output.

  • crates/api-core/src/handlers/astra.rs#L332-L335: change mac_address = ?obs.mac_address to mac_address = %obs.mac_address.
  • crates/scout/src/main.rs#L532-L535: use %device_action.pci_name.
  • crates/scout/src/main.rs#L565-L568: use %dev_pci_name.
  • crates/scout/src/main.rs#L588-L591: use %dev_pci_name.
  • crates/scout/src/main.rs#L665-L668: use %dev_pci_name.

As per coding guidelines, use %field for Display values and ?field for Debug values.

🤖 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/handlers/astra.rs` around lines 332 - 335, Standardize
tracing field formatting by using Display syntax for the String-valued fields:
update mac_address in crates/api-core/src/handlers/astra.rs (lines 332-335),
device_action.pci_name in crates/scout/src/main.rs (lines 532-535), and
dev_pci_name in crates/scout/src/main.rs (lines 565-568, 588-591, and 665-668)
from Debug formatting to Display formatting; leave other fields unchanged.

Source: Coding guidelines

crates/dhcp-server/src/main.rs (1)

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

Use Display formatting for listen_address.

Line 119 uses ?listen_address, while Line 159 uses %listen_address for the same SocketAddr field. Use %listen_address consistently so this semantic field follows the repository’s formatting convention.

Suggested fix
-                ?listen_address,
+                %listen_address,

As per coding guidelines, use %field for Display values and ?field for Debug values.

🤖 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/dhcp-server/src/main.rs` around lines 118 - 122, Update the DHCP
server listening log’s listen_address field in the tracing::info! call to use
Display formatting with %listen_address instead of Debug formatting with
?listen_address, matching the existing formatting used for the same field
elsewhere.

Source: Coding guidelines

crates/agent/src/machine_inventory_updater.rs (1)

107-108: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Use tracing’s %/? formatter instead of pre-formatting the error.

error = format!("{e:#}") materializes a new string before tracing records the event and bypasses the repository’s structured-field convention. Record e directly with error = %e or error = ?e, depending on the required rendering.

🤖 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/agent/src/machine_inventory_updater.rs` around lines 107 - 108, Update
the error field in the update_agent_reported_inventory error log to pass the
captured error directly through tracing’s formatter, using error = %e or error =
?e as appropriate, instead of pre-formatting it with format!("{e:#}").

Sources: Coding guidelines, Path instructions

crates/mqttea/src/client/core.rs (1)

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

Use Display formatting for error fields.

These are error values, so record them as error = %e / error = %cred_err rather than implementation-oriented Debug output.

Proposed change
- error = ?e,
+ error = %e,

- error!(error = ?e, "MQTT event loop connection error");
+ error!(error = %e, "MQTT event loop connection error");

- error = ?cred_err,
+ error = %cred_err,

As per coding guidelines, “Use native shorthand for tracing::Value, %field for Display, and ?field for Debug.”

Also applies to: 304-305, 325-327

🤖 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/mqttea/src/client/core.rs` around lines 180 - 183, Update the error
fields in the re-subscription and related error logs to use tracing’s Display
formatter (`%`) instead of Debug formatter (`?`) for the error values `e` and
`cred_err`. Apply this consistently to the occurrences around the fresh-session
handling and the additional locations identified in the comment.

Source: Coding guidelines

crates/preingestion-manager/src/lib.rs (1)

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

Handle the ignored RSHIM result explicitly.

Using map_err for logging and then discarding the transformed result obscures that failure is intentionally non-fatal.

Proposed change
- let _ = redfish_client
-     .enable_rshim_bmc()
-     .await
-     .map_err(|e| tracing::error!(error = %e, "Failed to enable RSHIM on BMC"));
+ if let Err(error) = redfish_client.enable_rshim_bmc().await {
+     tracing::error!(%error, "Failed to enable RSHIM on BMC");
+ }

As per coding guidelines, “Do not discard results with let _unused = foo(); use .ok() when failure is intentionally ignored.”

🤖 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/preingestion-manager/src/lib.rs` around lines 3244 - 3247, Update the
enable_rshim_bmc call to handle its non-fatal failure explicitly: retain the
existing error logging while converting the intentionally ignored result with
.ok() instead of using map_err followed by let _. Locate this change in the
RSHIM enablement flow around redfish_client.enable_rshim_bmc().await.

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/admin-cli/src/rpc.rs`:
- Around line 196-199: Preserve the conversion error in both structured logs:
update the invalid UUID-type log in crates/admin-cli/src/rpc.rs lines 196-199
and the invalid machine-owner log in lines 228-231 to include the caught error
as the structured field error = %e, while retaining the existing raw numeric
fields.

In `@crates/agent/src/nvue.rs`:
- Around line 1049-1055: Preserve child-process stdout/stderr as rendered log
message payloads rather than structured fields. Update the affected logging
sites in crates/agent/src/nvue.rs at lines 1049-1055, 923, 1010, 1029, and 1068,
and crates/agent/src/hbn.rs at lines 131-135; each site requires the same change
so multiline output and escaping remain operator-visible.

In `@crates/api-core/src/handlers/bmc_endpoint_explorer.rs`:
- Around line 396-399: In the is_infinite_boot_enabled handler’s successful
tracing::info! call, rename the structured field from ip_address to
endpoint_address while continuing to use bmc_endpoint_request.ip_address as its
value; keep the existing log message and other fields unchanged.

In `@crates/api-core/src/handlers/svpc.rs`:
- Around line 361-364: Update the error logging in the SVPC handler to avoid
serializing complete API payloads or model objects: at
crates/api-core/src/handlers/svpc.rs lines 361-364 remove the full req field; at
lines 372-375 replace full rep logging with a fixed diagnostic message; at lines
402-405 log only bounded report metadata; at lines 414-417 log bounded
observation identifiers; at lines 424-425 log selected device fields instead of
devinfo; and at lines 434-437 log selected DPA identifiers instead of the full
object. Apply the same bounded report metadata approach at lines 640-643, using
filtered identifiers, counts, and error context throughout.

In `@crates/api-core/src/machine_validation/mod.rs`:
- Around line 283-289: In the machine validation metrics update flow, move the
tracing::debug! call containing "Machine validation metrics updated" to execute
after self.metric_holder.update_metrics(metrics). Keep the logged metric fields
unchanged.

In `@crates/api-core/src/tests/common/api_fixtures/mod.rs`:
- Around line 2313-2317: Update the tracing::trace! fields
instance_network_config_version and instance_config_version to log their Option
values with Debug formatting, preserving None rather than converting missing
values to empty strings; leave the existing network_config_version field
unchanged.

In `@crates/api-db/src/work_lock_manager.rs`:
- Around line 322-367: Keep the keepalive task represented in the production
lock lifecycle instead of dropping join_handle, so unexpected task termination
is observed and handled. Update the surrounding release/close flow for the lock
manager to retain and asynchronously await the handle, or register it with the
manager’s JoinSet; use compile-time #[cfg(test)] and #[cfg(not(test))] branches
rather than cfg!(test), preserving the existing test behavior.

In `@crates/dns-record/src/lib.rs`:
- Line 182: Update the logging call in the serial-generation flow to parse
formatted_data into a numeric u32 before recording it. Replace the
string-formatted serial field in the debug! event with the parsed numeric value,
preserving the existing “generated serial for DNS zone” message and handling the
parse result appropriately.

In `@crates/health/src/api_client.rs`:
- Around line 330-333: Update the tracing::debug! call in the machine-details
fetch flow to report the actual fetched chunk size using ids_chunk.len() instead
of the fixed 100 value, while preserving the existing “Fetched machine details”
message and other fields.

In `@crates/machine-a-tron/src/machine_state_machine.rs`:
- Around line 566-569: Update the tracing::warn! call in the relay fallback
branch to use neutral wording that covers relay non-response, send failure, and
channel cancellation. Replace the “did not answer” message while retaining the
primary_mac context and direct-request fallback behavior.

In `@crates/machine-controller/src/handler.rs`:
- Around line 3918-3923: In the firmware lookup error handling within the
inspect_err closure, remove the standalone tracing::error call and retain only
the structured tracing::error event that includes machine_id and error. Ensure
each failed DPU UEFI firmware lookup emits exactly one error event.

In `@crates/nvlink-manager/src/lib.rs`:
- Around line 1817-1821: Update the tracing::error! message in the
RemoveFromUnknownPartition handling to use neutral wording for any missing NMX-C
partition, rather than referring specifically to a default partition; preserve
the existing GPU, machine, and partition context fields.

In `@crates/preingestion-manager/src/lib.rs`:
- Around line 1358-1360: Update the generic error arm in the chassis-reset
handling to include the endpoint address as a structured tracing field with a
stable semantic name, alongside the existing error field. Preserve the current
failure message and behavior while making the address available for correlating
concurrent reset failures.

In `@crates/scout/src/attestation.rs`:
- Around line 162-165: Remove sensitive authentication data from structured
logs: in crates/scout/src/attestation.rs lines 162-165, update the activation
log in the credential activation flow to replace digest.value() with a
non-sensitive indicator or metadata; in
crates/machine-a-tron/src/mock_ssh_server.rs lines 288-303, remove the password
field from both authentication log entries while preserving their non-sensitive
context.

In `@crates/site-explorer/src/bmc_endpoint_explorer.rs`:
- Around line 889-893: Update the credential lookup error branches throughout
the affected logic, including the handlers near the visible NVOS admin lookup
and the listed repeated branches, so they no longer classify every Err as a
missing Vault entry. Preserve and log the underlying error with error = %e while
using a generic failed-to-load-credentials message, or match MissingCredentials
explicitly and retain the setup message only for that case.

In `@crates/site-explorer/src/lib.rs`:
- Line 2631: Update the log message near the site-explorer host activation flow
to replace the malformed contraction “isnt” with “isn't”, preserving the rest of
the message unchanged.

In `@crates/ssh-console/src/bmc/connection.rs`:
- Around line 122-125: Update the tracing::info! call in the BMC connection
override flow to stop logging the full connection_details value. Log only safe
diagnostic fields, or explicitly redact ssh_key_path while preserving
machine_or_instance_id and other necessary context.

---

Outside diff comments:
In `@crates/ib-fabric/src/lib.rs`:
- Around line 387-438: Replace the raw `&'static str` failure-stage parameter
used by `note_fabric_error` with an internal enum covering `build_client`,
`health_check`, `load_ports`, and `load_partitions`; implement `Display` for
that enum, pass the corresponding variants at every visible call site, and
format the stage with `%failure_stage` in logging.

In `@crates/nvlink-manager/src/lib.rs`:
- Around line 2381-2397: The NMX-C partition creation flow must not commit
success when the partition ID is missing or cannot fit the database type. Update
the handling around matching_partition.partition_id and the i32::try_from
conversion to use a compatible wider stored ID or fail the operation through the
existing recovery/error path, ensuring no successful transaction commits without
persisting the created partition.

---

Nitpick comments:
In `@crates/agent/src/machine_inventory_updater.rs`:
- Around line 107-108: Update the error field in the
update_agent_reported_inventory error log to pass the captured error directly
through tracing’s formatter, using error = %e or error = ?e as appropriate,
instead of pre-formatting it with format!("{e:#}").

In `@crates/agent/src/tests/full.rs`:
- Line 339: Update the tracing::error! call in the DPU agent startup failure
path to pass the captured error e directly as a structured field, using
tracing’s ? or % formatting syntax instead of format!("{e:#}"). Preserve the
existing "Failed to start DPU agent" message.

In `@crates/agent/src/upgrade.rs`:
- Around line 72-75: Update the error fields in the upgrade error logs,
including the branches around the shown log and line 146, to record the error
directly with structured tracing syntax instead of eagerly calling format!. Use
debug capture for chained report context (or display capture where explicitly
intended), preserving the existing messages and control flow.

In `@crates/api-core/src/handlers/astra.rs`:
- Around line 332-335: Standardize tracing field formatting by using Display
syntax for the String-valued fields: update mac_address in
crates/api-core/src/handlers/astra.rs (lines 332-335), device_action.pci_name in
crates/scout/src/main.rs (lines 532-535), and dev_pci_name in
crates/scout/src/main.rs (lines 565-568, 588-591, and 665-668) from Debug
formatting to Display formatting; leave other fields unchanged.

In `@crates/api-core/src/handlers/extension_service.rs`:
- Around line 143-146: Standardize credential cleanup failure logging on the
existing delete_error field name. Update the affected tracing::warn! calls in
the create, update, and delete paths, including the referenced locations, so
each uses delete_error for the deletion error value while preserving the
existing messages and behavior.

In `@crates/api-core/src/handlers/svpc.rs`:
- Around line 424-428: Update the tracing::error! call in the DPA device handler
to format the CarbideError field with Display syntax, changing the error field
from debug formatting to %e while preserving the existing device_info field and
message.

In `@crates/api-core/src/machine_update_manager/host_firmware.rs`:
- Around line 76-79: Update the affected tracing fields to use native same-name
shorthand: in crates/api-core/src/machine_update_manager/host_firmware.rs lines
76-79 for fw_config_snapshot and lines 189-192 for firmware_config;
crates/api-core/src/tests/dpu_reprovisioning.rs lines 1359-1362 for
last_reboot_requested; crates/dpu-remediation/src/remediation.rs lines 231-234
for error; and crates/machine-a-tron/src/host_machine.rs lines 407-410 for
request, 429-430 for dpu_index, and 671-674 for machine_id. Preserve the
existing tracing levels and messages while using the appropriate debug or
display shorthand.

In `@crates/api-core/src/scout_stream.rs`:
- Around line 103-106: Replace redundant same-name tracing field assignments
with native shorthand while preserving each field’s existing `%` or `?`
formatter: update machine_id, flow_uuid, response, and flow_uuid_pb in
crates/api-core/src/scout_stream.rs at 103-106, 120-125, 128-133, 140-143,
150-153, 156-158, 218-220, 270-274, and 278-282; stable_machine_id in
crates/api-core/src/handlers/machine_discovery.rs at 421-421; desired_firmware
in crates/api-test-helper/src/machine_a_tron.rs at 78-78; bmc_ip in
crates/api-core/src/handlers/site_explorer.rs at 261-261; and key,
firmware_directory, and metadata_path in crates/firmware/src/config.rs at 69-69,
186-186, and 207-207.

In `@crates/api-db/src/machine_interface.rs`:
- Around line 610-614: Update the info log in the machine lookup flow, and the
corresponding log at the other relay-reporting site, to record the original
relays collection with structured debug formatting (`relays = ?relays`) instead
of the preformatted relaystr string. Retain relaystr only for warning logs that
explicitly require the formatted representation.

In `@crates/dhcp-server/src/main.rs`:
- Around line 118-122: Update the DHCP server listening log’s listen_address
field in the tracing::info! call to use Display formatting with %listen_address
instead of Debug formatting with ?listen_address, matching the existing
formatting used for the same field elsewhere.

In `@crates/machine-controller/src/handler.rs`:
- Line 4101: Update the rshim enablement error-handling chain around the tracing
call to avoid discarding the Result with let _. Use .ok() to explicitly mark the
non-blocking failure as intentionally ignored, while preserving the existing
info-level error logging.

In `@crates/mqttea/src/client/core.rs`:
- Around line 180-183: Update the error fields in the re-subscription and
related error logs to use tracing’s Display formatter (`%`) instead of Debug
formatter (`?`) for the error values `e` and `cred_err`. Apply this consistently
to the occurrences around the fresh-session handling and the additional
locations identified in the comment.

In `@crates/preingestion-manager/src/lib.rs`:
- Around line 3244-3247: Update the enable_rshim_bmc call to handle its
non-fatal failure explicitly: retain the existing error logging while converting
the intentionally ignored result with .ok() instead of using map_err followed by
let _. Locate this change in the RSHIM enablement flow around
redfish_client.enable_rshim_bmc().await.
🪄 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: 154c8f77-5413-4f5a-a6e7-f698f4a3ea25

📥 Commits

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

📒 Files selected for processing (271)
  • STYLE_GUIDE.md
  • crates/admin-cli/src/machine/show/cmd.rs
  • crates/admin-cli/src/rpc.rs
  • crates/agent/src/agent_platform.rs
  • crates/agent/src/astra_weave.rs
  • crates/agent/src/containerd/container.rs
  • crates/agent/src/containerd/image.rs
  • crates/agent/src/dhcp_server_grpc_client.rs
  • crates/agent/src/dpu/interface.rs
  • crates/agent/src/dpu/link.rs
  • crates/agent/src/dpu/route.rs
  • crates/agent/src/ethernet_virtualization.rs
  • crates/agent/src/extension_services/dpu_extension_service_observability.rs
  • crates/agent/src/extension_services/k8s_pod_handler.rs
  • crates/agent/src/hbn.rs
  • crates/agent/src/health.rs
  • crates/agent/src/health/bgp.rs
  • crates/agent/src/host_machine_id.rs
  • crates/agent/src/instance_metadata_endpoint.rs
  • crates/agent/src/instrumentation.rs
  • crates/agent/src/lib.rs
  • crates/agent/src/machine_inventory_updater.rs
  • crates/agent/src/main_loop.rs
  • crates/agent/src/managed_files.rs
  • crates/agent/src/mtu.rs
  • crates/agent/src/netlink.rs
  • crates/agent/src/network_monitor.rs
  • crates/agent/src/nvue.rs
  • crates/agent/src/ovs.rs
  • crates/agent/src/periodic_config_fetcher.rs
  • crates/agent/src/tests/common/mod.rs
  • crates/agent/src/tests/full.rs
  • crates/agent/src/tests/test_network_monitor.rs
  • crates/agent/src/traffic_intercept_bridging.rs
  • crates/agent/src/upgrade.rs
  • crates/api-core/src/attestation/measured_boot.rs
  • crates/api-core/src/attestation/tpm_ca_cert.rs
  • crates/api-core/src/db_init.rs
  • crates/api-core/src/dhcp/discover.rs
  • crates/api-core/src/dpa/handler.rs
  • crates/api-core/src/dynamic_settings.rs
  • crates/api-core/src/handlers/api.rs
  • crates/api-core/src/handlers/astra.rs
  • crates/api-core/src/handlers/attestation.rs
  • crates/api-core/src/handlers/bmc_endpoint_explorer.rs
  • crates/api-core/src/handlers/component_manager.rs
  • crates/api-core/src/handlers/dns.rs
  • crates/api-core/src/handlers/dpu_remediation.rs
  • crates/api-core/src/handlers/expected_machine.rs
  • crates/api-core/src/handlers/extension_service.rs
  • crates/api-core/src/handlers/finder.rs
  • crates/api-core/src/handlers/firmware.rs
  • crates/api-core/src/handlers/instance.rs
  • crates/api-core/src/handlers/instance_type.rs
  • crates/api-core/src/handlers/machine.rs
  • crates/api-core/src/handlers/machine_discovery.rs
  • crates/api-core/src/handlers/machine_scout.rs
  • crates/api-core/src/handlers/machine_validation.rs
  • crates/api-core/src/handlers/rack.rs
  • crates/api-core/src/handlers/redfish.rs
  • crates/api-core/src/handlers/scout_stream.rs
  • crates/api-core/src/handlers/site_explorer.rs
  • crates/api-core/src/handlers/svpc.rs
  • crates/api-core/src/handlers/uefi.rs
  • crates/api-core/src/instance/mod.rs
  • crates/api-core/src/ipxe.rs
  • crates/api-core/src/listener.rs
  • crates/api-core/src/logging/setup.rs
  • crates/api-core/src/machine_update_manager/dpu_nic_firmware.rs
  • crates/api-core/src/machine_update_manager/host_firmware.rs
  • crates/api-core/src/machine_update_manager/mod.rs
  • crates/api-core/src/machine_validation/mod.rs
  • crates/api-core/src/measured_boot/metrics_collector/mod.rs
  • crates/api-core/src/mqtt_state_change_hook/hook.rs
  • crates/api-core/src/run.rs
  • crates/api-core/src/scout_stream.rs
  • crates/api-core/src/setup.rs
  • crates/api-core/src/tests/common/api_fixtures/dpu.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/common/api_fixtures/test_machine/mod.rs
  • crates/api-core/src/tests/dns.rs
  • crates/api-core/src/tests/dpu_reprovisioning.rs
  • crates/api-core/src/tests/instance.rs
  • crates/api-core/src/tests/machine_network.rs
  • crates/api-core/src/tests/sku.rs
  • crates/api-core/tests/integration/machine_bmc_metadata.rs
  • crates/api-db/src/bmc_metadata.rs
  • crates/api-db/src/carbide_version.rs
  • crates/api-db/src/dns/resource_record.rs
  • crates/api-db/src/expected_power_shelf.rs
  • crates/api-db/src/expected_switch.rs
  • crates/api-db/src/instance.rs
  • crates/api-db/src/lib.rs
  • crates/api-db/src/machine.rs
  • crates/api-db/src/machine_interface.rs
  • crates/api-db/src/machine_topology.rs
  • crates/api-db/src/measured_boot/bundle.rs
  • crates/api-db/src/vpc_dpu_loopback.rs
  • crates/api-db/src/work_lock_manager.rs
  • crates/api-integration-tests/tests/lib.rs
  • crates/api-model/src/dpa_interface/mod.rs
  • crates/api-model/src/firmware.rs
  • crates/api-model/src/instance/status/network.rs
  • crates/api-model/src/instance/status/nvlink.rs
  • crates/api-model/src/instance/status/spx.rs
  • crates/api-model/src/machine/mod.rs
  • crates/api-model/src/machine/nvlink.rs
  • crates/api-model/src/machine/spx.rs
  • crates/api-model/src/site_explorer/mod.rs
  • crates/api-test-helper/src/domain.rs
  • crates/api-test-helper/src/instance.rs
  • crates/api-test-helper/src/machine.rs
  • crates/api-test-helper/src/machine_a_tron.rs
  • crates/api-test-helper/src/subnet.rs
  • crates/api-test-helper/src/tenant.rs
  • crates/api-test-helper/src/vpc.rs
  • crates/api-test-helper/src/vpc_prefix.rs
  • crates/api-web/src/auth.rs
  • crates/api-web/src/interface.rs
  • crates/api-web/src/lib.rs
  • crates/api-web/src/machine.rs
  • crates/api-web/src/managed_host.rs
  • crates/api-web/src/search.rs
  • crates/bmc-explorer/src/chassis.rs
  • crates/bmc-explorer/src/computer_system.rs
  • crates/bmc-explorer/src/manager.rs
  • crates/bmc-mock/src/combined_server.rs
  • crates/bmc-mock/src/combined_service.rs
  • crates/bmc-mock/src/main.rs
  • crates/bmc-mock/src/redfish/expander_router.rs
  • crates/bmc-mock/src/tar_router.rs
  • crates/bmc-mock/src/tls.rs
  • crates/bmc-proxy/src/bmc_proxy.rs
  • crates/bmc-proxy/src/setup.rs
  • crates/dhcp-server/src/cache.rs
  • crates/dhcp-server/src/grpc_server.rs
  • crates/dhcp-server/src/main.rs
  • crates/dhcp-server/src/modes/controller.rs
  • crates/dhcp-server/src/packet_handler.rs
  • crates/dhcp-server/src/util.rs
  • crates/dns-record/src/lib.rs
  • crates/dns/src/lib.rs
  • crates/dns/src/main.rs
  • crates/dpa-manager/src/card_handler/astra.rs
  • crates/dpa-manager/src/card_handler/svpc.rs
  • crates/dpa-manager/src/lib.rs
  • crates/dpa/src/lib.rs
  • crates/dpf/src/sdk.rs
  • crates/dpu-otel-agent/src/lib.rs
  • crates/dpu-remediation/src/remediation.rs
  • crates/dsx-exchange-consumer/src/api_client.rs
  • crates/firmware/src/config.rs
  • crates/firmware/src/downloader.rs
  • crates/fmds/src/http_request_metrics.rs
  • crates/fmds/src/main.rs
  • crates/fmds/src/nic_init.rs
  • crates/fmds/src/phone_home.rs
  • crates/health/src/api_client.rs
  • crates/health/src/collectors/logs/periodic.rs
  • crates/health/src/discovery/cleanup.rs
  • crates/health/src/discovery/context.rs
  • crates/health/src/discovery/spawn.rs
  • crates/health/src/metrics.rs
  • crates/host-support/src/hardware_enumeration.rs
  • crates/host-support/src/hardware_enumeration/dpu.rs
  • crates/host-support/src/hardware_enumeration/gpu.rs
  • crates/host-support/src/hardware_enumeration/tpm.rs
  • crates/host-support/src/registration.rs
  • crates/http-connector/src/connector.rs
  • crates/http-connector/src/resolver.rs
  • crates/ib-fabric/src/lib.rs
  • crates/ib-partition-controller/src/handler.rs
  • crates/ipmi/src/tool.rs
  • crates/kms-provider/src/providers/transit.rs
  • crates/libmlx/src/device/discovery.rs
  • crates/libnmxc/src/lib.rs
  • crates/libnmxm/src/lib.rs
  • crates/machine-a-tron/src/api_client.rs
  • crates/machine-a-tron/src/api_throttler.rs
  • crates/machine-a-tron/src/bmc_mock_wrapper.rs
  • crates/machine-a-tron/src/dhcp_wrapper.rs
  • crates/machine-a-tron/src/host_machine.rs
  • crates/machine-a-tron/src/machine_a_tron.rs
  • crates/machine-a-tron/src/machine_state_machine.rs
  • crates/machine-a-tron/src/machine_utils.rs
  • crates/machine-a-tron/src/main.rs
  • crates/machine-a-tron/src/mock_ssh_server.rs
  • crates/machine-a-tron/src/subnet.rs
  • crates/machine-a-tron/src/tui.rs
  • crates/machine-a-tron/src/vpc.rs
  • crates/machine-controller/src/dpf.rs
  • crates/machine-controller/src/handler.rs
  • crates/machine-controller/src/handler/attestation.rs
  • crates/machine-controller/src/handler/bios_config.rs
  • crates/machine-controller/src/handler/dpf.rs
  • crates/machine-controller/src/handler/machine_validation.rs
  • crates/machine-controller/src/handler/power.rs
  • crates/machine-controller/src/handler/sku.rs
  • crates/machine-validation/src/machine_validation.rs
  • crates/metrics-endpoint/src/lib.rs
  • crates/metrics-utils/src/lib.rs
  • crates/mqttea-example/src/main.rs
  • crates/mqttea/src/client/core.rs
  • crates/mqttea/src/client/messages.rs
  • crates/mqttea/src/registry/core.rs
  • crates/nvlink-manager/src/lib.rs
  • crates/nvlink-manager/src/switch_cert_monitor.rs
  • crates/power-shelf-controller/src/configuring.rs
  • crates/power-shelf-controller/src/deleting.rs
  • crates/power-shelf-controller/src/fetching_data.rs
  • crates/power-shelf-controller/src/initializing.rs
  • crates/preingestion-manager/src/bfb_rshim_copier.rs
  • crates/preingestion-manager/src/lib.rs
  • crates/preingestion-manager/tests/integration/host_bmc_firmware.rs
  • crates/rack-controller/src/created.rs
  • crates/rack-controller/src/discovering.rs
  • crates/rack-controller/src/error_state.rs
  • crates/rack-controller/src/handler.rs
  • crates/rack-controller/src/lib.rs
  • crates/rack-controller/src/maintenance.rs
  • crates/rack-controller/src/ready.rs
  • crates/rack-controller/src/validating.rs
  • crates/rpc-utils/src/managed_host_display.rs
  • crates/rpc/src/errors.rs
  • crates/rpc/src/forge_tls_client.rs
  • crates/rpc/src/model/dpu_remediation.rs
  • crates/scout/src/attestation.rs
  • crates/scout/src/deprovision/scrabbing.rs
  • crates/scout/src/firmware_upgrade.rs
  • crates/scout/src/main.rs
  • crates/scout/src/mlx_device.rs
  • crates/scout/src/register.rs
  • crates/scout/src/stream.rs
  • crates/scout/src/tpm.rs
  • crates/secrets/src/forge_vault.rs
  • crates/secrets/src/local_credentials/file.rs
  • crates/site-explorer/src/bmc_endpoint_explorer.rs
  • crates/site-explorer/src/explored_endpoint_index.rs
  • crates/site-explorer/src/lib.rs
  • crates/site-explorer/src/machine_creator.rs
  • crates/site-explorer/src/redfish.rs
  • crates/site-explorer/src/switch_creator.rs
  • crates/site-explorer/src/test_support/mock_endpoint_explorer.rs
  • crates/site-explorer/tests/integration/power_shelf.rs
  • crates/site-explorer/tests/integration/site_explorer.rs
  • crates/site-explorer/tests/integration/switch.rs
  • crates/spdm-controller/src/handler.rs
  • crates/ssh-console-mock-api-server/src/lib.rs
  • crates/ssh-console/src/bmc/client.rs
  • crates/ssh-console/src/bmc/connection.rs
  • crates/ssh-console/src/bmc/connection_impl/ipmi.rs
  • crates/ssh-console/src/bmc/connection_impl/ssh.rs
  • crates/ssh-console/src/bmc/message_proxy.rs
  • crates/ssh-console/src/config.rs
  • crates/ssh-console/src/console_logger.rs
  • crates/ssh-console/src/frontend.rs
  • crates/ssh-console/src/metrics.rs
  • crates/ssh-console/src/ssh_cert_parsing.rs
  • crates/ssh-console/src/ssh_server.rs
  • crates/ssh-console/tests/util/ipmi_sim.rs
  • crates/ssh-console/tests/util/mod.rs
  • crates/state-controller/src/controller/processor.rs
  • crates/switch-controller/src/certificate.rs
  • crates/switch-controller/src/configuring.rs
  • crates/switch-controller/src/created.rs
  • crates/switch-controller/src/deleting.rs
  • crates/switch-controller/src/error_state.rs
  • crates/switch-controller/src/initializing.rs
  • crates/switch-controller/src/ready.rs
  • crates/switch-controller/src/validating.rs
💤 Files with no reviewable changes (1)
  • crates/health/src/discovery/context.rs

Comment thread crates/admin-cli/src/rpc.rs
Comment thread crates/agent/src/nvue.rs Outdated
Comment thread crates/api-core/src/handlers/bmc_endpoint_explorer.rs
Comment thread crates/api-core/src/handlers/svpc.rs Outdated
Comment thread crates/api-core/src/machine_validation/mod.rs
Comment thread crates/preingestion-manager/src/lib.rs
Comment thread crates/scout/src/attestation.rs Outdated
Comment thread crates/site-explorer/src/bmc_endpoint_explorer.rs Outdated
Comment thread crates/site-explorer/src/lib.rs Outdated
Comment thread crates/ssh-console/src/bmc/connection.rs
@chet

chet commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the actionable structured-logging, accuracy, and sensitive-field findings in amended commit 1a82cf6. Reverification is green for nightly formatting, all-target/all-feature Clippy, custom lints, and the expanded 16-library unit-test set.

Two review-body concerns were verified against origin/main and intentionally kept out of this refactor:

  • Work-lock keepalive supervision predates this change and needs an async close/release or manager-owned task-supervision design.
  • NMX-C partition persistence recovery also predates this change and needs explicit recovery semantics for an already-created external partition.

The HBN child-process stderr remains a rendered payload under the STYLE_GUIDE.md exception for child-process streams, matching the cloud review request to preserve operator-visible presentation.

@coderabbitai full_review, thanks!

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

@chet, thanks for the update. Acknowledged:

  • Actionable structured-logging, accuracy, and sensitive-field findings addressed in commit 1a82cf674, with green nightly formatting, all-target/all-feature Clippy, custom lints, and the expanded 16-library unit-test set.
  • Work-lock keepalive supervision and NMX-C partition persistence recovery are confirmed pre-existing issues on origin/main, correctly kept out of scope for this refactor.
  • HBN child-process stderr logging is confirmed intentional under the STYLE_GUIDE.md child-process-stream exception, preserving operator-visible presentation.

I'll kick off a full review of all changes now to verify the amended commit.

(=^・ω・^=)


✏️ Learnings added
Learnt from: chet
URL: https://github.com/NVIDIA/infra-controller/pull/3479

Timestamp: 2026-07-14T09:27:43.782Z
Learning: In the NVIDIA/infra-controller repository, as of PR `#3479` (structured-logging refactor), two known pre-existing issues were identified but intentionally deferred as out of scope: (1) work-lock keepalive supervision (crates/api-db/src/work_lock_manager.rs) needs an async close/release or manager-owned task-supervision design; (2) NMX-C partition persistence recovery (crates/nvlink-manager) needs explicit recovery semantics for an already-created external partition. These predate the structured-logging refactor and should not be flagged as newly introduced by it.

Learnt from: chet
URL: https://github.com/NVIDIA/infra-controller/pull/3479

Timestamp: 2026-07-14T09:27:43.782Z
Learning: In the NVIDIA/infra-controller repository, HBN child-process stderr logging (e.g., crates/agent/src/hbn.rs) is intentionally treated as a rendered payload under the STYLE_GUIDE.md exception for child-process streams, so it should not be flagged for conversion to structured logging fields.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

✅ 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 (2)
crates/rack-controller/src/created.rs (1)

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

Use native tracing field shorthand.

These fields should use compute_count, switch_count, and power_shelf_count directly rather than repeating the field names. As per coding guidelines, use native tracing field shorthand for tracing values.

Proposed fix
-        compute_count = compute_count,
-        switch_count = switch_count,
-        power_shelf_count = power_shelf_count,
+        compute_count,
+        switch_count,
+        power_shelf_count,
🤖 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/rack-controller/src/created.rs` around lines 95 - 100, Update the
tracing::info! invocation to use native field shorthand for compute_count,
switch_count, and power_shelf_count, removing the repeated field-name
assignments while preserving the existing rack_id field and message.

Source: Coding guidelines

crates/bmc-mock/src/combined_service.rs (1)

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

Use native tracing field shorthand.

These fields can be written as ?forwarded_host, ?host, and ?authority. As per coding guidelines, use native tracing field shorthand for Debug values.

Proposed fix
     tracing::info!(
-        forwarded_host = ?forwarded_host,
-        host = ?host,
-        authority = ?authority,
+        ?forwarded_host,
+        ?host,
+        ?authority,
         "No BMC mock router is configured for request",
     );
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/bmc-mock/src/combined_service.rs` around lines 114 - 118, Update the
tracing::info! call in the combined service request-handling flow to use native
shorthand for the Debug fields: forwarded_host, host, and authority. Preserve
the existing field names, formatting behavior, and log message.

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/agent/src/mtu.rs`:
- Around line 58-61: Preserve child-process stderr as rendered diagnostic
message text rather than moving it solely into structured fields. Update the MTU
query site at crates/agent/src/mtu.rs lines 58-61, the MTU update site at
crates/agent/src/mtu.rs lines 78-81, and the ip command diagnostic at
crates/agent/src/ethernet_virtualization.rs lines 1753-1757; retain any
structured command metadata separately.

---

Nitpick comments:
In `@crates/bmc-mock/src/combined_service.rs`:
- Around line 114-118: Update the tracing::info! call in the combined service
request-handling flow to use native shorthand for the Debug fields:
forwarded_host, host, and authority. Preserve the existing field names,
formatting behavior, and log message.

In `@crates/rack-controller/src/created.rs`:
- Around line 95-100: Update the tracing::info! invocation to use native field
shorthand for compute_count, switch_count, and power_shelf_count, removing the
repeated field-name assignments while preserving the existing rack_id field and
message.
🪄 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: fa8faf74-bf3c-42c5-8f53-55920d33c13f

📥 Commits

Reviewing files that changed from the base of the PR and between a76aefe and 1a82cf6.

📒 Files selected for processing (271)
  • STYLE_GUIDE.md
  • crates/admin-cli/src/machine/show/cmd.rs
  • crates/admin-cli/src/rpc.rs
  • crates/agent/src/agent_platform.rs
  • crates/agent/src/astra_weave.rs
  • crates/agent/src/containerd/container.rs
  • crates/agent/src/containerd/image.rs
  • crates/agent/src/dhcp_server_grpc_client.rs
  • crates/agent/src/dpu/interface.rs
  • crates/agent/src/dpu/link.rs
  • crates/agent/src/dpu/route.rs
  • crates/agent/src/ethernet_virtualization.rs
  • crates/agent/src/extension_services/dpu_extension_service_observability.rs
  • crates/agent/src/extension_services/k8s_pod_handler.rs
  • crates/agent/src/hbn.rs
  • crates/agent/src/health.rs
  • crates/agent/src/health/bgp.rs
  • crates/agent/src/host_machine_id.rs
  • crates/agent/src/instance_metadata_endpoint.rs
  • crates/agent/src/instrumentation.rs
  • crates/agent/src/lib.rs
  • crates/agent/src/machine_inventory_updater.rs
  • crates/agent/src/main_loop.rs
  • crates/agent/src/managed_files.rs
  • crates/agent/src/mtu.rs
  • crates/agent/src/netlink.rs
  • crates/agent/src/network_monitor.rs
  • crates/agent/src/nvue.rs
  • crates/agent/src/ovs.rs
  • crates/agent/src/periodic_config_fetcher.rs
  • crates/agent/src/tests/common/mod.rs
  • crates/agent/src/tests/full.rs
  • crates/agent/src/tests/test_network_monitor.rs
  • crates/agent/src/traffic_intercept_bridging.rs
  • crates/agent/src/upgrade.rs
  • crates/api-core/src/attestation/measured_boot.rs
  • crates/api-core/src/attestation/tpm_ca_cert.rs
  • crates/api-core/src/db_init.rs
  • crates/api-core/src/dhcp/discover.rs
  • crates/api-core/src/dpa/handler.rs
  • crates/api-core/src/dynamic_settings.rs
  • crates/api-core/src/handlers/api.rs
  • crates/api-core/src/handlers/astra.rs
  • crates/api-core/src/handlers/attestation.rs
  • crates/api-core/src/handlers/bmc_endpoint_explorer.rs
  • crates/api-core/src/handlers/component_manager.rs
  • crates/api-core/src/handlers/dns.rs
  • crates/api-core/src/handlers/dpu_remediation.rs
  • crates/api-core/src/handlers/expected_machine.rs
  • crates/api-core/src/handlers/extension_service.rs
  • crates/api-core/src/handlers/finder.rs
  • crates/api-core/src/handlers/firmware.rs
  • crates/api-core/src/handlers/instance.rs
  • crates/api-core/src/handlers/instance_type.rs
  • crates/api-core/src/handlers/machine.rs
  • crates/api-core/src/handlers/machine_discovery.rs
  • crates/api-core/src/handlers/machine_scout.rs
  • crates/api-core/src/handlers/machine_validation.rs
  • crates/api-core/src/handlers/rack.rs
  • crates/api-core/src/handlers/redfish.rs
  • crates/api-core/src/handlers/scout_stream.rs
  • crates/api-core/src/handlers/site_explorer.rs
  • crates/api-core/src/handlers/svpc.rs
  • crates/api-core/src/handlers/uefi.rs
  • crates/api-core/src/instance/mod.rs
  • crates/api-core/src/ipxe.rs
  • crates/api-core/src/listener.rs
  • crates/api-core/src/logging/setup.rs
  • crates/api-core/src/machine_update_manager/dpu_nic_firmware.rs
  • crates/api-core/src/machine_update_manager/host_firmware.rs
  • crates/api-core/src/machine_update_manager/mod.rs
  • crates/api-core/src/machine_validation/mod.rs
  • crates/api-core/src/measured_boot/metrics_collector/mod.rs
  • crates/api-core/src/mqtt_state_change_hook/hook.rs
  • crates/api-core/src/run.rs
  • crates/api-core/src/scout_stream.rs
  • crates/api-core/src/setup.rs
  • crates/api-core/src/tests/common/api_fixtures/dpu.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/common/api_fixtures/test_machine/mod.rs
  • crates/api-core/src/tests/dns.rs
  • crates/api-core/src/tests/dpu_reprovisioning.rs
  • crates/api-core/src/tests/instance.rs
  • crates/api-core/src/tests/machine_network.rs
  • crates/api-core/src/tests/sku.rs
  • crates/api-core/tests/integration/machine_bmc_metadata.rs
  • crates/api-db/src/bmc_metadata.rs
  • crates/api-db/src/carbide_version.rs
  • crates/api-db/src/dns/resource_record.rs
  • crates/api-db/src/expected_power_shelf.rs
  • crates/api-db/src/expected_switch.rs
  • crates/api-db/src/instance.rs
  • crates/api-db/src/lib.rs
  • crates/api-db/src/machine.rs
  • crates/api-db/src/machine_interface.rs
  • crates/api-db/src/machine_topology.rs
  • crates/api-db/src/measured_boot/bundle.rs
  • crates/api-db/src/vpc_dpu_loopback.rs
  • crates/api-db/src/work_lock_manager.rs
  • crates/api-integration-tests/tests/lib.rs
  • crates/api-model/src/dpa_interface/mod.rs
  • crates/api-model/src/firmware.rs
  • crates/api-model/src/instance/status/network.rs
  • crates/api-model/src/instance/status/nvlink.rs
  • crates/api-model/src/instance/status/spx.rs
  • crates/api-model/src/machine/mod.rs
  • crates/api-model/src/machine/nvlink.rs
  • crates/api-model/src/machine/spx.rs
  • crates/api-model/src/site_explorer/mod.rs
  • crates/api-test-helper/src/domain.rs
  • crates/api-test-helper/src/instance.rs
  • crates/api-test-helper/src/machine.rs
  • crates/api-test-helper/src/machine_a_tron.rs
  • crates/api-test-helper/src/subnet.rs
  • crates/api-test-helper/src/tenant.rs
  • crates/api-test-helper/src/vpc.rs
  • crates/api-test-helper/src/vpc_prefix.rs
  • crates/api-web/src/auth.rs
  • crates/api-web/src/interface.rs
  • crates/api-web/src/lib.rs
  • crates/api-web/src/machine.rs
  • crates/api-web/src/managed_host.rs
  • crates/api-web/src/search.rs
  • crates/bmc-explorer/src/chassis.rs
  • crates/bmc-explorer/src/computer_system.rs
  • crates/bmc-explorer/src/manager.rs
  • crates/bmc-mock/src/combined_server.rs
  • crates/bmc-mock/src/combined_service.rs
  • crates/bmc-mock/src/main.rs
  • crates/bmc-mock/src/redfish/expander_router.rs
  • crates/bmc-mock/src/tar_router.rs
  • crates/bmc-mock/src/tls.rs
  • crates/bmc-proxy/src/bmc_proxy.rs
  • crates/bmc-proxy/src/setup.rs
  • crates/dhcp-server/src/cache.rs
  • crates/dhcp-server/src/grpc_server.rs
  • crates/dhcp-server/src/main.rs
  • crates/dhcp-server/src/modes/controller.rs
  • crates/dhcp-server/src/packet_handler.rs
  • crates/dhcp-server/src/util.rs
  • crates/dns-record/src/lib.rs
  • crates/dns/src/lib.rs
  • crates/dns/src/main.rs
  • crates/dpa-manager/src/card_handler/astra.rs
  • crates/dpa-manager/src/card_handler/svpc.rs
  • crates/dpa-manager/src/lib.rs
  • crates/dpa/src/lib.rs
  • crates/dpf/src/sdk.rs
  • crates/dpu-otel-agent/src/lib.rs
  • crates/dpu-remediation/src/remediation.rs
  • crates/dsx-exchange-consumer/src/api_client.rs
  • crates/firmware/src/config.rs
  • crates/firmware/src/downloader.rs
  • crates/fmds/src/http_request_metrics.rs
  • crates/fmds/src/main.rs
  • crates/fmds/src/nic_init.rs
  • crates/fmds/src/phone_home.rs
  • crates/health/src/api_client.rs
  • crates/health/src/collectors/logs/periodic.rs
  • crates/health/src/discovery/cleanup.rs
  • crates/health/src/discovery/context.rs
  • crates/health/src/discovery/spawn.rs
  • crates/health/src/metrics.rs
  • crates/host-support/src/hardware_enumeration.rs
  • crates/host-support/src/hardware_enumeration/dpu.rs
  • crates/host-support/src/hardware_enumeration/gpu.rs
  • crates/host-support/src/hardware_enumeration/tpm.rs
  • crates/host-support/src/registration.rs
  • crates/http-connector/src/connector.rs
  • crates/http-connector/src/resolver.rs
  • crates/ib-fabric/src/lib.rs
  • crates/ib-partition-controller/src/handler.rs
  • crates/ipmi/src/tool.rs
  • crates/kms-provider/src/providers/transit.rs
  • crates/libmlx/src/device/discovery.rs
  • crates/libnmxc/src/lib.rs
  • crates/libnmxm/src/lib.rs
  • crates/machine-a-tron/src/api_client.rs
  • crates/machine-a-tron/src/api_throttler.rs
  • crates/machine-a-tron/src/bmc_mock_wrapper.rs
  • crates/machine-a-tron/src/dhcp_wrapper.rs
  • crates/machine-a-tron/src/host_machine.rs
  • crates/machine-a-tron/src/machine_a_tron.rs
  • crates/machine-a-tron/src/machine_state_machine.rs
  • crates/machine-a-tron/src/machine_utils.rs
  • crates/machine-a-tron/src/main.rs
  • crates/machine-a-tron/src/mock_ssh_server.rs
  • crates/machine-a-tron/src/subnet.rs
  • crates/machine-a-tron/src/tui.rs
  • crates/machine-a-tron/src/vpc.rs
  • crates/machine-controller/src/dpf.rs
  • crates/machine-controller/src/handler.rs
  • crates/machine-controller/src/handler/attestation.rs
  • crates/machine-controller/src/handler/bios_config.rs
  • crates/machine-controller/src/handler/dpf.rs
  • crates/machine-controller/src/handler/machine_validation.rs
  • crates/machine-controller/src/handler/power.rs
  • crates/machine-controller/src/handler/sku.rs
  • crates/machine-validation/src/machine_validation.rs
  • crates/metrics-endpoint/src/lib.rs
  • crates/metrics-utils/src/lib.rs
  • crates/mqttea-example/src/main.rs
  • crates/mqttea/src/client/core.rs
  • crates/mqttea/src/client/messages.rs
  • crates/mqttea/src/registry/core.rs
  • crates/nvlink-manager/src/lib.rs
  • crates/nvlink-manager/src/switch_cert_monitor.rs
  • crates/power-shelf-controller/src/configuring.rs
  • crates/power-shelf-controller/src/deleting.rs
  • crates/power-shelf-controller/src/fetching_data.rs
  • crates/power-shelf-controller/src/initializing.rs
  • crates/preingestion-manager/src/bfb_rshim_copier.rs
  • crates/preingestion-manager/src/lib.rs
  • crates/preingestion-manager/tests/integration/host_bmc_firmware.rs
  • crates/rack-controller/src/created.rs
  • crates/rack-controller/src/discovering.rs
  • crates/rack-controller/src/error_state.rs
  • crates/rack-controller/src/handler.rs
  • crates/rack-controller/src/lib.rs
  • crates/rack-controller/src/maintenance.rs
  • crates/rack-controller/src/ready.rs
  • crates/rack-controller/src/validating.rs
  • crates/rpc-utils/src/managed_host_display.rs
  • crates/rpc/src/errors.rs
  • crates/rpc/src/forge_tls_client.rs
  • crates/rpc/src/model/dpu_remediation.rs
  • crates/scout/src/attestation.rs
  • crates/scout/src/deprovision/scrabbing.rs
  • crates/scout/src/firmware_upgrade.rs
  • crates/scout/src/main.rs
  • crates/scout/src/mlx_device.rs
  • crates/scout/src/register.rs
  • crates/scout/src/stream.rs
  • crates/scout/src/tpm.rs
  • crates/secrets/src/forge_vault.rs
  • crates/secrets/src/local_credentials/file.rs
  • crates/site-explorer/src/bmc_endpoint_explorer.rs
  • crates/site-explorer/src/explored_endpoint_index.rs
  • crates/site-explorer/src/lib.rs
  • crates/site-explorer/src/machine_creator.rs
  • crates/site-explorer/src/redfish.rs
  • crates/site-explorer/src/switch_creator.rs
  • crates/site-explorer/src/test_support/mock_endpoint_explorer.rs
  • crates/site-explorer/tests/integration/power_shelf.rs
  • crates/site-explorer/tests/integration/site_explorer.rs
  • crates/site-explorer/tests/integration/switch.rs
  • crates/spdm-controller/src/handler.rs
  • crates/ssh-console-mock-api-server/src/lib.rs
  • crates/ssh-console/src/bmc/client.rs
  • crates/ssh-console/src/bmc/connection.rs
  • crates/ssh-console/src/bmc/connection_impl/ipmi.rs
  • crates/ssh-console/src/bmc/connection_impl/ssh.rs
  • crates/ssh-console/src/bmc/message_proxy.rs
  • crates/ssh-console/src/config.rs
  • crates/ssh-console/src/console_logger.rs
  • crates/ssh-console/src/frontend.rs
  • crates/ssh-console/src/metrics.rs
  • crates/ssh-console/src/ssh_cert_parsing.rs
  • crates/ssh-console/src/ssh_server.rs
  • crates/ssh-console/tests/util/ipmi_sim.rs
  • crates/ssh-console/tests/util/mod.rs
  • crates/state-controller/src/controller/processor.rs
  • crates/switch-controller/src/certificate.rs
  • crates/switch-controller/src/configuring.rs
  • crates/switch-controller/src/created.rs
  • crates/switch-controller/src/deleting.rs
  • crates/switch-controller/src/error_state.rs
  • crates/switch-controller/src/initializing.rs
  • crates/switch-controller/src/ready.rs
  • crates/switch-controller/src/validating.rs
💤 Files with no reviewable changes (1)
  • crates/health/src/discovery/context.rs
🚧 Files skipped from review as they are similar to previous changes (247)
  • crates/api-test-helper/src/machine_a_tron.rs
  • crates/ssh-console/src/ssh_server.rs
  • crates/api-test-helper/src/vpc_prefix.rs
  • crates/api-model/src/instance/status/nvlink.rs
  • crates/api-model/src/instance/status/spx.rs
  • crates/api-db/src/dns/resource_record.rs
  • crates/api-core/src/tests/machine_network.rs
  • crates/metrics-utils/src/lib.rs
  • crates/preingestion-manager/tests/integration/host_bmc_firmware.rs
  • crates/fmds/src/phone_home.rs
  • crates/agent/src/host_machine_id.rs
  • crates/switch-controller/src/created.rs
  • crates/dpu-otel-agent/src/lib.rs
  • crates/site-explorer/src/test_support/mock_endpoint_explorer.rs
  • crates/api-db/src/vpc_dpu_loopback.rs
  • crates/api-core/src/dynamic_settings.rs
  • crates/agent/src/netlink.rs
  • crates/api-model/src/machine/nvlink.rs
  • crates/dhcp-server/src/grpc_server.rs
  • crates/api-model/src/machine/spx.rs
  • crates/bmc-mock/src/tar_router.rs
  • crates/ssh-console/src/bmc/connection_impl/ipmi.rs
  • crates/api-core/src/tests/common/api_fixtures/test_machine/mod.rs
  • crates/api-core/src/measured_boot/metrics_collector/mod.rs
  • crates/power-shelf-controller/src/initializing.rs
  • crates/agent/src/health/bgp.rs
  • crates/agent/src/tests/full.rs
  • crates/api-core/src/handlers/site_explorer.rs
  • crates/agent/src/tests/common/mod.rs
  • crates/api-core/src/handlers/machine_discovery.rs
  • crates/dpa/src/lib.rs
  • crates/machine-a-tron/src/api_throttler.rs
  • crates/dns/src/main.rs
  • crates/api-core/src/handlers/firmware.rs
  • crates/api-web/src/lib.rs
  • STYLE_GUIDE.md
  • crates/api-test-helper/src/tenant.rs
  • crates/dhcp-server/src/packet_handler.rs
  • crates/api-db/src/expected_power_shelf.rs
  • crates/api-test-helper/src/subnet.rs
  • crates/metrics-endpoint/src/lib.rs
  • crates/bmc-explorer/src/chassis.rs
  • crates/api-web/src/auth.rs
  • crates/switch-controller/src/error_state.rs
  • crates/libmlx/src/device/discovery.rs
  • crates/api-model/src/site_explorer/mod.rs
  • crates/ib-partition-controller/src/handler.rs
  • crates/ssh-console/src/bmc/message_proxy.rs
  • crates/dhcp-server/src/modes/controller.rs
  • crates/agent/src/dhcp_server_grpc_client.rs
  • crates/agent/src/tests/test_network_monitor.rs
  • crates/agent/src/lib.rs
  • crates/api-core/src/machine_update_manager/host_firmware.rs
  • crates/api-core/src/machine_update_manager/dpu_nic_firmware.rs
  • crates/mqttea/src/client/messages.rs
  • crates/rack-controller/src/discovering.rs
  • crates/switch-controller/src/certificate.rs
  • crates/agent/src/instance_metadata_endpoint.rs
  • crates/machine-controller/src/handler/power.rs
  • crates/scout/src/tpm.rs
  • crates/api-web/src/interface.rs
  • crates/dhcp-server/src/util.rs
  • crates/fmds/src/main.rs
  • crates/api-model/src/firmware.rs
  • crates/api-core/src/logging/setup.rs
  • crates/firmware/src/downloader.rs
  • crates/bmc-proxy/src/setup.rs
  • crates/api-core/src/tests/sku.rs
  • crates/api-core/src/handlers/scout_stream.rs
  • crates/machine-a-tron/src/dhcp_wrapper.rs
  • crates/api-test-helper/src/domain.rs
  • crates/bmc-mock/src/redfish/expander_router.rs
  • crates/ssh-console/tests/util/ipmi_sim.rs
  • crates/api-db/src/bmc_metadata.rs
  • crates/agent/src/extension_services/dpu_extension_service_observability.rs
  • crates/nvlink-manager/src/switch_cert_monitor.rs
  • crates/dhcp-server/src/cache.rs
  • crates/health/src/metrics.rs
  • crates/libnmxc/src/lib.rs
  • crates/api-core/src/handlers/uefi.rs
  • crates/api-web/src/search.rs
  • crates/rack-controller/src/lib.rs
  • crates/ssh-console/src/config.rs
  • crates/api-core/src/tests/common/api_fixtures/dpu.rs
  • crates/agent/src/periodic_config_fetcher.rs
  • crates/fmds/src/nic_init.rs
  • crates/api-core/src/handlers/dpu_remediation.rs
  • crates/api-core/src/handlers/instance_type.rs
  • crates/api-core/src/machine_update_manager/mod.rs
  • crates/api-core/src/tests/common/api_fixtures/site_explorer.rs
  • crates/site-explorer/tests/integration/switch.rs
  • crates/switch-controller/src/configuring.rs
  • crates/site-explorer/src/switch_creator.rs
  • crates/api-db/src/measured_boot/bundle.rs
  • crates/rack-controller/src/error_state.rs
  • crates/ssh-console/src/metrics.rs
  • crates/agent/src/machine_inventory_updater.rs
  • crates/api-core/src/handlers/component_manager.rs
  • crates/api-core/src/ipxe.rs
  • crates/api-core/src/handlers/expected_machine.rs
  • crates/agent/src/agent_platform.rs
  • crates/scout/src/firmware_upgrade.rs
  • crates/scout/src/register.rs
  • crates/ipmi/src/tool.rs
  • crates/api-core/src/handlers/finder.rs
  • crates/ssh-console/src/bmc/connection_impl/ssh.rs
  • crates/api-core/src/handlers/machine_scout.rs
  • crates/machine-a-tron/src/tui.rs
  • crates/health/src/api_client.rs
  • crates/api-core/src/dhcp/discover.rs
  • crates/firmware/src/config.rs
  • crates/api-db/src/machine_interface.rs
  • crates/api-core/src/attestation/measured_boot.rs
  • crates/machine-controller/src/dpf.rs
  • crates/ssh-console-mock-api-server/src/lib.rs
  • crates/api-web/src/machine.rs
  • crates/rpc/src/model/dpu_remediation.rs
  • crates/dns-record/src/lib.rs
  • crates/api-core/src/handlers/attestation.rs
  • crates/agent/src/dpu/link.rs
  • crates/switch-controller/src/initializing.rs
  • crates/site-explorer/tests/integration/site_explorer.rs
  • crates/api-core/src/handlers/redfish.rs
  • crates/ssh-console/src/bmc/connection.rs
  • crates/rpc/src/errors.rs
  • crates/machine-a-tron/src/api_client.rs
  • crates/api-core/src/listener.rs
  • crates/site-explorer/src/explored_endpoint_index.rs
  • crates/api-db/src/machine_topology.rs
  • crates/api-core/src/tests/common/api_fixtures/mod.rs
  • crates/api-db/src/expected_switch.rs
  • crates/bmc-mock/src/tls.rs
  • crates/site-explorer/src/redfish.rs
  • crates/mqttea/src/registry/core.rs
  • crates/agent/src/network_monitor.rs
  • crates/admin-cli/src/machine/show/cmd.rs
  • crates/machine-controller/src/handler/bios_config.rs
  • crates/rack-controller/src/handler.rs
  • crates/api-test-helper/src/vpc.rs
  • crates/api-core/src/attestation/tpm_ca_cert.rs
  • crates/http-connector/src/resolver.rs
  • crates/bmc-explorer/src/manager.rs
  • crates/site-explorer/src/machine_creator.rs
  • crates/machine-a-tron/src/main.rs
  • crates/ssh-console/src/bmc/client.rs
  • crates/api-core/src/handlers/extension_service.rs
  • crates/health/src/discovery/cleanup.rs
  • crates/scout/src/stream.rs
  • crates/machine-a-tron/src/bmc_mock_wrapper.rs
  • crates/machine-controller/src/handler/machine_validation.rs
  • crates/api-core/src/tests/instance.rs
  • crates/api-test-helper/src/instance.rs
  • crates/ssh-console/src/console_logger.rs
  • crates/state-controller/src/controller/processor.rs
  • crates/api-core/src/machine_validation/mod.rs
  • crates/rpc/src/forge_tls_client.rs
  • crates/api-model/src/machine/mod.rs
  • crates/dpa-manager/src/lib.rs
  • crates/bmc-mock/src/main.rs
  • crates/host-support/src/hardware_enumeration/tpm.rs
  • crates/api-core/src/handlers/dns.rs
  • crates/dns/src/lib.rs
  • crates/health/src/collectors/logs/periodic.rs
  • crates/mqttea-example/src/main.rs
  • crates/api-db/src/instance.rs
  • crates/api-core/src/mqtt_state_change_hook/hook.rs
  • crates/dsx-exchange-consumer/src/api_client.rs
  • crates/agent/src/ovs.rs
  • crates/dpu-remediation/src/remediation.rs
  • crates/agent/src/astra_weave.rs
  • crates/api-model/src/instance/status/network.rs
  • crates/machine-a-tron/src/vpc.rs
  • crates/api-web/src/managed_host.rs
  • crates/spdm-controller/src/handler.rs
  • crates/agent/src/containerd/image.rs
  • crates/machine-validation/src/machine_validation.rs
  • crates/ssh-console/tests/util/mod.rs
  • crates/api-core/src/run.rs
  • crates/api-core/src/handlers/machine_validation.rs
  • crates/ssh-console/src/ssh_cert_parsing.rs
  • crates/libnmxm/src/lib.rs
  • crates/bmc-mock/src/combined_server.rs
  • crates/secrets/src/forge_vault.rs
  • crates/agent/src/containerd/container.rs
  • crates/api-core/src/tests/dns.rs
  • crates/host-support/src/hardware_enumeration/dpu.rs
  • crates/agent/src/upgrade.rs
  • crates/host-support/src/registration.rs
  • crates/api-core/src/handlers/machine.rs
  • crates/secrets/src/local_credentials/file.rs
  • crates/dpa-manager/src/card_handler/svpc.rs
  • crates/machine-controller/src/handler/attestation.rs
  • crates/machine-controller/src/handler/sku.rs
  • crates/health/src/discovery/spawn.rs
  • crates/kms-provider/src/providers/transit.rs
  • crates/preingestion-manager/src/bfb_rshim_copier.rs
  • crates/site-explorer/tests/integration/power_shelf.rs
  • crates/rack-controller/src/ready.rs
  • crates/machine-a-tron/src/mock_ssh_server.rs
  • crates/http-connector/src/connector.rs
  • crates/api-model/src/dpa_interface/mod.rs
  • crates/admin-cli/src/rpc.rs
  • crates/bmc-proxy/src/bmc_proxy.rs
  • crates/agent/src/dpu/interface.rs
  • crates/agent/src/instrumentation.rs
  • crates/api-core/src/tests/dpu_reprovisioning.rs
  • crates/machine-a-tron/src/machine_a_tron.rs
  • crates/rpc-utils/src/managed_host_display.rs
  • crates/dpa-manager/src/card_handler/astra.rs
  • crates/machine-a-tron/src/machine_utils.rs
  • crates/api-core/src/handlers/astra.rs
  • crates/rack-controller/src/maintenance.rs
  • crates/api-core/src/handlers/instance.rs
  • crates/scout/src/attestation.rs
  • crates/api-integration-tests/tests/lib.rs
  • crates/api-core/src/dpa/handler.rs
  • crates/api-core/src/scout_stream.rs
  • crates/fmds/src/http_request_metrics.rs
  • crates/ssh-console/src/frontend.rs
  • crates/machine-a-tron/src/machine_state_machine.rs
  • crates/api-db/src/carbide_version.rs
  • crates/ib-fabric/src/lib.rs
  • crates/api-core/src/instance/mod.rs
  • crates/dhcp-server/src/main.rs
  • crates/api-core/src/handlers/svpc.rs
  • crates/scout/src/deprovision/scrabbing.rs
  • crates/scout/src/main.rs
  • crates/bmc-explorer/src/computer_system.rs
  • crates/machine-a-tron/src/host_machine.rs
  • crates/host-support/src/hardware_enumeration.rs
  • crates/api-db/src/lib.rs
  • crates/dpf/src/sdk.rs
  • crates/api-core/src/handlers/bmc_endpoint_explorer.rs
  • crates/agent/src/dpu/route.rs
  • crates/agent/src/extension_services/k8s_pod_handler.rs
  • crates/agent/src/main_loop.rs
  • crates/api-db/src/machine.rs
  • crates/api-core/src/setup.rs
  • crates/agent/src/health.rs
  • crates/scout/src/mlx_device.rs
  • crates/nvlink-manager/src/lib.rs
  • crates/agent/src/traffic_intercept_bridging.rs
  • crates/site-explorer/src/bmc_endpoint_explorer.rs
  • crates/site-explorer/src/lib.rs
  • crates/rack-controller/src/validating.rs
  • crates/preingestion-manager/src/lib.rs
  • crates/machine-controller/src/handler.rs

Comment thread crates/agent/src/mtu.rs Outdated

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

Caution

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

⚠️ Outside diff range comments (1)
crates/agent/src/health.rs (1)

370-390: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Do not overwrite a failed file check with a pass.

When a non-DHCP file is below MIN_SIZE, this branch records failed(...), then falls through to the unconditional passed(...) call. That can report an invalid file as healthy. Return after recording the failure, or make passed(...) conditional on the size check.

Proposed fix
             failed(
                 hr,
                 probe_ids::FileIsValid.clone(),
                 Some(filename.to_string()),
                 "Too small".to_string(),
             );
+            continue;
         }
         passed(
🤖 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/agent/src/health.rs` around lines 370 - 390, Update the file-check
logic around the non-DHCP `stat.len() < MIN_SIZE` branch so it cannot execute
the unconditional `passed(...)` call after recording `failed(...)`. Return
immediately after the failure, or otherwise make `passed(...)` conditional,
while preserving the DHCP size handling and valid-file pass behavior.
🧹 Nitpick comments (8)
crates/bmc-mock/src/main.rs (1)

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

Use tracing shorthand for exit_code.

exit_code is already a tracing value; emit it as exit_code rather than exit_code = exit_code to follow the repository’s structured-field convention.

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

In `@crates/bmc-mock/src/main.rs` around lines 154 - 157, Update the
tracing::error! invocation for the virsh reboot failure to use tracing’s
shorthand field syntax for the existing exit_code value, replacing the explicit
exit_code = exit_code form while preserving the message and logging behavior.

Source: Coding guidelines

crates/api-db/src/carbide_version.rs (1)

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

Use native shorthand for the structured field.

Replace superseded_count = superseded_count with superseded_count. As per coding guidelines, tracing Value fields should use native shorthand.

Proposed fix
 tracing::warn!(
     version,
-    superseded_count = superseded_count,
+    superseded_count,
     "observed a new forge version, superseded versions",
 );
🤖 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-db/src/carbide_version.rs` at line 64, Update the structured
tracing field in the relevant logging statement to use the native shorthand
`superseded_count` instead of the explicit `superseded_count = superseded_count`
form.

Source: Coding guidelines

crates/api-core/src/listener.rs (1)

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

Use native shorthand for same-named tracing fields.

These fields repeat a local variable name unnecessarily. Replace them with tracing shorthand while preserving the same field names and formatters:

  • crates/api-core/src/listener.rs#L288-L291: replace trust_config = ?trust_config with ?trust_config.
  • crates/api-core/src/listener.rs#L433-L437: replace error = %error with %error; retain error_debug = ?error.
  • crates/rack-controller/src/handler.rs#L113-L116: replace controller_state = %controller_state with %controller_state.
  • crates/dpa/src/lib.rs#L73-L77: replace topic = %topic with %topic.

As per coding guidelines, tracing events should use native shorthand for tracing::Value fields.

🤖 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/listener.rs` around lines 288 - 291, Update the tracing
fields to use native shorthand while preserving their existing names and
formatters: in crates/api-core/src/listener.rs lines 288-291, change
trust_config = ?trust_config to ?trust_config; in
crates/api-core/src/listener.rs lines 433-437, change error = %error to %error
while retaining error_debug = ?error; in crates/rack-controller/src/handler.rs
lines 113-116, change controller_state = %controller_state to %controller_state;
and in crates/dpa/src/lib.rs lines 73-77, change topic = %topic to %topic.

Source: Coding guidelines

crates/api-db/src/vpc_dpu_loopback.rs (1)

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

Use native tracing shorthand for same-name fields.

These structured fields repeat the variable name unnecessarily. Native shorthand preserves the field name and formatting while matching the repository convention.

  • crates/api-db/src/vpc_dpu_loopback.rs#L61-L61: replace admin_segments = ?admin_segments with ?admin_segments.
  • crates/api-model/src/firmware.rs#L146-L146: replace firmware_type = ?firmware_type with ?firmware_type.
  • crates/api-model/src/instance/status/network.rs#L224-L225: replace config = ?config with ?config.
🤖 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-db/src/vpc_dpu_loopback.rs` at line 61, Use native tracing
shorthand for the same-name structured fields: replace admin_segments =
?admin_segments with ?admin_segments in
crates/api-db/src/vpc_dpu_loopback.rs:61, firmware_type = ?firmware_type with
?firmware_type in crates/api-model/src/firmware.rs:146, and config = ?config
with ?config in crates/api-model/src/instance/status/network.rs:224-225.
Preserve the existing field values and formatting.

Source: Coding guidelines

crates/health/src/discovery/cleanup.rs (1)

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

Model the closed stop-reason set as an enum.

stop_reason now accepts arbitrary &'static str, while the shown call sites pass fixed values from a finite set. Introduce a CollectorStopReason enum with a Display implementation and log it with %stop_reason.

As per coding guidelines, finite sets should use enums with string conversion through Display/FromStr, rather than raw strings.

Also applies to: 53-53, 92-97

🤖 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/health/src/discovery/cleanup.rs` around lines 27 - 38, Replace the raw
&'static str stop_reason parameter in the cleanup function with a
CollectorStopReason enum covering all existing fixed reason values. Implement
Display (and FromStr if required by the surrounding API), update all affected
call sites to use the enum variants, and log stop_reason with % formatting in
the tracing::info! call.

Source: Coding guidelines

crates/dns/src/lib.rs (1)

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

Log the underlying server error in the structured field.

Line 625 stores the preformatted error_msg, duplicating the static event message and making error less useful for structured searches. Keep error_msg for the returned report, but log error = %e here.

Proposed fix
-                error!(error = %error_msg, "Carbide-dns has encountered an error");
+                error!(error = %e, "Carbide-dns has encountered an error");
🤖 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/dns/src/lib.rs` at line 625, Update the error logging statement in the
surrounding error-handling flow to use the underlying server error variable e
for the structured error field, while retaining error_msg for the returned
report. Keep the existing static log message unchanged.

Source: Coding guidelines

crates/machine-a-tron/src/machine_state_machine.rs (1)

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

Prefer a structured ?request field over a pre-formatted detail string.

detail re-embeds the whole formatted sentence as one opaque field, defeating the purpose of structuring this log — filtering by the specific unsupported SystemPowerControl variant now requires string matching instead of field matching.

♻️ Proposed refactor
             PushPowerButton | Nmi | Suspend | Pause | Resume => {
                 let msg = format!("Machine-a-tron mock: unsupported power request {request:?}",);
                 tracing::warn!(
-                    detail = %msg,
+                    ?request,
                     "unsupported machine-a-tron mock power request",
                 );
                 return Err(SetSystemPowerError::BadRequest(msg));
             }

As per coding guidelines, "record dynamic values as structured fields rather than interpolated into messages."

🤖 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/machine_state_machine.rs` around lines 984 - 997,
The unsupported-request branch in set_system_power should log the
SystemPowerControl value as a structured request field instead of pre-formatting
it into the detail field. Preserve the existing warning message and BadRequest
error text, but pass the matched request directly to tracing so individual
variants remain filterable.

Source: Coding guidelines

crates/mqttea/src/client/core.rs (1)

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

Backoff delay is a duration — consider a carbide_instrument::Event instead of warn!.

delay_ms is fired on every backoff step with no paired counter/histogram (unlike the "queue full" branch, which increments queue_stats_producer). As per coding guidelines, "use plain structured tracing:: macros for ordinary logging; define and emit a carbide_instrument::Event when an event needs a count, rate, or duration," and this file already emits events (MqttReconnected, HandlerDispatchDropped) for comparable occurrences.

🤖 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/mqttea/src/client/core.rs` around lines 717 - 725, Update the
next_delay method to emit an appropriate carbide_instrument::Event for each
backoff delay instead of using warn!. Follow the existing event patterns in this
file, include the delay duration in the event fields, and preserve the current
backoff calculation and returned delay.

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/agent/src/health.rs`:
- Line 597: Update the warning message in parse_disk_utilization from “du status
line too short” to identify the df status line, leaving the surrounding parsing
and logging behavior unchanged.

In `@crates/api-core/src/handlers/instance.rs`:
- Around line 1390-1393: Update the tracing::debug! event in the instance update
method to use the established spx_config field name instead of spxconfig,
matching the earlier SPX configuration log field while leaving the surrounding
log message unchanged.

In `@crates/api-core/src/handlers/site_explorer.rs`:
- Around line 260-263: Update the tracing::info! call in the site exploration
error-clearing flow to replace the unclear message with a stable, grammatically
clear human-readable literal describing that failed preingestion was reset after
clearing the site exploration error; keep the %bmc_ip field unchanged.

In `@crates/api-core/tests/integration/machine_bmc_metadata.rs`:
- Around line 103-105: Update the “Looking up BMC credentials” log in the
relevant test flow to stop serializing the complete request; log only a safe
discriminator or use the repository’s filtered request-logging helper, ensuring
machine IDs and BMC IP/MAC selectors are excluded.

In `@crates/api-test-helper/src/instance.rs`:
- Around line 288-291: Remove the leading tab character from both log message
literals in the instance state reporting code, including the tracing call using
the “Current instance state” message and the corresponding occurrence near the
similarly reported state. Keep the structured logging fields and message text
otherwise unchanged.
- Around line 34-38: Update the tracing::info! message in the instance creation
flow to remove the duplicated “with” and use concise, natural phrasing while
preserving the existing host_machine_id and network_segment_id fields.

In `@crates/dns/src/main.rs`:
- Around line 66-69: Move the OpenTelemetry startup log in the initialization
flow to after tracing_subscriber::registry().try_init() completes successfully.
Preserve the existing endpoint field and message, ensuring the event is emitted
through the configured tracing pipeline.

In `@crates/host-support/src/registration.rs`:
- Line 313: Update the tracing::info! call that logs the newly written machine
certificate in the registration flow to format client_cert with Display syntax
(%client_cert) instead of Debug syntax (?client_cert), preserving the existing
message and behavior.

In `@crates/machine-controller/src/handler.rs`:
- Around line 11234-11237: Add the `machine_id` field to the `tracing::warn!`
call for the AC powercycle failure, sourcing it from the in-scope `mh_snapshot`
value while preserving the existing error field and message.
- Around line 9503-9508: Add the in-scope machine_id field to the
tracing::debug! call for "Moving firmware chain step to CheckingFirmware",
matching the field naming and formatting used by sibling logs in
host_waiting_fw. Preserve the existing firmware, firmware_number, and address
fields.

In `@crates/preingestion-manager/src/lib.rs`:
- Around line 3307-3314: Add address = %endpoint_clone.address to both the
multipart-not-supported tracing::warn! call and the failed-to-open-firmware-file
tracing::error! call within initiate_update, preserving their existing error
fields and messages.

In `@crates/rpc/src/forge_tls_client.rs`:
- Around line 691-694: Update the retry log message in retry_build_nmx_c to
identify the NMX-C API instead of the Forge API, matching the existing
post-retry log wording while leaving the error and URL fields unchanged.

In `@crates/site-explorer/src/lib.rs`:
- Around line 3223-3225: The Viking ingestion warnings are misleading: update
the warning at crates/site-explorer/src/lib.rs lines 3223-3225 to state that the
manager report is missing, since this branch checks report.managers.first();
update the warning at lines 3247-3250 to say the CPLD version does not match,
unless the code is changed to compare ordering before claiming it is lower.

In `@crates/spdm-controller/src/handler.rs`:
- Around line 243-246: Update the tracing::error! call in the unexpected
task-state branch of the measurement handling flow to describe the measurement
collection task entering an unexpected state, rather than failing to trigger
measurement. Preserve the existing error and task_state fields.

In `@crates/ssh-console/tests/util/mod.rs`:
- Line 195: Update the tracing::debug call for the “Configured baseline test
mock hosts” message to avoid logging mock_hosts directly, since MockHost debug
output includes bmc_password. Log only a safe aggregate such as the number of
configured hosts or another redacted summary.

---

Outside diff comments:
In `@crates/agent/src/health.rs`:
- Around line 370-390: Update the file-check logic around the non-DHCP
`stat.len() < MIN_SIZE` branch so it cannot execute the unconditional
`passed(...)` call after recording `failed(...)`. Return immediately after the
failure, or otherwise make `passed(...)` conditional, while preserving the DHCP
size handling and valid-file pass behavior.

---

Nitpick comments:
In `@crates/api-core/src/listener.rs`:
- Around line 288-291: Update the tracing fields to use native shorthand while
preserving their existing names and formatters: in
crates/api-core/src/listener.rs lines 288-291, change trust_config =
?trust_config to ?trust_config; in crates/api-core/src/listener.rs lines
433-437, change error = %error to %error while retaining error_debug = ?error;
in crates/rack-controller/src/handler.rs lines 113-116, change controller_state
= %controller_state to %controller_state; and in crates/dpa/src/lib.rs lines
73-77, change topic = %topic to %topic.

In `@crates/api-db/src/carbide_version.rs`:
- Line 64: Update the structured tracing field in the relevant logging statement
to use the native shorthand `superseded_count` instead of the explicit
`superseded_count = superseded_count` form.

In `@crates/api-db/src/vpc_dpu_loopback.rs`:
- Line 61: Use native tracing shorthand for the same-name structured fields:
replace admin_segments = ?admin_segments with ?admin_segments in
crates/api-db/src/vpc_dpu_loopback.rs:61, firmware_type = ?firmware_type with
?firmware_type in crates/api-model/src/firmware.rs:146, and config = ?config
with ?config in crates/api-model/src/instance/status/network.rs:224-225.
Preserve the existing field values and formatting.

In `@crates/bmc-mock/src/main.rs`:
- Around line 154-157: Update the tracing::error! invocation for the virsh
reboot failure to use tracing’s shorthand field syntax for the existing
exit_code value, replacing the explicit exit_code = exit_code form while
preserving the message and logging behavior.

In `@crates/dns/src/lib.rs`:
- Line 625: Update the error logging statement in the surrounding error-handling
flow to use the underlying server error variable e for the structured error
field, while retaining error_msg for the returned report. Keep the existing
static log message unchanged.

In `@crates/health/src/discovery/cleanup.rs`:
- Around line 27-38: Replace the raw &'static str stop_reason parameter in the
cleanup function with a CollectorStopReason enum covering all existing fixed
reason values. Implement Display (and FromStr if required by the surrounding
API), update all affected call sites to use the enum variants, and log
stop_reason with % formatting in the tracing::info! call.

In `@crates/machine-a-tron/src/machine_state_machine.rs`:
- Around line 984-997: The unsupported-request branch in set_system_power should
log the SystemPowerControl value as a structured request field instead of
pre-formatting it into the detail field. Preserve the existing warning message
and BadRequest error text, but pass the matched request directly to tracing so
individual variants remain filterable.

In `@crates/mqttea/src/client/core.rs`:
- Around line 717-725: Update the next_delay method to emit an appropriate
carbide_instrument::Event for each backoff delay instead of using warn!. Follow
the existing event patterns in this file, include the delay duration in the
event fields, and preserve the current backoff calculation and returned delay.
🪄 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: 4152e4f2-4b02-4fe0-b2df-16d5c698c9dd

📥 Commits

Reviewing files that changed from the base of the PR and between c0952bb and 1a82cf6.

📒 Files selected for processing (271)
  • STYLE_GUIDE.md
  • crates/admin-cli/src/machine/show/cmd.rs
  • crates/admin-cli/src/rpc.rs
  • crates/agent/src/agent_platform.rs
  • crates/agent/src/astra_weave.rs
  • crates/agent/src/containerd/container.rs
  • crates/agent/src/containerd/image.rs
  • crates/agent/src/dhcp_server_grpc_client.rs
  • crates/agent/src/dpu/interface.rs
  • crates/agent/src/dpu/link.rs
  • crates/agent/src/dpu/route.rs
  • crates/agent/src/ethernet_virtualization.rs
  • crates/agent/src/extension_services/dpu_extension_service_observability.rs
  • crates/agent/src/extension_services/k8s_pod_handler.rs
  • crates/agent/src/hbn.rs
  • crates/agent/src/health.rs
  • crates/agent/src/health/bgp.rs
  • crates/agent/src/host_machine_id.rs
  • crates/agent/src/instance_metadata_endpoint.rs
  • crates/agent/src/instrumentation.rs
  • crates/agent/src/lib.rs
  • crates/agent/src/machine_inventory_updater.rs
  • crates/agent/src/main_loop.rs
  • crates/agent/src/managed_files.rs
  • crates/agent/src/mtu.rs
  • crates/agent/src/netlink.rs
  • crates/agent/src/network_monitor.rs
  • crates/agent/src/nvue.rs
  • crates/agent/src/ovs.rs
  • crates/agent/src/periodic_config_fetcher.rs
  • crates/agent/src/tests/common/mod.rs
  • crates/agent/src/tests/full.rs
  • crates/agent/src/tests/test_network_monitor.rs
  • crates/agent/src/traffic_intercept_bridging.rs
  • crates/agent/src/upgrade.rs
  • crates/api-core/src/attestation/measured_boot.rs
  • crates/api-core/src/attestation/tpm_ca_cert.rs
  • crates/api-core/src/db_init.rs
  • crates/api-core/src/dhcp/discover.rs
  • crates/api-core/src/dpa/handler.rs
  • crates/api-core/src/dynamic_settings.rs
  • crates/api-core/src/handlers/api.rs
  • crates/api-core/src/handlers/astra.rs
  • crates/api-core/src/handlers/attestation.rs
  • crates/api-core/src/handlers/bmc_endpoint_explorer.rs
  • crates/api-core/src/handlers/component_manager.rs
  • crates/api-core/src/handlers/dns.rs
  • crates/api-core/src/handlers/dpu_remediation.rs
  • crates/api-core/src/handlers/expected_machine.rs
  • crates/api-core/src/handlers/extension_service.rs
  • crates/api-core/src/handlers/finder.rs
  • crates/api-core/src/handlers/firmware.rs
  • crates/api-core/src/handlers/instance.rs
  • crates/api-core/src/handlers/instance_type.rs
  • crates/api-core/src/handlers/machine.rs
  • crates/api-core/src/handlers/machine_discovery.rs
  • crates/api-core/src/handlers/machine_scout.rs
  • crates/api-core/src/handlers/machine_validation.rs
  • crates/api-core/src/handlers/rack.rs
  • crates/api-core/src/handlers/redfish.rs
  • crates/api-core/src/handlers/scout_stream.rs
  • crates/api-core/src/handlers/site_explorer.rs
  • crates/api-core/src/handlers/svpc.rs
  • crates/api-core/src/handlers/uefi.rs
  • crates/api-core/src/instance/mod.rs
  • crates/api-core/src/ipxe.rs
  • crates/api-core/src/listener.rs
  • crates/api-core/src/logging/setup.rs
  • crates/api-core/src/machine_update_manager/dpu_nic_firmware.rs
  • crates/api-core/src/machine_update_manager/host_firmware.rs
  • crates/api-core/src/machine_update_manager/mod.rs
  • crates/api-core/src/machine_validation/mod.rs
  • crates/api-core/src/measured_boot/metrics_collector/mod.rs
  • crates/api-core/src/mqtt_state_change_hook/hook.rs
  • crates/api-core/src/run.rs
  • crates/api-core/src/scout_stream.rs
  • crates/api-core/src/setup.rs
  • crates/api-core/src/tests/common/api_fixtures/dpu.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/common/api_fixtures/test_machine/mod.rs
  • crates/api-core/src/tests/dns.rs
  • crates/api-core/src/tests/dpu_reprovisioning.rs
  • crates/api-core/src/tests/instance.rs
  • crates/api-core/src/tests/machine_network.rs
  • crates/api-core/src/tests/sku.rs
  • crates/api-core/tests/integration/machine_bmc_metadata.rs
  • crates/api-db/src/bmc_metadata.rs
  • crates/api-db/src/carbide_version.rs
  • crates/api-db/src/dns/resource_record.rs
  • crates/api-db/src/expected_power_shelf.rs
  • crates/api-db/src/expected_switch.rs
  • crates/api-db/src/instance.rs
  • crates/api-db/src/lib.rs
  • crates/api-db/src/machine.rs
  • crates/api-db/src/machine_interface.rs
  • crates/api-db/src/machine_topology.rs
  • crates/api-db/src/measured_boot/bundle.rs
  • crates/api-db/src/vpc_dpu_loopback.rs
  • crates/api-db/src/work_lock_manager.rs
  • crates/api-integration-tests/tests/lib.rs
  • crates/api-model/src/dpa_interface/mod.rs
  • crates/api-model/src/firmware.rs
  • crates/api-model/src/instance/status/network.rs
  • crates/api-model/src/instance/status/nvlink.rs
  • crates/api-model/src/instance/status/spx.rs
  • crates/api-model/src/machine/mod.rs
  • crates/api-model/src/machine/nvlink.rs
  • crates/api-model/src/machine/spx.rs
  • crates/api-model/src/site_explorer/mod.rs
  • crates/api-test-helper/src/domain.rs
  • crates/api-test-helper/src/instance.rs
  • crates/api-test-helper/src/machine.rs
  • crates/api-test-helper/src/machine_a_tron.rs
  • crates/api-test-helper/src/subnet.rs
  • crates/api-test-helper/src/tenant.rs
  • crates/api-test-helper/src/vpc.rs
  • crates/api-test-helper/src/vpc_prefix.rs
  • crates/api-web/src/auth.rs
  • crates/api-web/src/interface.rs
  • crates/api-web/src/lib.rs
  • crates/api-web/src/machine.rs
  • crates/api-web/src/managed_host.rs
  • crates/api-web/src/search.rs
  • crates/bmc-explorer/src/chassis.rs
  • crates/bmc-explorer/src/computer_system.rs
  • crates/bmc-explorer/src/manager.rs
  • crates/bmc-mock/src/combined_server.rs
  • crates/bmc-mock/src/combined_service.rs
  • crates/bmc-mock/src/main.rs
  • crates/bmc-mock/src/redfish/expander_router.rs
  • crates/bmc-mock/src/tar_router.rs
  • crates/bmc-mock/src/tls.rs
  • crates/bmc-proxy/src/bmc_proxy.rs
  • crates/bmc-proxy/src/setup.rs
  • crates/dhcp-server/src/cache.rs
  • crates/dhcp-server/src/grpc_server.rs
  • crates/dhcp-server/src/main.rs
  • crates/dhcp-server/src/modes/controller.rs
  • crates/dhcp-server/src/packet_handler.rs
  • crates/dhcp-server/src/util.rs
  • crates/dns-record/src/lib.rs
  • crates/dns/src/lib.rs
  • crates/dns/src/main.rs
  • crates/dpa-manager/src/card_handler/astra.rs
  • crates/dpa-manager/src/card_handler/svpc.rs
  • crates/dpa-manager/src/lib.rs
  • crates/dpa/src/lib.rs
  • crates/dpf/src/sdk.rs
  • crates/dpu-otel-agent/src/lib.rs
  • crates/dpu-remediation/src/remediation.rs
  • crates/dsx-exchange-consumer/src/api_client.rs
  • crates/firmware/src/config.rs
  • crates/firmware/src/downloader.rs
  • crates/fmds/src/http_request_metrics.rs
  • crates/fmds/src/main.rs
  • crates/fmds/src/nic_init.rs
  • crates/fmds/src/phone_home.rs
  • crates/health/src/api_client.rs
  • crates/health/src/collectors/logs/periodic.rs
  • crates/health/src/discovery/cleanup.rs
  • crates/health/src/discovery/context.rs
  • crates/health/src/discovery/spawn.rs
  • crates/health/src/metrics.rs
  • crates/host-support/src/hardware_enumeration.rs
  • crates/host-support/src/hardware_enumeration/dpu.rs
  • crates/host-support/src/hardware_enumeration/gpu.rs
  • crates/host-support/src/hardware_enumeration/tpm.rs
  • crates/host-support/src/registration.rs
  • crates/http-connector/src/connector.rs
  • crates/http-connector/src/resolver.rs
  • crates/ib-fabric/src/lib.rs
  • crates/ib-partition-controller/src/handler.rs
  • crates/ipmi/src/tool.rs
  • crates/kms-provider/src/providers/transit.rs
  • crates/libmlx/src/device/discovery.rs
  • crates/libnmxc/src/lib.rs
  • crates/libnmxm/src/lib.rs
  • crates/machine-a-tron/src/api_client.rs
  • crates/machine-a-tron/src/api_throttler.rs
  • crates/machine-a-tron/src/bmc_mock_wrapper.rs
  • crates/machine-a-tron/src/dhcp_wrapper.rs
  • crates/machine-a-tron/src/host_machine.rs
  • crates/machine-a-tron/src/machine_a_tron.rs
  • crates/machine-a-tron/src/machine_state_machine.rs
  • crates/machine-a-tron/src/machine_utils.rs
  • crates/machine-a-tron/src/main.rs
  • crates/machine-a-tron/src/mock_ssh_server.rs
  • crates/machine-a-tron/src/subnet.rs
  • crates/machine-a-tron/src/tui.rs
  • crates/machine-a-tron/src/vpc.rs
  • crates/machine-controller/src/dpf.rs
  • crates/machine-controller/src/handler.rs
  • crates/machine-controller/src/handler/attestation.rs
  • crates/machine-controller/src/handler/bios_config.rs
  • crates/machine-controller/src/handler/dpf.rs
  • crates/machine-controller/src/handler/machine_validation.rs
  • crates/machine-controller/src/handler/power.rs
  • crates/machine-controller/src/handler/sku.rs
  • crates/machine-validation/src/machine_validation.rs
  • crates/metrics-endpoint/src/lib.rs
  • crates/metrics-utils/src/lib.rs
  • crates/mqttea-example/src/main.rs
  • crates/mqttea/src/client/core.rs
  • crates/mqttea/src/client/messages.rs
  • crates/mqttea/src/registry/core.rs
  • crates/nvlink-manager/src/lib.rs
  • crates/nvlink-manager/src/switch_cert_monitor.rs
  • crates/power-shelf-controller/src/configuring.rs
  • crates/power-shelf-controller/src/deleting.rs
  • crates/power-shelf-controller/src/fetching_data.rs
  • crates/power-shelf-controller/src/initializing.rs
  • crates/preingestion-manager/src/bfb_rshim_copier.rs
  • crates/preingestion-manager/src/lib.rs
  • crates/preingestion-manager/tests/integration/host_bmc_firmware.rs
  • crates/rack-controller/src/created.rs
  • crates/rack-controller/src/discovering.rs
  • crates/rack-controller/src/error_state.rs
  • crates/rack-controller/src/handler.rs
  • crates/rack-controller/src/lib.rs
  • crates/rack-controller/src/maintenance.rs
  • crates/rack-controller/src/ready.rs
  • crates/rack-controller/src/validating.rs
  • crates/rpc-utils/src/managed_host_display.rs
  • crates/rpc/src/errors.rs
  • crates/rpc/src/forge_tls_client.rs
  • crates/rpc/src/model/dpu_remediation.rs
  • crates/scout/src/attestation.rs
  • crates/scout/src/deprovision/scrabbing.rs
  • crates/scout/src/firmware_upgrade.rs
  • crates/scout/src/main.rs
  • crates/scout/src/mlx_device.rs
  • crates/scout/src/register.rs
  • crates/scout/src/stream.rs
  • crates/scout/src/tpm.rs
  • crates/secrets/src/forge_vault.rs
  • crates/secrets/src/local_credentials/file.rs
  • crates/site-explorer/src/bmc_endpoint_explorer.rs
  • crates/site-explorer/src/explored_endpoint_index.rs
  • crates/site-explorer/src/lib.rs
  • crates/site-explorer/src/machine_creator.rs
  • crates/site-explorer/src/redfish.rs
  • crates/site-explorer/src/switch_creator.rs
  • crates/site-explorer/src/test_support/mock_endpoint_explorer.rs
  • crates/site-explorer/tests/integration/power_shelf.rs
  • crates/site-explorer/tests/integration/site_explorer.rs
  • crates/site-explorer/tests/integration/switch.rs
  • crates/spdm-controller/src/handler.rs
  • crates/ssh-console-mock-api-server/src/lib.rs
  • crates/ssh-console/src/bmc/client.rs
  • crates/ssh-console/src/bmc/connection.rs
  • crates/ssh-console/src/bmc/connection_impl/ipmi.rs
  • crates/ssh-console/src/bmc/connection_impl/ssh.rs
  • crates/ssh-console/src/bmc/message_proxy.rs
  • crates/ssh-console/src/config.rs
  • crates/ssh-console/src/console_logger.rs
  • crates/ssh-console/src/frontend.rs
  • crates/ssh-console/src/metrics.rs
  • crates/ssh-console/src/ssh_cert_parsing.rs
  • crates/ssh-console/src/ssh_server.rs
  • crates/ssh-console/tests/util/ipmi_sim.rs
  • crates/ssh-console/tests/util/mod.rs
  • crates/state-controller/src/controller/processor.rs
  • crates/switch-controller/src/certificate.rs
  • crates/switch-controller/src/configuring.rs
  • crates/switch-controller/src/created.rs
  • crates/switch-controller/src/deleting.rs
  • crates/switch-controller/src/error_state.rs
  • crates/switch-controller/src/initializing.rs
  • crates/switch-controller/src/ready.rs
  • crates/switch-controller/src/validating.rs
💤 Files with no reviewable changes (1)
  • crates/health/src/discovery/context.rs

Comment thread crates/agent/src/health.rs Outdated
Comment thread crates/api-core/src/handlers/instance.rs Outdated
Comment thread crates/api-core/src/handlers/site_explorer.rs
Comment thread crates/api-core/tests/integration/machine_bmc_metadata.rs Outdated
Comment thread crates/api-test-helper/src/instance.rs
Comment thread crates/preingestion-manager/src/lib.rs Outdated
Comment thread crates/rpc/src/forge_tls_client.rs
Comment thread crates/site-explorer/src/lib.rs
Comment thread crates/spdm-controller/src/handler.rs Outdated
Comment thread crates/ssh-console/tests/util/mod.rs Outdated
@github-actions

github-actions Bot commented Jul 14, 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 15 31 78 7 128
machine-validation-runner 809 48 238 290 36 197
machine_validation 809 48 238 290 36 197
machine_validation-aarch64 809 48 238 290 36 197
nvmetal-carbide 809 48 238 290 36 197
TOTAL 3501 207 983 1244 151 916

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

Final feedback pass is in b70b2ba:

  • Addressed all late inline findings, the outside-diff health-check fallthrough, and the applicable structured-logging consistency suggestions.
  • Kept the MQTT backoff as an ordinary structured warning; introducing a new metric name, type, and telemetry semantics belongs in a separate instrumentation design change.
  • Revalidated with nightly formatting, full Clippy, Carbide lints, a 24-library unit-test matrix, the 66-item intentional residual audit, and a no-findings local CodeRabbit review of the final 24-file delta.

@coderabbitai full_review, thanks!

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

@chet, thank you for the thorough revalidation pass. Acknowledged:

  • Late inline findings, the outside-diff health-check fallthrough, and applicable structured-logging consistency suggestions addressed in commit b70b2ba01.
  • Agreed that introducing a new metric name/type/telemetry semantics for the MQTT backoff is a separate instrumentation design concern and out of scope here — keeping it as a structured warning is the right call for this refactor.
  • Noted the clean revalidation: nightly formatting, full Clippy, Carbide lints, the 24-library unit-test matrix, the 66-item intentional residual audit, and a no-findings local CodeRabbit review of the final 24-file delta.

Kicking off the full review now to verify the final delta.

(=^・ω・^=)


✏️ Learnings added
Learnt from: chet
URL: https://github.com/NVIDIA/infra-controller/pull/3479

Timestamp: 2026-07-14T11:26:47.232Z
Learning: Learnt from: chet
Repo: NVIDIA/infra-controller
PR: `#3479`
In this structured-logging refactor PR, the MQTT client backoff/retry warning logging (e.g., in crates/mqttea or similar MQTT client backoff paths) was intentionally kept as an ordinary structured `tracing::warn!` log rather than being converted into a dedicated metric. Introducing a new metric name, type, and telemetry semantics for MQTT backoff is considered a separate instrumentation design change and out of scope for structured-logging refactors.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

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

🤖 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-core/src/dpa/handler.rs`:
- Around line 60-66: Update the MAC parsing error branch in the DPA handler to
bind the parse failure instead of discarding it as _e, then include that bound
error as a structured tracing field in the tracing::error! call alongside
mac_address.
- Around line 151-153: Update the partition validation around partition.len() to
distinguish zero matches from multiple matches: retain the “partition not found”
error only for an empty result, and log a separate data-integrity error
including the number of duplicate matches when more than one row is returned.
Preserve the existing return behavior for both invalid cases.
🪄 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: 5d6a0909-2cd7-41ae-af1e-b83fa055a512

📥 Commits

Reviewing files that changed from the base of the PR and between 1a82cf6 and b70b2ba.

📒 Files selected for processing (271)
  • STYLE_GUIDE.md
  • crates/admin-cli/src/machine/show/cmd.rs
  • crates/admin-cli/src/rpc.rs
  • crates/agent/src/agent_platform.rs
  • crates/agent/src/astra_weave.rs
  • crates/agent/src/containerd/container.rs
  • crates/agent/src/containerd/image.rs
  • crates/agent/src/dhcp_server_grpc_client.rs
  • crates/agent/src/dpu/interface.rs
  • crates/agent/src/dpu/link.rs
  • crates/agent/src/dpu/route.rs
  • crates/agent/src/ethernet_virtualization.rs
  • crates/agent/src/extension_services/dpu_extension_service_observability.rs
  • crates/agent/src/extension_services/k8s_pod_handler.rs
  • crates/agent/src/hbn.rs
  • crates/agent/src/health.rs
  • crates/agent/src/health/bgp.rs
  • crates/agent/src/host_machine_id.rs
  • crates/agent/src/instance_metadata_endpoint.rs
  • crates/agent/src/instrumentation.rs
  • crates/agent/src/lib.rs
  • crates/agent/src/machine_inventory_updater.rs
  • crates/agent/src/main_loop.rs
  • crates/agent/src/managed_files.rs
  • crates/agent/src/mtu.rs
  • crates/agent/src/netlink.rs
  • crates/agent/src/network_monitor.rs
  • crates/agent/src/nvue.rs
  • crates/agent/src/ovs.rs
  • crates/agent/src/periodic_config_fetcher.rs
  • crates/agent/src/tests/common/mod.rs
  • crates/agent/src/tests/full.rs
  • crates/agent/src/tests/test_network_monitor.rs
  • crates/agent/src/traffic_intercept_bridging.rs
  • crates/agent/src/upgrade.rs
  • crates/api-core/src/attestation/measured_boot.rs
  • crates/api-core/src/attestation/tpm_ca_cert.rs
  • crates/api-core/src/db_init.rs
  • crates/api-core/src/dhcp/discover.rs
  • crates/api-core/src/dpa/handler.rs
  • crates/api-core/src/dynamic_settings.rs
  • crates/api-core/src/handlers/api.rs
  • crates/api-core/src/handlers/astra.rs
  • crates/api-core/src/handlers/attestation.rs
  • crates/api-core/src/handlers/bmc_endpoint_explorer.rs
  • crates/api-core/src/handlers/component_manager.rs
  • crates/api-core/src/handlers/dns.rs
  • crates/api-core/src/handlers/dpu_remediation.rs
  • crates/api-core/src/handlers/expected_machine.rs
  • crates/api-core/src/handlers/extension_service.rs
  • crates/api-core/src/handlers/finder.rs
  • crates/api-core/src/handlers/firmware.rs
  • crates/api-core/src/handlers/instance.rs
  • crates/api-core/src/handlers/instance_type.rs
  • crates/api-core/src/handlers/machine.rs
  • crates/api-core/src/handlers/machine_discovery.rs
  • crates/api-core/src/handlers/machine_scout.rs
  • crates/api-core/src/handlers/machine_validation.rs
  • crates/api-core/src/handlers/rack.rs
  • crates/api-core/src/handlers/redfish.rs
  • crates/api-core/src/handlers/scout_stream.rs
  • crates/api-core/src/handlers/site_explorer.rs
  • crates/api-core/src/handlers/svpc.rs
  • crates/api-core/src/handlers/uefi.rs
  • crates/api-core/src/instance/mod.rs
  • crates/api-core/src/ipxe.rs
  • crates/api-core/src/listener.rs
  • crates/api-core/src/logging/setup.rs
  • crates/api-core/src/machine_update_manager/dpu_nic_firmware.rs
  • crates/api-core/src/machine_update_manager/host_firmware.rs
  • crates/api-core/src/machine_update_manager/mod.rs
  • crates/api-core/src/machine_validation/mod.rs
  • crates/api-core/src/measured_boot/metrics_collector/mod.rs
  • crates/api-core/src/mqtt_state_change_hook/hook.rs
  • crates/api-core/src/run.rs
  • crates/api-core/src/scout_stream.rs
  • crates/api-core/src/setup.rs
  • crates/api-core/src/tests/common/api_fixtures/dpu.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/common/api_fixtures/test_machine/mod.rs
  • crates/api-core/src/tests/dns.rs
  • crates/api-core/src/tests/dpu_reprovisioning.rs
  • crates/api-core/src/tests/instance.rs
  • crates/api-core/src/tests/machine_network.rs
  • crates/api-core/src/tests/sku.rs
  • crates/api-core/tests/integration/machine_bmc_metadata.rs
  • crates/api-db/src/bmc_metadata.rs
  • crates/api-db/src/carbide_version.rs
  • crates/api-db/src/dns/resource_record.rs
  • crates/api-db/src/expected_power_shelf.rs
  • crates/api-db/src/expected_switch.rs
  • crates/api-db/src/instance.rs
  • crates/api-db/src/lib.rs
  • crates/api-db/src/machine.rs
  • crates/api-db/src/machine_interface.rs
  • crates/api-db/src/machine_topology.rs
  • crates/api-db/src/measured_boot/bundle.rs
  • crates/api-db/src/vpc_dpu_loopback.rs
  • crates/api-db/src/work_lock_manager.rs
  • crates/api-integration-tests/tests/lib.rs
  • crates/api-model/src/dpa_interface/mod.rs
  • crates/api-model/src/firmware.rs
  • crates/api-model/src/instance/status/network.rs
  • crates/api-model/src/instance/status/nvlink.rs
  • crates/api-model/src/instance/status/spx.rs
  • crates/api-model/src/machine/mod.rs
  • crates/api-model/src/machine/nvlink.rs
  • crates/api-model/src/machine/spx.rs
  • crates/api-model/src/site_explorer/mod.rs
  • crates/api-test-helper/src/domain.rs
  • crates/api-test-helper/src/instance.rs
  • crates/api-test-helper/src/machine.rs
  • crates/api-test-helper/src/machine_a_tron.rs
  • crates/api-test-helper/src/subnet.rs
  • crates/api-test-helper/src/tenant.rs
  • crates/api-test-helper/src/vpc.rs
  • crates/api-test-helper/src/vpc_prefix.rs
  • crates/api-web/src/auth.rs
  • crates/api-web/src/interface.rs
  • crates/api-web/src/lib.rs
  • crates/api-web/src/machine.rs
  • crates/api-web/src/managed_host.rs
  • crates/api-web/src/search.rs
  • crates/bmc-explorer/src/chassis.rs
  • crates/bmc-explorer/src/computer_system.rs
  • crates/bmc-explorer/src/manager.rs
  • crates/bmc-mock/src/combined_server.rs
  • crates/bmc-mock/src/combined_service.rs
  • crates/bmc-mock/src/main.rs
  • crates/bmc-mock/src/redfish/expander_router.rs
  • crates/bmc-mock/src/tar_router.rs
  • crates/bmc-mock/src/tls.rs
  • crates/bmc-proxy/src/bmc_proxy.rs
  • crates/bmc-proxy/src/setup.rs
  • crates/dhcp-server/src/cache.rs
  • crates/dhcp-server/src/grpc_server.rs
  • crates/dhcp-server/src/main.rs
  • crates/dhcp-server/src/modes/controller.rs
  • crates/dhcp-server/src/packet_handler.rs
  • crates/dhcp-server/src/util.rs
  • crates/dns-record/src/lib.rs
  • crates/dns/src/lib.rs
  • crates/dns/src/main.rs
  • crates/dpa-manager/src/card_handler/astra.rs
  • crates/dpa-manager/src/card_handler/svpc.rs
  • crates/dpa-manager/src/lib.rs
  • crates/dpa/src/lib.rs
  • crates/dpf/src/sdk.rs
  • crates/dpu-otel-agent/src/lib.rs
  • crates/dpu-remediation/src/remediation.rs
  • crates/dsx-exchange-consumer/src/api_client.rs
  • crates/firmware/src/config.rs
  • crates/firmware/src/downloader.rs
  • crates/fmds/src/http_request_metrics.rs
  • crates/fmds/src/main.rs
  • crates/fmds/src/nic_init.rs
  • crates/fmds/src/phone_home.rs
  • crates/health/src/api_client.rs
  • crates/health/src/collectors/logs/periodic.rs
  • crates/health/src/discovery/cleanup.rs
  • crates/health/src/discovery/context.rs
  • crates/health/src/discovery/spawn.rs
  • crates/health/src/metrics.rs
  • crates/host-support/src/hardware_enumeration.rs
  • crates/host-support/src/hardware_enumeration/dpu.rs
  • crates/host-support/src/hardware_enumeration/gpu.rs
  • crates/host-support/src/hardware_enumeration/tpm.rs
  • crates/host-support/src/registration.rs
  • crates/http-connector/src/connector.rs
  • crates/http-connector/src/resolver.rs
  • crates/ib-fabric/src/lib.rs
  • crates/ib-partition-controller/src/handler.rs
  • crates/ipmi/src/tool.rs
  • crates/kms-provider/src/providers/transit.rs
  • crates/libmlx/src/device/discovery.rs
  • crates/libnmxc/src/lib.rs
  • crates/libnmxm/src/lib.rs
  • crates/machine-a-tron/src/api_client.rs
  • crates/machine-a-tron/src/api_throttler.rs
  • crates/machine-a-tron/src/bmc_mock_wrapper.rs
  • crates/machine-a-tron/src/dhcp_wrapper.rs
  • crates/machine-a-tron/src/host_machine.rs
  • crates/machine-a-tron/src/machine_a_tron.rs
  • crates/machine-a-tron/src/machine_state_machine.rs
  • crates/machine-a-tron/src/machine_utils.rs
  • crates/machine-a-tron/src/main.rs
  • crates/machine-a-tron/src/mock_ssh_server.rs
  • crates/machine-a-tron/src/subnet.rs
  • crates/machine-a-tron/src/tui.rs
  • crates/machine-a-tron/src/vpc.rs
  • crates/machine-controller/src/dpf.rs
  • crates/machine-controller/src/handler.rs
  • crates/machine-controller/src/handler/attestation.rs
  • crates/machine-controller/src/handler/bios_config.rs
  • crates/machine-controller/src/handler/dpf.rs
  • crates/machine-controller/src/handler/machine_validation.rs
  • crates/machine-controller/src/handler/power.rs
  • crates/machine-controller/src/handler/sku.rs
  • crates/machine-validation/src/machine_validation.rs
  • crates/metrics-endpoint/src/lib.rs
  • crates/metrics-utils/src/lib.rs
  • crates/mqttea-example/src/main.rs
  • crates/mqttea/src/client/core.rs
  • crates/mqttea/src/client/messages.rs
  • crates/mqttea/src/registry/core.rs
  • crates/nvlink-manager/src/lib.rs
  • crates/nvlink-manager/src/switch_cert_monitor.rs
  • crates/power-shelf-controller/src/configuring.rs
  • crates/power-shelf-controller/src/deleting.rs
  • crates/power-shelf-controller/src/fetching_data.rs
  • crates/power-shelf-controller/src/initializing.rs
  • crates/preingestion-manager/src/bfb_rshim_copier.rs
  • crates/preingestion-manager/src/lib.rs
  • crates/preingestion-manager/tests/integration/host_bmc_firmware.rs
  • crates/rack-controller/src/created.rs
  • crates/rack-controller/src/discovering.rs
  • crates/rack-controller/src/error_state.rs
  • crates/rack-controller/src/handler.rs
  • crates/rack-controller/src/lib.rs
  • crates/rack-controller/src/maintenance.rs
  • crates/rack-controller/src/ready.rs
  • crates/rack-controller/src/validating.rs
  • crates/rpc-utils/src/managed_host_display.rs
  • crates/rpc/src/errors.rs
  • crates/rpc/src/forge_tls_client.rs
  • crates/rpc/src/model/dpu_remediation.rs
  • crates/scout/src/attestation.rs
  • crates/scout/src/deprovision/scrabbing.rs
  • crates/scout/src/firmware_upgrade.rs
  • crates/scout/src/main.rs
  • crates/scout/src/mlx_device.rs
  • crates/scout/src/register.rs
  • crates/scout/src/stream.rs
  • crates/scout/src/tpm.rs
  • crates/secrets/src/forge_vault.rs
  • crates/secrets/src/local_credentials/file.rs
  • crates/site-explorer/src/bmc_endpoint_explorer.rs
  • crates/site-explorer/src/explored_endpoint_index.rs
  • crates/site-explorer/src/lib.rs
  • crates/site-explorer/src/machine_creator.rs
  • crates/site-explorer/src/redfish.rs
  • crates/site-explorer/src/switch_creator.rs
  • crates/site-explorer/src/test_support/mock_endpoint_explorer.rs
  • crates/site-explorer/tests/integration/power_shelf.rs
  • crates/site-explorer/tests/integration/site_explorer.rs
  • crates/site-explorer/tests/integration/switch.rs
  • crates/spdm-controller/src/handler.rs
  • crates/ssh-console-mock-api-server/src/lib.rs
  • crates/ssh-console/src/bmc/client.rs
  • crates/ssh-console/src/bmc/connection.rs
  • crates/ssh-console/src/bmc/connection_impl/ipmi.rs
  • crates/ssh-console/src/bmc/connection_impl/ssh.rs
  • crates/ssh-console/src/bmc/message_proxy.rs
  • crates/ssh-console/src/config.rs
  • crates/ssh-console/src/console_logger.rs
  • crates/ssh-console/src/frontend.rs
  • crates/ssh-console/src/metrics.rs
  • crates/ssh-console/src/ssh_cert_parsing.rs
  • crates/ssh-console/src/ssh_server.rs
  • crates/ssh-console/tests/util/ipmi_sim.rs
  • crates/ssh-console/tests/util/mod.rs
  • crates/state-controller/src/controller/processor.rs
  • crates/switch-controller/src/certificate.rs
  • crates/switch-controller/src/configuring.rs
  • crates/switch-controller/src/created.rs
  • crates/switch-controller/src/deleting.rs
  • crates/switch-controller/src/error_state.rs
  • crates/switch-controller/src/initializing.rs
  • crates/switch-controller/src/ready.rs
  • crates/switch-controller/src/validating.rs
💤 Files with no reviewable changes (1)
  • crates/health/src/discovery/context.rs
🚧 Files skipped from review as they are similar to previous changes (241)
  • crates/site-explorer/src/test_support/mock_endpoint_explorer.rs
  • crates/agent/src/netlink.rs
  • crates/power-shelf-controller/src/initializing.rs
  • crates/switch-controller/src/validating.rs
  • crates/dhcp-server/src/modes/controller.rs
  • crates/api-test-helper/src/vpc_prefix.rs
  • crates/api-test-helper/src/tenant.rs
  • crates/dsx-exchange-consumer/src/api_client.rs
  • crates/site-explorer/tests/integration/switch.rs
  • crates/host-support/src/hardware_enumeration/gpu.rs
  • crates/api-core/src/handlers/scout_stream.rs
  • crates/api-web/src/interface.rs
  • crates/api-core/src/tests/common/api_fixtures/dpu.rs
  • crates/agent/src/host_machine_id.rs
  • crates/api-model/src/instance/status/spx.rs
  • crates/api-core/src/tests/machine_network.rs
  • crates/api-core/src/machine_update_manager/mod.rs
  • crates/api-web/src/search.rs
  • crates/switch-controller/src/deleting.rs
  • crates/api-model/src/firmware.rs
  • crates/api-test-helper/src/vpc.rs
  • crates/admin-cli/src/machine/show/cmd.rs
  • crates/libnmxc/src/lib.rs
  • crates/machine-a-tron/src/api_throttler.rs
  • crates/rack-controller/src/discovering.rs
  • crates/machine-controller/src/handler/dpf.rs
  • crates/dpu-otel-agent/src/lib.rs
  • crates/api-db/src/expected_power_shelf.rs
  • crates/api-web/src/auth.rs
  • crates/api-web/src/lib.rs
  • crates/bmc-mock/src/tls.rs
  • crates/agent/src/agent_platform.rs
  • crates/api-db/src/dns/resource_record.rs
  • crates/mqttea/src/client/messages.rs
  • crates/http-connector/src/resolver.rs
  • crates/fmds/src/phone_home.rs
  • crates/api-core/src/handlers/firmware.rs
  • crates/api-core/src/run.rs
  • crates/site-explorer/src/explored_endpoint_index.rs
  • crates/machine-a-tron/src/vpc.rs
  • crates/dpa/src/lib.rs
  • crates/preingestion-manager/tests/integration/host_bmc_firmware.rs
  • crates/agent/src/mtu.rs
  • crates/rack-controller/src/error_state.rs
  • crates/api-core/src/handlers/dpu_remediation.rs
  • crates/api-core/tests/integration/machine_bmc_metadata.rs
  • crates/agent/src/ovs.rs
  • crates/state-controller/src/controller/processor.rs
  • crates/machine-a-tron/src/tui.rs
  • crates/bmc-mock/src/redfish/expander_router.rs
  • crates/rpc/src/errors.rs
  • crates/api-db/src/expected_switch.rs
  • crates/api-model/src/machine/spx.rs
  • crates/api-model/src/machine/nvlink.rs
  • crates/ib-partition-controller/src/handler.rs
  • crates/machine-controller/src/handler/bios_config.rs
  • crates/api-core/src/dynamic_settings.rs
  • crates/api-core/src/handlers/dns.rs
  • crates/api-db/src/instance.rs
  • crates/ssh-console-mock-api-server/src/lib.rs
  • crates/health/src/metrics.rs
  • crates/api-core/src/listener.rs
  • crates/api-test-helper/src/machine.rs
  • crates/machine-controller/src/handler/power.rs
  • crates/power-shelf-controller/src/deleting.rs
  • crates/switch-controller/src/created.rs
  • crates/agent/src/dhcp_server_grpc_client.rs
  • crates/rack-controller/src/created.rs
  • crates/agent/src/health/bgp.rs
  • crates/api-core/src/handlers/uefi.rs
  • crates/ssh-console/src/bmc/message_proxy.rs
  • crates/agent/src/extension_services/dpu_extension_service_observability.rs
  • crates/ssh-console/src/ssh_cert_parsing.rs
  • crates/api-core/src/mqtt_state_change_hook/hook.rs
  • crates/machine-a-tron/src/api_client.rs
  • crates/scout/src/register.rs
  • crates/machine-a-tron/src/subnet.rs
  • crates/fmds/src/nic_init.rs
  • crates/agent/src/tests/common/mod.rs
  • crates/secrets/src/local_credentials/file.rs
  • crates/api-db/src/carbide_version.rs
  • crates/host-support/src/hardware_enumeration/tpm.rs
  • crates/health/src/collectors/logs/periodic.rs
  • crates/ssh-console/tests/util/ipmi_sim.rs
  • crates/rack-controller/src/lib.rs
  • crates/kms-provider/src/providers/transit.rs
  • crates/mqttea/src/registry/core.rs
  • crates/api-core/src/attestation/measured_boot.rs
  • crates/dhcp-server/src/util.rs
  • crates/ssh-console/src/bmc/connection_impl/ipmi.rs
  • crates/libnmxm/src/lib.rs
  • crates/api-core/src/logging/setup.rs
  • crates/api-model/src/site_explorer/mod.rs
  • crates/libmlx/src/device/discovery.rs
  • crates/agent/src/dpu/link.rs
  • crates/dhcp-server/src/cache.rs
  • crates/agent/src/lib.rs
  • crates/api-core/src/handlers/machine_validation.rs
  • crates/rack-controller/src/handler.rs
  • crates/bmc-mock/src/combined_server.rs
  • crates/firmware/src/downloader.rs
  • crates/api-core/src/tests/common/api_fixtures/test_machine/mod.rs
  • crates/api-model/src/instance/status/nvlink.rs
  • crates/api-core/src/dhcp/discover.rs
  • crates/api-core/src/handlers/attestation.rs
  • crates/api-core/src/handlers/redfish.rs
  • crates/dhcp-server/src/grpc_server.rs
  • crates/ssh-console/src/metrics.rs
  • crates/bmc-explorer/src/chassis.rs
  • crates/metrics-utils/src/lib.rs
  • crates/api-db/src/machine_topology.rs
  • crates/agent/src/managed_files.rs
  • crates/spdm-controller/src/handler.rs
  • STYLE_GUIDE.md
  • crates/api-core/src/handlers/rack.rs
  • crates/api-core/src/handlers/expected_machine.rs
  • crates/agent/src/nvue.rs
  • crates/machine-a-tron/src/machine_utils.rs
  • crates/api-web/src/machine.rs
  • crates/api-core/src/measured_boot/metrics_collector/mod.rs
  • crates/api-core/src/handlers/finder.rs
  • crates/firmware/src/config.rs
  • crates/api-model/src/machine/mod.rs
  • crates/switch-controller/src/configuring.rs
  • crates/api-core/src/machine_update_manager/dpu_nic_firmware.rs
  • crates/host-support/src/registration.rs
  • crates/rack-controller/src/maintenance.rs
  • crates/bmc-proxy/src/setup.rs
  • crates/api-core/src/tests/common/api_fixtures/mod.rs
  • crates/fmds/src/http_request_metrics.rs
  • crates/api-core/src/handlers/bmc_endpoint_explorer.rs
  • crates/dns/src/lib.rs
  • crates/api-db/src/lib.rs
  • crates/site-explorer/src/switch_creator.rs
  • crates/health/src/discovery/spawn.rs
  • crates/api-core/src/tests/common/api_fixtures/site_explorer.rs
  • crates/api-db/src/vpc_dpu_loopback.rs
  • crates/scout/src/tpm.rs
  • crates/scout/src/attestation.rs
  • crates/ssh-console/src/config.rs
  • crates/dhcp-server/src/packet_handler.rs
  • crates/api-core/src/db_init.rs
  • crates/api-core/src/scout_stream.rs
  • crates/ssh-console/src/bmc/connection_impl/ssh.rs
  • crates/agent/src/containerd/image.rs
  • crates/api-core/src/ipxe.rs
  • crates/api-test-helper/src/subnet.rs
  • crates/api-core/src/tests/dns.rs
  • crates/site-explorer/src/machine_creator.rs
  • crates/bmc-mock/src/tar_router.rs
  • crates/machine-controller/src/handler/attestation.rs
  • crates/machine-a-tron/src/machine_state_machine.rs
  • crates/api-core/src/handlers/machine_scout.rs
  • crates/api-core/src/handlers/extension_service.rs
  • crates/site-explorer/tests/integration/site_explorer.rs
  • crates/dns/src/main.rs
  • crates/switch-controller/src/certificate.rs
  • crates/switch-controller/src/initializing.rs
  • crates/api-db/src/work_lock_manager.rs
  • crates/bmc-mock/src/combined_service.rs
  • crates/bmc-explorer/src/manager.rs
  • crates/machine-controller/src/handler/sku.rs
  • crates/agent/src/containerd/container.rs
  • crates/ssh-console/tests/util/mod.rs
  • crates/api-core/src/handlers/astra.rs
  • crates/agent/src/dpu/interface.rs
  • crates/host-support/src/hardware_enumeration/dpu.rs
  • crates/bmc-explorer/src/computer_system.rs
  • crates/dpu-remediation/src/remediation.rs
  • crates/api-core/src/machine_update_manager/host_firmware.rs
  • crates/bmc-mock/src/main.rs
  • crates/api-core/src/handlers/instance.rs
  • crates/machine-a-tron/src/mock_ssh_server.rs
  • crates/api-core/src/attestation/tpm_ca_cert.rs
  • crates/mqttea-example/src/main.rs
  • crates/agent/src/traffic_intercept_bridging.rs
  • crates/agent/src/upgrade.rs
  • crates/agent/src/tests/full.rs
  • crates/machine-controller/src/dpf.rs
  • crates/api-model/src/instance/status/network.rs
  • crates/api-core/src/handlers/instance_type.rs
  • crates/api-integration-tests/tests/lib.rs
  • crates/rack-controller/src/validating.rs
  • crates/api-core/src/tests/dpu_reprovisioning.rs
  • crates/agent/src/network_monitor.rs
  • crates/rpc/src/model/dpu_remediation.rs
  • crates/ssh-console/src/console_logger.rs
  • crates/agent/src/periodic_config_fetcher.rs
  • crates/machine-controller/src/handler/machine_validation.rs
  • crates/api-core/src/handlers/component_manager.rs
  • crates/dhcp-server/src/main.rs
  • crates/ssh-console/src/bmc/client.rs
  • crates/machine-a-tron/src/machine_a_tron.rs
  • crates/api-web/src/managed_host.rs
  • crates/api-db/src/bmc_metadata.rs
  • crates/api-db/src/machine.rs
  • crates/rpc/src/forge_tls_client.rs
  • crates/machine-a-tron/src/host_machine.rs
  • crates/agent/src/instrumentation.rs
  • crates/scout/src/stream.rs
  • crates/dns-record/src/lib.rs
  • crates/preingestion-manager/src/bfb_rshim_copier.rs
  • crates/api-core/src/tests/sku.rs
  • crates/rpc-utils/src/managed_host_display.rs
  • crates/site-explorer/src/redfish.rs
  • crates/machine-a-tron/src/main.rs
  • crates/api-db/src/machine_interface.rs
  • crates/machine-a-tron/src/dhcp_wrapper.rs
  • crates/api-core/src/instance/mod.rs
  • crates/scout/src/firmware_upgrade.rs
  • crates/bmc-proxy/src/bmc_proxy.rs
  • crates/dpa-manager/src/card_handler/astra.rs
  • crates/api-test-helper/src/instance.rs
  • crates/agent/src/hbn.rs
  • crates/api-core/src/handlers/svpc.rs
  • crates/agent/src/dpu/route.rs
  • crates/machine-validation/src/machine_validation.rs
  • crates/host-support/src/hardware_enumeration.rs
  • crates/http-connector/src/connector.rs
  • crates/agent/src/main_loop.rs
  • crates/dpf/src/sdk.rs
  • crates/api-core/src/handlers/api.rs
  • crates/api-core/src/handlers/machine.rs
  • crates/api-model/src/dpa_interface/mod.rs
  • crates/ib-fabric/src/lib.rs
  • crates/nvlink-manager/src/switch_cert_monitor.rs
  • crates/rack-controller/src/ready.rs
  • crates/scout/src/deprovision/scrabbing.rs
  • crates/mqttea/src/client/core.rs
  • crates/agent/src/astra_weave.rs
  • crates/agent/src/extension_services/k8s_pod_handler.rs
  • crates/secrets/src/forge_vault.rs
  • crates/agent/src/health.rs
  • crates/scout/src/main.rs
  • crates/api-core/src/setup.rs
  • crates/nvlink-manager/src/lib.rs
  • crates/scout/src/mlx_device.rs
  • crates/machine-controller/src/handler.rs
  • crates/site-explorer/src/lib.rs
  • crates/site-explorer/src/bmc_endpoint_explorer.rs
  • crates/preingestion-manager/src/lib.rs

Comment thread crates/api-core/src/dpa/handler.rs Outdated
Comment thread crates/api-core/src/dpa/handler.rs Outdated

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

Caution

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

⚠️ Outside diff range comments (3)
crates/host-support/src/registration.rs (1)

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

Log message text doesn't match the enclosing function.

Line 134's message reads "register_machine request", but this call is inside discover_machine_once, not register_machine. Given the PR's goal of stable, searchable messages, this mismatch will mislead log-based filtering/debugging for this function.

🩹 Proposed fix
         let request = tonic::Request::new(info);
-        tracing::debug!(?request, "register_machine request");
+        tracing::debug!(?request, "discover_machine request");
🤖 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/host-support/src/registration.rs` around lines 122 - 148, Update the
tracing::debug message in discover_machine_once to use discover_machine
terminology instead of register_machine, while preserving the existing request
field and logging behavior.
crates/nvlink-manager/src/lib.rs (1)

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

Include partition_nmx_c_id in the "NMX-C partition not found" logs.

All four None branches here (two in get_gpus_to_keep_after_removal, two in get_gpus_to_keep_in_unknown_partition_after_removal) log machine_id and device_instance but drop partition_nmx_c_id, even though it's in scope and is the actual key that failed the lookup. The sibling failure path in check_nv_link_partitions (the RemoveFromUnknownPartition else-branch) already includes partition_id for the exact same failure message — these four sites should match for consistent, useful diagnostics.

🔧 Proposed fix (one of the four sites shown; apply to all four)
                         None => {
                             tracing::error!(
                                 machine_id = %machine_id,
                                 device_instance,
+                                partition_id = partition_nmx_c_id.partition_id,
                                 "NMX-C partition not found for machine GPU",
                             );
                             return None;
                         }
As per path instructions, "Review Rust code against STYLE_GUIDE.md: ... structured tracing fields."

Also applies to: 579-633

🤖 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/nvlink-manager/src/lib.rs` around lines 514 - 571, Update all four
“NMX-C partition not found” tracing error calls in
get_gpus_to_keep_after_removal and
get_gpus_to_keep_in_unknown_partition_after_removal to include
partition_nmx_c_id as a structured tracing field, while preserving the existing
machine_id, device_instance, and error message.

Source: Path instructions

crates/preingestion-manager/src/lib.rs (1)

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

Carry address through the remaining early-exit logs in initiate_update.

Two sibling gaps in this exact function (multipart-not-supported / failed-to-open-firmware-file) were already fixed to include address = %endpoint_clone.address. Four more sites in the same function still omit it — resolving artifact / RSHIM failures across concurrently-processed endpoints will be hard to attribute without it:

  • artifact-resolution failure ("Failed to resolve firmware artifact")
  • download-deferred debug log ("Firmware artifact is being downloaded; update deferred")
  • missing-local-artifact error ("Firmware artifact is not present")
  • RSHIM-enable failure ("Failed to enable RSHIM on BMC")
🔧 Proposed fix
             Ok(artifact) => artifact,
             Err(error) => {
-                tracing::error!(%error, "Failed to resolve firmware artifact");
+                tracing::error!(
+                    address = %endpoint_clone.address,
+                    %error,
+                    "Failed to resolve firmware artifact"
+                );
                 return Ok(false);
             }
@@
                     if !self.downloader.available(&artifact.local_path, url, sha256) {
                         tracing::debug!(
+                            address = %endpoint_clone.address,
                             path = %artifact.local_path.display(),
                             %url,
                             "Firmware artifact is being downloaded; update deferred"
                         );
@@
                     if !artifact.local_path.exists() {
                         tracing::error!(
+                            address = %endpoint_clone.address,
                             path = %artifact.local_path.display(),
                             "Firmware artifact is not present"
                         );
@@
             redfish_client
                 .enable_rshim_bmc()
                 .await
-                .inspect_err(|e| tracing::error!(error = %e, "Failed to enable RSHIM on BMC"))
+                .inspect_err(|e| tracing::error!(address = %endpoint_clone.address, error = %e, "Failed to enable RSHIM on BMC"))
                 .ok();
🤖 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/preingestion-manager/src/lib.rs` around lines 3174 - 3256, Update the
four logging sites in initiate_update to include address =
%endpoint_clone.address: the “Failed to resolve firmware artifact” error,
“Firmware artifact is being downloaded; update deferred” debug message,
“Firmware artifact is not present” error, and “Failed to enable RSHIM on BMC”
error. Preserve their existing messages and behavior.
♻️ Duplicate comments (2)
crates/api-core/src/dpa/handler.rs (2)

151-153: 🗄️ Data Integrity & Integration | 🟡 Minor

Distinguish missing and duplicate SPX partitions.

partition.len() != 1 covers both zero and multiple matches, but the message says “not found”. Split the cases or include the count so duplicate database rows are not misclassified.

🤖 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/dpa/handler.rs` around lines 151 - 153, Update the
partition validation in the handler around the partition lookup to distinguish
zero matches from multiple matches: retain the “not found” error only when
partition.len() is zero, and add a separate error for duplicate matches that
includes the count, returning in both invalid cases.

61-66: 🎯 Functional Correctness | 🟡 Minor

Preserve the MAC parse error.

The changed event still logs only the token. Err(_e) discards the actual parsing failure, so malformed MQTT topics lose the reason. Bind the error and emit it as error = %error.

🤖 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/dpa/handler.rs` around lines 61 - 66, Update the DPA MAC
parsing error branch around the MQTT topic handler to bind the parse error
instead of discarding it. Include the bound error in the tracing::error! call
using the structured field error = %error, while retaining the existing
mac_address field and return behavior.
🧹 Nitpick comments (6)
crates/agent/src/dpu/interface.rs (1)

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

Use %interface for the interface-name field.

interface is a string value, so ?interface emits Debug formatting instead of the semantic string representation. Keep ?networks, but change this field to %interface.

As per coding guidelines, use %field for Display values and ?field for Debug values.

Proposed fix
- tracing::info!(?networks, ?interface, "Adding addresses to Interface");
+ tracing::info!(?networks, %interface, "Adding addresses to Interface");
🤖 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/agent/src/dpu/interface.rs` at line 70, Update the tracing call in the
interface address-addition flow to use Display formatting for the string
interface name: change the interface field in the log statement to %interface
while retaining ?networks.

Source: Coding guidelines

crates/agent/src/extension_services/dpu_extension_service_observability.rs (1)

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

Merge stdout/stderr into a single error! event instead of two. Both sites split one command-failure occurrence into two separate tracing::error! calls (one for stdout, one for stderr), doubling error-level log/alert volume per failure and splitting correlated data across two log lines.

  • crates/agent/src/extension_services/dpu_extension_service_observability.rs#L163-L173: combine the two tracing::error! calls into one, emitting both stdout and stderr fields together.
  • crates/agent/src/traffic_intercept_bridging.rs#L158-L168: same fix — combine into a single tracing::error! call with both stdout and stderr fields.
♻️ Proposed fix (apply to both sites)
-        tracing::error!(
-            command = cmd_str.as_str(),
-            stdout = %String::from_utf8_lossy(&out.stdout),
-            "OTel validation command stdout"
-        );
-        tracing::error!(
-            command = cmd_str.as_str(),
-            stderr = %String::from_utf8_lossy(&out.stderr),
-            "OTel validation command stderr"
-        );
+        tracing::error!(
+            command = cmd_str.as_str(),
+            stdout = %String::from_utf8_lossy(&out.stdout),
+            stderr = %String::from_utf8_lossy(&out.stderr),
+            "OTel validation command failed"
+        );
🤖 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/agent/src/extension_services/dpu_extension_service_observability.rs`
around lines 163 - 173, Merge the two command-failure tracing::error! calls into
one event that includes both stdout and stderr fields. Apply this in
crates/agent/src/extension_services/dpu_extension_service_observability.rs at
lines 163-173 and crates/agent/src/traffic_intercept_bridging.rs at lines
158-168, preserving the command field and existing failure message.
crates/rack-controller/src/created.rs (1)

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

Use tracing field shorthand for same-named counts.

Replace the redundant assignments with compute_count, switch_count, and power_shelf_count. This keeps the structured event concise and follows the repository’s tracing conventions.

As per coding guidelines: “Use native tracing field shorthand for tracing::Value types.”

🤖 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/rack-controller/src/created.rs` around lines 96 - 100, In the tracing
event in created.rs, update the fields for compute_count, switch_count, and
power_shelf_count to use native same-name shorthand instead of explicit
self-assignments. Leave the rack_id field and event message unchanged.

Source: Coding guidelines

crates/api-core/src/instance/mod.rs (1)

1427-1439: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Add table-driven coverage for duplicate SPX attachments.

The new guard rejects duplicate (device, device_instance) pairs. Add regression cases for both rejection and successful allocation of distinct attachments.

As per coding guidelines, Rust functions mapping inputs to outputs or errors should use table-driven tests.

🤖 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/instance/mod.rs` around lines 1427 - 1439, Add
table-driven tests for the duplicate-attachment validation in the instance
allocation flow containing cases for duplicate (device, device_instance) pairs
returning the expected InvalidArgument error and distinct attachments allocating
successfully. Reuse the existing instance allocation test helpers and assert
each case’s result, including the duplicate rejection and successful
distinct-attachment behavior.

Source: Coding guidelines

crates/ib-fabric/src/lib.rs (1)

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

Drop the manual write! loop; log the pkey lists as structured ? fields.

These three branches still hand-build a msg: String via a write! loop and attach it as a single details field, while down_ports = ?result.down_port_guids a few lines below achieves the same goal with a plain debug field on the underlying Vec. Passing ?result.missing_guid_pkeys (etc.) directly removes the loop, the write!().unwrap() calls, and produces a properly structured (queryable) field instead of a flattened string — consistent with this PR's own stated goal.

♻️ Proposed simplification (missing_guid_pkeys shown; same pattern applies to the other two)
     if !result.missing_guid_pkeys.is_empty() {
         metrics.num_machines_with_missing_pkeys += 1;
-        let mut msg = "Machine is missing pkeys on UFM: ".to_string();
-        for (idx, (_fabric, guid, pkey)) in result.missing_guid_pkeys.iter().enumerate() {
-            if idx != 0 {
-                msg.push(',');
-            }
-            write!(&mut msg, "(guid: {guid}, pkey: {pkey})").unwrap();
-        }
         tracing::warn!(
             machine_id = %machine_id,
-            details = %msg,
+            missing_guid_pkeys = ?result.missing_guid_pkeys,
             "Machine is missing pkeys on UFM",
         );
     }
As per path instructions, "Review Rust code against STYLE_GUIDE.md: ... structured tracing fields ... Prefer findings about behavior, concurrency, resource lifetimes, and missing tests over style-only comments." This one also removes an `unwrap()` call, so it's not purely stylistic.

Also applies to: 1097-1111, 1112-1127

🤖 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/ib-fabric/src/lib.rs` around lines 1082 - 1096, Replace the manual
message-building loops in the three missing-pkey logging branches with
structured debug fields on the underlying result vectors. Update the tracing
calls around missing_guid_pkeys and the corresponding branches at 1097-1111 and
1112-1127 to pass each list directly as a ? field, removing the String
construction, write! calls, and details field while preserving the existing
warning context and metrics updates.

Source: Path instructions

crates/machine-controller/src/handler.rs (1)

7867-7871: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Per-item INFO logging in a hot reconciliation path is likely too chatty for production.

"Found device for dpu", "Found device_instance for dpu", and "checking dpu" fire once per DPU, per instance, on every invocation of check_instance_network_synced_and_dpu_healthy — which itself runs on every WaitingForNetworkConfig/WaitingForConfigSynced reconciliation tick. At INFO level, fleets with many multi-DPU tenant instances will generate a steady stream of low-value log lines that mostly document internal bookkeeping rather than an operator-relevant event.

Recommend demoting these three to debug (or trace), consistent with how other purely-diagnostic per-iteration lines in this file (e.g., the BMC log scan at line 2226, or the "Found device for dpu"-style checks elsewhere) are kept at debug.

♻️ Suggested level change
-                    tracing::info!(
+                    tracing::debug!(
                         %device,
                         machine_id = %dpu_machine_id,
                         "Found device for dpu"
                     );
...
-                        tracing::info!(
+                        tracing::debug!(
                             device_instance,
                             machine_id = %dpu_machine_id,
                             "Found device_instance for dpu"
                         );
...
-            tracing::info!(machine_id = %dpu_id, "checking dpu");
+            tracing::debug!(machine_id = %dpu_id, "checking dpu");

Also applies to: 7877-7881, 7907-7907

🤖 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-controller/src/handler.rs` around lines 7867 - 7871, Demote
the per-item diagnostic logs in check_instance_network_synced_and_dpu_healthy
from INFO to DEBUG, specifically “Found device for dpu,” “Found device_instance
for dpu,” and “checking dpu.” Keep their messages and fields unchanged while
ensuring all three no longer emit at production INFO level.
🤖 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/agent/src/astra_weave.rs`:
- Around line 700-703: Update the Deleted mismatched virtual network attachment
log in the surrounding control flow to log match_attachment safely without
calling as_ref().unwrap(); reuse the existing Option-aware tracing field style
used by the sibling error branch, while preserving the current deletion
behavior.

In `@crates/agent/src/health/bgp.rs`:
- Line 76: Update the tracing warning event around the BGP daemon configuration
check to use a stable, human-readable message instead of the identifier-style
string. Preserve the existing error = %err field and provide wording that
clearly indicates reading the BGP daemon configuration failed.

In `@crates/agent/src/machine_inventory_updater.rs`:
- Line 137: Update the tracing in the machine inventory update flow to stop
serializing the complete inventory_report. Log only bounded metadata,
specifically the machine identifier and software/component count, while
preserving the existing trace event context.

In `@crates/agent/src/mtu.rs`:
- Around line 59-61: Preserve child-process output as rendered diagnostic
message content instead of logging it only as structured fields. In
crates/agent/src/mtu.rs lines 59-61 and 79-81, include the MTU query and update
stderr in the rendered diagnostics; in crates/agent/src/ovs.rs lines 47-55,
include both OVS stdout and stderr in rendered diagnostics while retaining
command as structured metadata.

In `@crates/api-core/src/dpa/handler.rs`:
- Around line 196-201: Update the error event in the machine lookup failure
branch to include the relevant DPA-interface context, using the existing dpa_if
or machine identifier as the adjacent not-found branch does, while preserving
the current error field and return behavior.

In `@crates/api-core/src/handlers/instance_type.rs`:
- Around line 597-603: Remove the dangling “ids; versions” fragment from the
tracing message in the length-mismatch error block. Keep the stable
human-readable message and the existing structured fields `ids` and
`machine_versions` unchanged.

In `@crates/api-db/src/work_lock_manager.rs`:
- Around line 303-308: Update the tracing::error! call handling the work-lock
release try_send failure to use a neutral human-readable message that does not
imply queue saturation or database overload. Preserve the structured work_key,
worker_id, and error fields while changing only the descriptive message.

In `@crates/dpu-remediation/src/remediation.rs`:
- Around line 239-242: Update the error logging in the remediation response
handling around next_remediation to remove the full response debug field. Log
only bounded presence flags and safe identifiers, such as whether the ID and
script are present, while preserving the existing skip-and-retry behavior.

In `@crates/ssh-console/src/ssh_cert_parsing.rs`:
- Around line 83-85: Remove the raw ?key_id field from both warning logs in
crates/ssh-console/src/ssh_cert_parsing.rs at lines 83-85 and 111-113. Retain
the role_field and user_field fields respectively, or replace key_id with a
non-reversible fingerprint in both diagnostics.

In `@crates/switch-controller/src/initializing.rs`:
- Around line 70-74: Update the tracing::info! message in the no-expected-switch
branch to describe the transition to SwitchControllerState::Error rather than
saying the controller is waiting. Preserve the existing switch_id and
bmc_mac_address fields and all state-transition behavior.

---

Outside diff comments:
In `@crates/host-support/src/registration.rs`:
- Around line 122-148: Update the tracing::debug message in
discover_machine_once to use discover_machine terminology instead of
register_machine, while preserving the existing request field and logging
behavior.

In `@crates/nvlink-manager/src/lib.rs`:
- Around line 514-571: Update all four “NMX-C partition not found” tracing error
calls in get_gpus_to_keep_after_removal and
get_gpus_to_keep_in_unknown_partition_after_removal to include
partition_nmx_c_id as a structured tracing field, while preserving the existing
machine_id, device_instance, and error message.

In `@crates/preingestion-manager/src/lib.rs`:
- Around line 3174-3256: Update the four logging sites in initiate_update to
include address = %endpoint_clone.address: the “Failed to resolve firmware
artifact” error, “Firmware artifact is being downloaded; update deferred” debug
message, “Firmware artifact is not present” error, and “Failed to enable RSHIM
on BMC” error. Preserve their existing messages and behavior.

---

Duplicate comments:
In `@crates/api-core/src/dpa/handler.rs`:
- Around line 151-153: Update the partition validation in the handler around the
partition lookup to distinguish zero matches from multiple matches: retain the
“not found” error only when partition.len() is zero, and add a separate error
for duplicate matches that includes the count, returning in both invalid cases.
- Around line 61-66: Update the DPA MAC parsing error branch around the MQTT
topic handler to bind the parse error instead of discarding it. Include the
bound error in the tracing::error! call using the structured field error =
%error, while retaining the existing mac_address field and return behavior.

---

Nitpick comments:
In `@crates/agent/src/dpu/interface.rs`:
- Line 70: Update the tracing call in the interface address-addition flow to use
Display formatting for the string interface name: change the interface field in
the log statement to %interface while retaining ?networks.

In `@crates/agent/src/extension_services/dpu_extension_service_observability.rs`:
- Around line 163-173: Merge the two command-failure tracing::error! calls into
one event that includes both stdout and stderr fields. Apply this in
crates/agent/src/extension_services/dpu_extension_service_observability.rs at
lines 163-173 and crates/agent/src/traffic_intercept_bridging.rs at lines
158-168, preserving the command field and existing failure message.

In `@crates/api-core/src/instance/mod.rs`:
- Around line 1427-1439: Add table-driven tests for the duplicate-attachment
validation in the instance allocation flow containing cases for duplicate
(device, device_instance) pairs returning the expected InvalidArgument error and
distinct attachments allocating successfully. Reuse the existing instance
allocation test helpers and assert each case’s result, including the duplicate
rejection and successful distinct-attachment behavior.

In `@crates/ib-fabric/src/lib.rs`:
- Around line 1082-1096: Replace the manual message-building loops in the three
missing-pkey logging branches with structured debug fields on the underlying
result vectors. Update the tracing calls around missing_guid_pkeys and the
corresponding branches at 1097-1111 and 1112-1127 to pass each list directly as
a ? field, removing the String construction, write! calls, and details field
while preserving the existing warning context and metrics updates.

In `@crates/machine-controller/src/handler.rs`:
- Around line 7867-7871: Demote the per-item diagnostic logs in
check_instance_network_synced_and_dpu_healthy from INFO to DEBUG, specifically
“Found device for dpu,” “Found device_instance for dpu,” and “checking dpu.”
Keep their messages and fields unchanged while ensuring all three no longer emit
at production INFO level.

In `@crates/rack-controller/src/created.rs`:
- Around line 96-100: In the tracing event in created.rs, update the fields for
compute_count, switch_count, and power_shelf_count to use native same-name
shorthand instead of explicit self-assignments. Leave the rack_id field and
event message unchanged.
🪄 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: 8243e9a1-9e73-48b7-9856-6f299da9715c

📥 Commits

Reviewing files that changed from the base of the PR and between c0952bb and b70b2ba.

📒 Files selected for processing (271)
  • STYLE_GUIDE.md
  • crates/admin-cli/src/machine/show/cmd.rs
  • crates/admin-cli/src/rpc.rs
  • crates/agent/src/agent_platform.rs
  • crates/agent/src/astra_weave.rs
  • crates/agent/src/containerd/container.rs
  • crates/agent/src/containerd/image.rs
  • crates/agent/src/dhcp_server_grpc_client.rs
  • crates/agent/src/dpu/interface.rs
  • crates/agent/src/dpu/link.rs
  • crates/agent/src/dpu/route.rs
  • crates/agent/src/ethernet_virtualization.rs
  • crates/agent/src/extension_services/dpu_extension_service_observability.rs
  • crates/agent/src/extension_services/k8s_pod_handler.rs
  • crates/agent/src/hbn.rs
  • crates/agent/src/health.rs
  • crates/agent/src/health/bgp.rs
  • crates/agent/src/host_machine_id.rs
  • crates/agent/src/instance_metadata_endpoint.rs
  • crates/agent/src/instrumentation.rs
  • crates/agent/src/lib.rs
  • crates/agent/src/machine_inventory_updater.rs
  • crates/agent/src/main_loop.rs
  • crates/agent/src/managed_files.rs
  • crates/agent/src/mtu.rs
  • crates/agent/src/netlink.rs
  • crates/agent/src/network_monitor.rs
  • crates/agent/src/nvue.rs
  • crates/agent/src/ovs.rs
  • crates/agent/src/periodic_config_fetcher.rs
  • crates/agent/src/tests/common/mod.rs
  • crates/agent/src/tests/full.rs
  • crates/agent/src/tests/test_network_monitor.rs
  • crates/agent/src/traffic_intercept_bridging.rs
  • crates/agent/src/upgrade.rs
  • crates/api-core/src/attestation/measured_boot.rs
  • crates/api-core/src/attestation/tpm_ca_cert.rs
  • crates/api-core/src/db_init.rs
  • crates/api-core/src/dhcp/discover.rs
  • crates/api-core/src/dpa/handler.rs
  • crates/api-core/src/dynamic_settings.rs
  • crates/api-core/src/handlers/api.rs
  • crates/api-core/src/handlers/astra.rs
  • crates/api-core/src/handlers/attestation.rs
  • crates/api-core/src/handlers/bmc_endpoint_explorer.rs
  • crates/api-core/src/handlers/component_manager.rs
  • crates/api-core/src/handlers/dns.rs
  • crates/api-core/src/handlers/dpu_remediation.rs
  • crates/api-core/src/handlers/expected_machine.rs
  • crates/api-core/src/handlers/extension_service.rs
  • crates/api-core/src/handlers/finder.rs
  • crates/api-core/src/handlers/firmware.rs
  • crates/api-core/src/handlers/instance.rs
  • crates/api-core/src/handlers/instance_type.rs
  • crates/api-core/src/handlers/machine.rs
  • crates/api-core/src/handlers/machine_discovery.rs
  • crates/api-core/src/handlers/machine_scout.rs
  • crates/api-core/src/handlers/machine_validation.rs
  • crates/api-core/src/handlers/rack.rs
  • crates/api-core/src/handlers/redfish.rs
  • crates/api-core/src/handlers/scout_stream.rs
  • crates/api-core/src/handlers/site_explorer.rs
  • crates/api-core/src/handlers/svpc.rs
  • crates/api-core/src/handlers/uefi.rs
  • crates/api-core/src/instance/mod.rs
  • crates/api-core/src/ipxe.rs
  • crates/api-core/src/listener.rs
  • crates/api-core/src/logging/setup.rs
  • crates/api-core/src/machine_update_manager/dpu_nic_firmware.rs
  • crates/api-core/src/machine_update_manager/host_firmware.rs
  • crates/api-core/src/machine_update_manager/mod.rs
  • crates/api-core/src/machine_validation/mod.rs
  • crates/api-core/src/measured_boot/metrics_collector/mod.rs
  • crates/api-core/src/mqtt_state_change_hook/hook.rs
  • crates/api-core/src/run.rs
  • crates/api-core/src/scout_stream.rs
  • crates/api-core/src/setup.rs
  • crates/api-core/src/tests/common/api_fixtures/dpu.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/common/api_fixtures/test_machine/mod.rs
  • crates/api-core/src/tests/dns.rs
  • crates/api-core/src/tests/dpu_reprovisioning.rs
  • crates/api-core/src/tests/instance.rs
  • crates/api-core/src/tests/machine_network.rs
  • crates/api-core/src/tests/sku.rs
  • crates/api-core/tests/integration/machine_bmc_metadata.rs
  • crates/api-db/src/bmc_metadata.rs
  • crates/api-db/src/carbide_version.rs
  • crates/api-db/src/dns/resource_record.rs
  • crates/api-db/src/expected_power_shelf.rs
  • crates/api-db/src/expected_switch.rs
  • crates/api-db/src/instance.rs
  • crates/api-db/src/lib.rs
  • crates/api-db/src/machine.rs
  • crates/api-db/src/machine_interface.rs
  • crates/api-db/src/machine_topology.rs
  • crates/api-db/src/measured_boot/bundle.rs
  • crates/api-db/src/vpc_dpu_loopback.rs
  • crates/api-db/src/work_lock_manager.rs
  • crates/api-integration-tests/tests/lib.rs
  • crates/api-model/src/dpa_interface/mod.rs
  • crates/api-model/src/firmware.rs
  • crates/api-model/src/instance/status/network.rs
  • crates/api-model/src/instance/status/nvlink.rs
  • crates/api-model/src/instance/status/spx.rs
  • crates/api-model/src/machine/mod.rs
  • crates/api-model/src/machine/nvlink.rs
  • crates/api-model/src/machine/spx.rs
  • crates/api-model/src/site_explorer/mod.rs
  • crates/api-test-helper/src/domain.rs
  • crates/api-test-helper/src/instance.rs
  • crates/api-test-helper/src/machine.rs
  • crates/api-test-helper/src/machine_a_tron.rs
  • crates/api-test-helper/src/subnet.rs
  • crates/api-test-helper/src/tenant.rs
  • crates/api-test-helper/src/vpc.rs
  • crates/api-test-helper/src/vpc_prefix.rs
  • crates/api-web/src/auth.rs
  • crates/api-web/src/interface.rs
  • crates/api-web/src/lib.rs
  • crates/api-web/src/machine.rs
  • crates/api-web/src/managed_host.rs
  • crates/api-web/src/search.rs
  • crates/bmc-explorer/src/chassis.rs
  • crates/bmc-explorer/src/computer_system.rs
  • crates/bmc-explorer/src/manager.rs
  • crates/bmc-mock/src/combined_server.rs
  • crates/bmc-mock/src/combined_service.rs
  • crates/bmc-mock/src/main.rs
  • crates/bmc-mock/src/redfish/expander_router.rs
  • crates/bmc-mock/src/tar_router.rs
  • crates/bmc-mock/src/tls.rs
  • crates/bmc-proxy/src/bmc_proxy.rs
  • crates/bmc-proxy/src/setup.rs
  • crates/dhcp-server/src/cache.rs
  • crates/dhcp-server/src/grpc_server.rs
  • crates/dhcp-server/src/main.rs
  • crates/dhcp-server/src/modes/controller.rs
  • crates/dhcp-server/src/packet_handler.rs
  • crates/dhcp-server/src/util.rs
  • crates/dns-record/src/lib.rs
  • crates/dns/src/lib.rs
  • crates/dns/src/main.rs
  • crates/dpa-manager/src/card_handler/astra.rs
  • crates/dpa-manager/src/card_handler/svpc.rs
  • crates/dpa-manager/src/lib.rs
  • crates/dpa/src/lib.rs
  • crates/dpf/src/sdk.rs
  • crates/dpu-otel-agent/src/lib.rs
  • crates/dpu-remediation/src/remediation.rs
  • crates/dsx-exchange-consumer/src/api_client.rs
  • crates/firmware/src/config.rs
  • crates/firmware/src/downloader.rs
  • crates/fmds/src/http_request_metrics.rs
  • crates/fmds/src/main.rs
  • crates/fmds/src/nic_init.rs
  • crates/fmds/src/phone_home.rs
  • crates/health/src/api_client.rs
  • crates/health/src/collectors/logs/periodic.rs
  • crates/health/src/discovery/cleanup.rs
  • crates/health/src/discovery/context.rs
  • crates/health/src/discovery/spawn.rs
  • crates/health/src/metrics.rs
  • crates/host-support/src/hardware_enumeration.rs
  • crates/host-support/src/hardware_enumeration/dpu.rs
  • crates/host-support/src/hardware_enumeration/gpu.rs
  • crates/host-support/src/hardware_enumeration/tpm.rs
  • crates/host-support/src/registration.rs
  • crates/http-connector/src/connector.rs
  • crates/http-connector/src/resolver.rs
  • crates/ib-fabric/src/lib.rs
  • crates/ib-partition-controller/src/handler.rs
  • crates/ipmi/src/tool.rs
  • crates/kms-provider/src/providers/transit.rs
  • crates/libmlx/src/device/discovery.rs
  • crates/libnmxc/src/lib.rs
  • crates/libnmxm/src/lib.rs
  • crates/machine-a-tron/src/api_client.rs
  • crates/machine-a-tron/src/api_throttler.rs
  • crates/machine-a-tron/src/bmc_mock_wrapper.rs
  • crates/machine-a-tron/src/dhcp_wrapper.rs
  • crates/machine-a-tron/src/host_machine.rs
  • crates/machine-a-tron/src/machine_a_tron.rs
  • crates/machine-a-tron/src/machine_state_machine.rs
  • crates/machine-a-tron/src/machine_utils.rs
  • crates/machine-a-tron/src/main.rs
  • crates/machine-a-tron/src/mock_ssh_server.rs
  • crates/machine-a-tron/src/subnet.rs
  • crates/machine-a-tron/src/tui.rs
  • crates/machine-a-tron/src/vpc.rs
  • crates/machine-controller/src/dpf.rs
  • crates/machine-controller/src/handler.rs
  • crates/machine-controller/src/handler/attestation.rs
  • crates/machine-controller/src/handler/bios_config.rs
  • crates/machine-controller/src/handler/dpf.rs
  • crates/machine-controller/src/handler/machine_validation.rs
  • crates/machine-controller/src/handler/power.rs
  • crates/machine-controller/src/handler/sku.rs
  • crates/machine-validation/src/machine_validation.rs
  • crates/metrics-endpoint/src/lib.rs
  • crates/metrics-utils/src/lib.rs
  • crates/mqttea-example/src/main.rs
  • crates/mqttea/src/client/core.rs
  • crates/mqttea/src/client/messages.rs
  • crates/mqttea/src/registry/core.rs
  • crates/nvlink-manager/src/lib.rs
  • crates/nvlink-manager/src/switch_cert_monitor.rs
  • crates/power-shelf-controller/src/configuring.rs
  • crates/power-shelf-controller/src/deleting.rs
  • crates/power-shelf-controller/src/fetching_data.rs
  • crates/power-shelf-controller/src/initializing.rs
  • crates/preingestion-manager/src/bfb_rshim_copier.rs
  • crates/preingestion-manager/src/lib.rs
  • crates/preingestion-manager/tests/integration/host_bmc_firmware.rs
  • crates/rack-controller/src/created.rs
  • crates/rack-controller/src/discovering.rs
  • crates/rack-controller/src/error_state.rs
  • crates/rack-controller/src/handler.rs
  • crates/rack-controller/src/lib.rs
  • crates/rack-controller/src/maintenance.rs
  • crates/rack-controller/src/ready.rs
  • crates/rack-controller/src/validating.rs
  • crates/rpc-utils/src/managed_host_display.rs
  • crates/rpc/src/errors.rs
  • crates/rpc/src/forge_tls_client.rs
  • crates/rpc/src/model/dpu_remediation.rs
  • crates/scout/src/attestation.rs
  • crates/scout/src/deprovision/scrabbing.rs
  • crates/scout/src/firmware_upgrade.rs
  • crates/scout/src/main.rs
  • crates/scout/src/mlx_device.rs
  • crates/scout/src/register.rs
  • crates/scout/src/stream.rs
  • crates/scout/src/tpm.rs
  • crates/secrets/src/forge_vault.rs
  • crates/secrets/src/local_credentials/file.rs
  • crates/site-explorer/src/bmc_endpoint_explorer.rs
  • crates/site-explorer/src/explored_endpoint_index.rs
  • crates/site-explorer/src/lib.rs
  • crates/site-explorer/src/machine_creator.rs
  • crates/site-explorer/src/redfish.rs
  • crates/site-explorer/src/switch_creator.rs
  • crates/site-explorer/src/test_support/mock_endpoint_explorer.rs
  • crates/site-explorer/tests/integration/power_shelf.rs
  • crates/site-explorer/tests/integration/site_explorer.rs
  • crates/site-explorer/tests/integration/switch.rs
  • crates/spdm-controller/src/handler.rs
  • crates/ssh-console-mock-api-server/src/lib.rs
  • crates/ssh-console/src/bmc/client.rs
  • crates/ssh-console/src/bmc/connection.rs
  • crates/ssh-console/src/bmc/connection_impl/ipmi.rs
  • crates/ssh-console/src/bmc/connection_impl/ssh.rs
  • crates/ssh-console/src/bmc/message_proxy.rs
  • crates/ssh-console/src/config.rs
  • crates/ssh-console/src/console_logger.rs
  • crates/ssh-console/src/frontend.rs
  • crates/ssh-console/src/metrics.rs
  • crates/ssh-console/src/ssh_cert_parsing.rs
  • crates/ssh-console/src/ssh_server.rs
  • crates/ssh-console/tests/util/ipmi_sim.rs
  • crates/ssh-console/tests/util/mod.rs
  • crates/state-controller/src/controller/processor.rs
  • crates/switch-controller/src/certificate.rs
  • crates/switch-controller/src/configuring.rs
  • crates/switch-controller/src/created.rs
  • crates/switch-controller/src/deleting.rs
  • crates/switch-controller/src/error_state.rs
  • crates/switch-controller/src/initializing.rs
  • crates/switch-controller/src/ready.rs
  • crates/switch-controller/src/validating.rs
💤 Files with no reviewable changes (1)
  • crates/health/src/discovery/context.rs

Comment thread crates/agent/src/astra_weave.rs
Comment thread crates/agent/src/health/bgp.rs Outdated
Comment thread crates/agent/src/machine_inventory_updater.rs Outdated
Comment thread crates/agent/src/mtu.rs Outdated
Comment thread crates/api-core/src/dpa/handler.rs
Comment thread crates/api-core/src/handlers/instance_type.rs
Comment thread crates/api-db/src/work_lock_manager.rs
Comment thread crates/dpu-remediation/src/remediation.rs
Comment thread crates/ssh-console/src/ssh_cert_parsing.rs
Comment thread crates/switch-controller/src/initializing.rs
@chet chet force-pushed the gh-issue-3476 branch 2 times, most recently from 15bab2c to 86829a2 Compare July 14, 2026 12:18
@chet

chet commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

Final review consolidation is in 86829a2:

  • Addressed all eight inline findings plus the applicable outside-diff and nitpick suggestions, including child-process rendering, sensitive payload reduction, missing correlation fields, and structured pkey lists.
  • Kept the MQTT backoff as an ordinary structured warning because a new metric name/type is a separate instrumentation design decision.
  • Did not add tests for the pre-existing duplicate-SPX guard or change pre-existing machine-controller log levels; this refactor intentionally preserves behavior and trace levels.
  • Revalidated nightly formatting, full Clippy, Carbide lints, a nine-library regression set, the 70-item intentional residual audit, and a no-findings local CodeRabbit review of the complete 17-file delta.

@coderabbitai full_review, thanks!

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

@chet, thank you for the consolidation pass. Acknowledged:

  • All eight inline findings plus applicable outside-diff and nitpick suggestions (child-process rendering, sensitive payload reduction, missing correlation fields, structured pkey lists) addressed in commit 86829a2bb.
  • MQTT backoff intentionally kept as an ordinary structured warning, consistent with the earlier agreement that dedicated metrics/telemetry semantics are a separate design decision.
  • No tests added for the pre-existing duplicate-SPX guard, and no changes to pre-existing machine-controller log levels — both correctly out of scope for a refactor meant to preserve behavior and trace levels.
  • Clean revalidation: nightly formatting, full Clippy, Carbide lints, the nine-library regression set, the 70-item intentional residual audit, and a no-findings local CodeRabbit review of the complete 17-file delta.

Kicking off the full review now to verify the final delta.

(=^・ω・^=)


✏️ Learnings added
Learnt from: chet
URL: https://github.com/NVIDIA/infra-controller/pull/3479

Timestamp: 2026-07-14T12:19:41.324Z
Learning: Learnt from: chet
Repo: NVIDIA/infra-controller
PR: `#3479`
In this structured-logging refactor PR, a pre-existing duplicate-SPX guard was intentionally left without new tests, and pre-existing machine-controller log levels (trace levels) were intentionally left unchanged. The refactor's scope is to convert log messages to structured fields while preserving existing behavior and trace levels, so these should not be flagged as gaps introduced by this PR.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

✅ Action performed

Full review finished.

@copy-pr-bot

copy-pr-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown

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

Contributors can view more details about this message here.

@chet chet marked this pull request as ready for review July 14, 2026 17:56
@github-actions

Copy link
Copy Markdown

@chet

chet commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

Final main rebase is in 603a407:

  • Cleanly rebased onto 4cea557; range-diff confirms the structured-logging patch is unchanged.
  • Preserved the overlapping upstream health LogService exclusion work; all 407 health tests and the health all-target/all-feature Clippy check pass.
  • Full workspace Clippy, Carbide lints, nightly formatting, focused regression suites, and local review passes are green.
  • All 45 existing review threads remain resolved.

@coderabbitai full_review, thanks!

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

@chet, thank you for the update. Acknowledged:

  • Clean rebase onto 4cea55762 with range-diff confirming the structured-logging patch is unchanged.
  • Health LogService exclusion work preserved, with all 407 health tests and the health all-target/all-feature Clippy check passing.
  • Full workspace Clippy, Carbide lints, nightly formatting, focused regression suites, and local review passes green.
  • All 45 existing review threads remain resolved.

Kicking off the full review now to verify the rebased delta.

(=^・ω・^=)

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

Caution

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

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

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

Inconsistent field name for the same "attempt count" value within one function.

At line 2181 the retry-branch logs the same attempts_done variable as attempt = attempts_done, but the terminal-failure branch a few lines later (line 2200) logs it as attempts = attempts_done. Two consecutive branches of time_sync_resets, same variable, two different field keys — this splits what should be one searchable field into two in log tooling. The rest of the file (lines 1567, 1586, 1796, 1816) consistently uses the singular attempt, so line 2200 is the outlier.

As per coding guidelines, dynamic values should use "consistent semantic field names rather than incidental local variable names."

🔧 Proposed fix
                         tracing::error!(
                             address = %endpoint.address,
-                            attempts = attempts_done,
+                            attempt = attempts_done,
                             max_attempts = MAX_TIME_SYNC_RESET_ATTEMPTS,
                             "BMC time is still out of sync after reset attempts; failing preingestion"
                         );
🤖 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/preingestion-manager/src/lib.rs` around lines 2172 - 2203, Use the
same singular tracing field name for the attempt count in the terminal-failure
branch of time_sync_resets: change the attempts field in the error log to
attempt while continuing to log attempts_done as its value.

Source: Coding guidelines

🧹 Nitpick comments (9)
crates/rpc-utils/src/managed_host_display.rs (1)

66-73: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Prefer Display for this error field. Use error = %e instead of ?e here; tonic::Status implements Display, and this keeps the log output consistent with the other error fields in this file.

🤖 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-utils/src/managed_host_display.rs` around lines 66 - 73, Update
the error field in the site exploration report handling within the site
exploration report retrieval flow to use Display formatting (`%e`) instead of
Debug formatting (`?e`) in the warn! call, matching the file’s existing error
logging style.

Source: Coding guidelines

crates/agent/src/traffic_intercept_bridging.rs (1)

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

Use native tracing formatting for the error field.

error = format!("{err:#}") eagerly allocates and flattens the error before the subscriber formats it. Prefer error = %err; use ?err only if Debug-chain output is intentionally required. As per coding guidelines, errors should use semantic structured formatting such as error = %e.

Proposed fix
 tracing::error!(
-    error = format!("{err:#}"),
+    error = %err,
     "update_intercept_bridging command failed"
 );
🤖 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/agent/src/traffic_intercept_bridging.rs` around lines 101 - 104,
Update the error field in the tracing call within the update_intercept_bridging
failure path to use native semantic formatting (`%err`) instead of eagerly
allocating with format!. Preserve the existing error message and failure
handling.

Source: Coding guidelines

crates/agent/src/machine_inventory_updater.rs (1)

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

Use human-readable tracing messages.

"update_machine_inventory" and "update_agent_reported_inventory response" expose Rust/RPC identifier spelling instead of operator-facing prose. Prefer messages such as "Updating machine inventory" and "Received agent-reported inventory update response".

As per coding guidelines, tracing messages must be stable human-readable literals.

Also applies to: 150-150

🤖 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/agent/src/machine_inventory_updater.rs` at line 144, Update the
tracing message literals in the update_machine_inventory flow, including the
messages at the referenced locations, to use stable human-readable prose.
Replace the Rust/RPC identifier-style text with operator-facing messages such as
“Updating machine inventory” and “Received agent-reported inventory update
response,” while leaving the surrounding tracing behavior unchanged.

Source: Coding guidelines

crates/agent/src/main_loop.rs (1)

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

Avoid pre-formatting errors into String fields.

These sites allocate with format!("{...:#}") before tracing and discard the error's native structured formatting. Use error = %e/error = %err for ordinary error fields; retain alternate formatting only as an explicit, documented exception.

As per coding guidelines, errors should be recorded through structured Display/Debug fields rather than pre-rendered strings.

Also applies to: 173-173, 188-191, 200-203, 583-586, 736-739

🤖 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/agent/src/main_loop.rs` around lines 158 - 160, Replace the
preformatted format!("{e:#}") and equivalent error fields in the affected
main-loop tracing calls with tracing’s native structured Display formatting,
using error = %e or error = %err as appropriate. Update all listed sites,
including the warning around the external FMDS fallback and the corresponding
error logs, without changing their messages or control flow.

Source: Coding guidelines

crates/api-core/src/tests/sku.rs (1)

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

Use descriptive event messages for SKU snapshots.

"SKU1" and "SKU2" are too ambiguous in aggregated logs. Use messages that identify the snapshot, such as "Original SKU before mismatch" and "Broken SKU after mismatch".

As per coding guidelines, tracing messages must be stable, human-readable literals that describe the event.

🤖 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/tests/sku.rs` around lines 1300 - 1314, Replace the
ambiguous tracing event messages in the original_sku and broken_sku snapshot
logs with stable, descriptive human-readable literals identifying each snapshot,
such as the original SKU before mismatch and broken SKU after mismatch. Keep the
existing structured fields unchanged.

Source: Coding guidelines

crates/site-explorer/src/switch_creator.rs (1)

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

Align the new bmc_ip_address field with the existing bmc_ip field name/format.

This newly added field logs the same value (explored_managed_switch.bmc_ip) that's already logged a few lines above as bmc_ip = %explored_managed_switch.bmc_ip (L55). Using a different key (bmc_ip_address) and a different formatter (? instead of %) for the identical field in the same file undermines the searchability goal of this migration.

♻️ Proposed fix
                 Err(error) => {
                     tracing::error!(
                         %error,
-                        bmc_ip_address = ?explored_managed_switch.bmc_ip,
+                        bmc_ip = %explored_managed_switch.bmc_ip,
                         "Failed to create managed switch"
                     );
                 }
🤖 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/switch_creator.rs` around lines 78 - 84, Update the
tracing::error! call in the Err(error) branch to log
explored_managed_switch.bmc_ip using the existing bmc_ip key and % formatter,
matching the earlier log statement; remove the bmc_ip_address key and ?
formatter.
crates/site-explorer/tests/integration/power_shelf.rs (1)

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

Extract the repeated "DHCP assigned ip" log block into a helper.

The identical 3-field structured log call (mac_address, ip_address, "DHCP assigned ip") appears verbatim in 8 test functions in this file. A small helper, e.g. fn log_dhcp_assignment(mac: &MacAddress, ip: &str), would remove the duplication and centralize the field convention for future changes.

♻️ Proposed helper
fn log_dhcp_assignment(mac_address: &MacAddress, ip_address: &str) {
    tracing::info!(%mac_address, %ip_address, "DHCP assigned ip");
}

Then replace each of the 8 call sites with log_dhcp_assignment(&power_shelf.bmc_mac_address, &response.address);.

Also applies to: 473-477, 582-586, 692-696, 796-800, 894-898, 1067-1071, 1521-1525

🤖 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/power_shelf.rs` around lines 113 -
117, Extract the repeated structured “DHCP assigned ip” logging from the
affected test functions into a shared log_dhcp_assignment helper accepting
MacAddress and IP string references, preserving the existing mac_address and
ip_address fields and message. Replace all eight identical tracing::info! call
sites, including those in the listed test flows, with the helper using
power_shelf.bmc_mac_address and response.address.
crates/scout/src/main.rs (1)

190-202: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Use %e for these error fields to match the file’s logging convention.

Both error branches here should log error = %e instead of error = ?e; the error type is Display-backed, and this file already uses %e consistently for error fields.

🤖 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/scout/src/main.rs` around lines 190 - 202, Update both error branches
in the PublishMlxDeviceReport request flow to log the captured error with
Display formatting by changing the error fields in the create and publish
failure tracing calls from debug formatting to `%e`, preserving their existing
messages and behavior.

Source: Learnings

crates/machine-controller/src/handler.rs (1)

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

Inconsistent field name for DPU MachineId: dpu_id vs machine_id.

Within this same diff hunk, new logs alternate between dpu_id = %dpu.id (Lines 7249, 7569, 7578) and machine_id = %dpu_id (Line 7608) for the identical semantic value — a DPU's MachineId. As per coding guidelines, "Use consistent semantic field names rather than incidental local variable names." Pick one key (the file overwhelmingly uses machine_id elsewhere, including for DPUs) so cross-log queries stay uniform.

Also applies to: 7568-7580, 7601-7608

🤖 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-controller/src/handler.rs` around lines 7249 - 7252, Use the
consistent machine_id field name for all newly added DPU MachineId tracing
fields, including the logs around the use_admin_network_changed flag and the
corresponding entries near machine_id = %dpu_id. Replace dpu_id keys that log
the same semantic DPU identifier while preserving the existing identifier values
and messages.

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/agent/src/health.rs`:
- Around line 325-330: Update the tracing messages in the check_ifreload and
check_files paths to use stable, descriptive operator-facing text: replace the
check_ifreload labels with “ifreload syntax check failed” and replace
“check_files: Too small” with “file is too small,” preserving all existing
structured fields.

In `@crates/agent/src/mtu.rs`:
- Around line 59-61: Update both MTU command failure paths in the query and
update flows to append the raw child-process stderr to the rendered log message
payload, while keeping command as a structured field. Do not rely on the
structured stderr field alone; preserve the existing operator-visible multiline
output for both failures.

In `@crates/agent/src/ovs.rs`:
- Around line 47-51: Update the OVS command failure logging around the existing
tracing::error! call to keep command structured while rendering stdout and
stderr as part of the message payload, preserving their multiline and escaping
behavior. Do not emit the process streams as structured fields; retain the
existing "OVS command failed" context and use the output values directly in the
rendered log message.

In `@crates/api-core/src/handlers/astra.rs`:
- Around line 265-267: Update the error fields in both Astra
acknowledgment-config parsing log sites to use Display formatting (`%e`) instead
of Debug formatting (`?e`). Apply this to the `ConfigVersionParseError` and
`DatabaseError` log entries while preserving their existing messages and fields.

In `@crates/api-core/src/handlers/finder.rs`:
- Around line 518-520: Standardize the tracing fields in the by_mac logging
paths, updating the existing machine-interface error log near the
interface_count entry to use mac_address for the MAC value and error for the
error value, matching the new branch. Preserve the surrounding messages and
behavior.

In `@crates/api-core/src/handlers/instance_type.rs`:
- Line 601: Update the stable tracing message in the instance update handler to
use grammatically precise, human-readable wording such as “Not all machine
associations were updated,” while preserving the existing error context and
message behavior.

In `@crates/api-model/src/instance/status/network.rs`:
- Around line 292-297: Update the missing-DPU collection and logging near the
`missing_dpus` check so sentinel `None` values are not recorded as identifiers.
In the `None` branch that populates `missing_dpus`, collect the actual
configured/device `MachineId` when available, or rename `missing_dpu_ids` to
accurately describe the stored values; ensure the log never labels `[None, ...]`
as DPU IDs.

In `@crates/api-test-helper/src/machine.rs`:
- Line 66: Update the tracing::info! call that logs the current state to use the
stable literal "Current" instead of "\tCurrent", leaving the existing state
field unchanged.

In `@crates/dpa-manager/src/card_handler/astra.rs`:
- Around line 128-129: Update the unexpected-state warning events in the Astra
DPA handler to retain the existing controller state as a structured logging
field alongside dpa_interface.id. Apply this consistently to the warning sites
around lines 128, 160, 190, and 220, without removing or converting the dynamic
state value into message text.

In `@crates/host-support/src/hardware_enumeration.rs`:
- Around line 417-425: Update the NIC enumeration log in the loop over devices
to emit the sysfs path under the consistent `syspath` field name, rather than
relying on the local `sys_path` variable name via shorthand. Preserve the
existing debug message and path value.

In `@crates/host-support/src/registration.rs`:
- Line 112: Use Display formatting for the error fields at both affected call
sites: update the TLS-client error log in
crates/host-support/src/registration.rs (lines 112-112) and the connection error
log in crates/http-connector/src/connector.rs (lines 219-219) from debug
formatting to Display formatting with %e, preserving the existing log messages
and context.

In `@crates/machine-a-tron/src/tui.rs`:
- Around line 465-468: Update the error field in the tracing::warn! invocation
handling Some(Err(e)) to use Display formatting (`%e`) instead of Debug
formatting (`?e`), matching the workspace logging convention while preserving
the existing warning message.

In `@crates/machine-controller/src/handler.rs`:
- Around line 9645-9654: Update the logging statements in
host_new_firmware_reported_wait for the “Not all firmware versions match”
warning and the “resetting again” info branch to include the available
machine_id field, matching the other logs in the function; leave the existing
address and firmware details unchanged.
- Around line 9336-9337: Update the 404-recovery log in host_waiting_fw for the
missing-task completion branch to include the in-scope machine_id field
alongside endpoint.address, matching the sibling longer-wait branch’s structured
logging.
- Around line 8644-8706: Change the cmd.wait() Err branch in the upgrade-script
task to use tracing::error! instead of tracing::info!, while preserving the
existing machine_id, address, error, message, and completion-state handling.
- Around line 3884-3888: Update the failure log in the EnableRshim branch of
handle_dpu_discovering_state to include the in-scope dpu_machine_id alongside
the existing error field, matching the identifier context used by nearby logs.
- Around line 2557-2568: Update the tracing::info call in the
Some(TaskState::Completed) branch of the task.task_state match to include the
existing machine_id and task_id fields alongside bmc_address, preserving the
"Install BFB completed" message.

In `@crates/machine-controller/src/handler/sku.rs`:
- Line 129: Update the “No expected machine for bmc” debug log in
generate_missing_sku_for_machine to include the available machine_id field
alongside bmc_mac_address, preserving the existing message and log level.

In `@crates/machine-validation/src/machine_validation.rs`:
- Around line 365-373: Update the success and failure logging in pull_container
to include the same image_name identifying field in both branches, while
preserving stdout on success and error on failure. Apply the same symmetry in
run by ensuring both branches log test_name, retaining each branch’s existing
result-specific fields.

In `@crates/preingestion-manager/src/lib.rs`:
- Around line 3253-3268: Update the “Using simple update for firmware upload”
debug log in the BFB artifact branch of initiate_update to include the
structured address field using endpoint_clone.address, matching the correlation
fields on the surrounding logs.

---

Outside diff comments:
In `@crates/preingestion-manager/src/lib.rs`:
- Around line 2172-2203: Use the same singular tracing field name for the
attempt count in the terminal-failure branch of time_sync_resets: change the
attempts field in the error log to attempt while continuing to log attempts_done
as its value.

---

Nitpick comments:
In `@crates/agent/src/machine_inventory_updater.rs`:
- Line 144: Update the tracing message literals in the update_machine_inventory
flow, including the messages at the referenced locations, to use stable
human-readable prose. Replace the Rust/RPC identifier-style text with
operator-facing messages such as “Updating machine inventory” and “Received
agent-reported inventory update response,” while leaving the surrounding tracing
behavior unchanged.

In `@crates/agent/src/main_loop.rs`:
- Around line 158-160: Replace the preformatted format!("{e:#}") and equivalent
error fields in the affected main-loop tracing calls with tracing’s native
structured Display formatting, using error = %e or error = %err as appropriate.
Update all listed sites, including the warning around the external FMDS fallback
and the corresponding error logs, without changing their messages or control
flow.

In `@crates/agent/src/traffic_intercept_bridging.rs`:
- Around line 101-104: Update the error field in the tracing call within the
update_intercept_bridging failure path to use native semantic formatting
(`%err`) instead of eagerly allocating with format!. Preserve the existing error
message and failure handling.

In `@crates/api-core/src/tests/sku.rs`:
- Around line 1300-1314: Replace the ambiguous tracing event messages in the
original_sku and broken_sku snapshot logs with stable, descriptive
human-readable literals identifying each snapshot, such as the original SKU
before mismatch and broken SKU after mismatch. Keep the existing structured
fields unchanged.

In `@crates/machine-controller/src/handler.rs`:
- Around line 7249-7252: Use the consistent machine_id field name for all newly
added DPU MachineId tracing fields, including the logs around the
use_admin_network_changed flag and the corresponding entries near machine_id =
%dpu_id. Replace dpu_id keys that log the same semantic DPU identifier while
preserving the existing identifier values and messages.

In `@crates/rpc-utils/src/managed_host_display.rs`:
- Around line 66-73: Update the error field in the site exploration report
handling within the site exploration report retrieval flow to use Display
formatting (`%e`) instead of Debug formatting (`?e`) in the warn! call, matching
the file’s existing error logging style.

In `@crates/scout/src/main.rs`:
- Around line 190-202: Update both error branches in the PublishMlxDeviceReport
request flow to log the captured error with Display formatting by changing the
error fields in the create and publish failure tracing calls from debug
formatting to `%e`, preserving their existing messages and behavior.

In `@crates/site-explorer/src/switch_creator.rs`:
- Around line 78-84: Update the tracing::error! call in the Err(error) branch to
log explored_managed_switch.bmc_ip using the existing bmc_ip key and %
formatter, matching the earlier log statement; remove the bmc_ip_address key and
? formatter.

In `@crates/site-explorer/tests/integration/power_shelf.rs`:
- Around line 113-117: Extract the repeated structured “DHCP assigned ip”
logging from the affected test functions into a shared log_dhcp_assignment
helper accepting MacAddress and IP string references, preserving the existing
mac_address and ip_address fields and message. Replace all eight identical
tracing::info! call sites, including those in the listed test flows, with the
helper using power_shelf.bmc_mac_address and response.address.
🪄 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: 1c8ac7da-8be1-4b4d-b1c5-55ef542ef20d

📥 Commits

Reviewing files that changed from the base of the PR and between 4cea557 and 603a407.

📒 Files selected for processing (272)
  • STYLE_GUIDE.md
  • crates/admin-cli/src/machine/show/cmd.rs
  • crates/admin-cli/src/rpc.rs
  • crates/agent/src/agent_platform.rs
  • crates/agent/src/astra_weave.rs
  • crates/agent/src/containerd/container.rs
  • crates/agent/src/containerd/image.rs
  • crates/agent/src/dhcp_server_grpc_client.rs
  • crates/agent/src/dpu/interface.rs
  • crates/agent/src/dpu/link.rs
  • crates/agent/src/dpu/route.rs
  • crates/agent/src/ethernet_virtualization.rs
  • crates/agent/src/extension_services/dpu_extension_service_observability.rs
  • crates/agent/src/extension_services/k8s_pod_handler.rs
  • crates/agent/src/hbn.rs
  • crates/agent/src/health.rs
  • crates/agent/src/health/bgp.rs
  • crates/agent/src/host_machine_id.rs
  • crates/agent/src/instance_metadata_endpoint.rs
  • crates/agent/src/instrumentation.rs
  • crates/agent/src/lib.rs
  • crates/agent/src/machine_inventory_updater.rs
  • crates/agent/src/main_loop.rs
  • crates/agent/src/managed_files.rs
  • crates/agent/src/mtu.rs
  • crates/agent/src/netlink.rs
  • crates/agent/src/network_monitor.rs
  • crates/agent/src/nvue.rs
  • crates/agent/src/ovs.rs
  • crates/agent/src/periodic_config_fetcher.rs
  • crates/agent/src/tests/common/mod.rs
  • crates/agent/src/tests/full.rs
  • crates/agent/src/tests/test_network_monitor.rs
  • crates/agent/src/traffic_intercept_bridging.rs
  • crates/agent/src/upgrade.rs
  • crates/api-core/src/attestation/measured_boot.rs
  • crates/api-core/src/attestation/tpm_ca_cert.rs
  • crates/api-core/src/db_init.rs
  • crates/api-core/src/dhcp/discover.rs
  • crates/api-core/src/dpa/handler.rs
  • crates/api-core/src/dynamic_settings.rs
  • crates/api-core/src/handlers/api.rs
  • crates/api-core/src/handlers/astra.rs
  • crates/api-core/src/handlers/attestation.rs
  • crates/api-core/src/handlers/bmc_endpoint_explorer.rs
  • crates/api-core/src/handlers/component_manager.rs
  • crates/api-core/src/handlers/dns.rs
  • crates/api-core/src/handlers/dpu_remediation.rs
  • crates/api-core/src/handlers/expected_machine.rs
  • crates/api-core/src/handlers/extension_service.rs
  • crates/api-core/src/handlers/finder.rs
  • crates/api-core/src/handlers/firmware.rs
  • crates/api-core/src/handlers/instance.rs
  • crates/api-core/src/handlers/instance_type.rs
  • crates/api-core/src/handlers/machine.rs
  • crates/api-core/src/handlers/machine_discovery.rs
  • crates/api-core/src/handlers/machine_scout.rs
  • crates/api-core/src/handlers/machine_validation.rs
  • crates/api-core/src/handlers/rack.rs
  • crates/api-core/src/handlers/redfish.rs
  • crates/api-core/src/handlers/scout_stream.rs
  • crates/api-core/src/handlers/site_explorer.rs
  • crates/api-core/src/handlers/svpc.rs
  • crates/api-core/src/handlers/uefi.rs
  • crates/api-core/src/instance/mod.rs
  • crates/api-core/src/ipxe.rs
  • crates/api-core/src/listener.rs
  • crates/api-core/src/logging/setup.rs
  • crates/api-core/src/machine_update_manager/dpu_nic_firmware.rs
  • crates/api-core/src/machine_update_manager/host_firmware.rs
  • crates/api-core/src/machine_update_manager/mod.rs
  • crates/api-core/src/machine_validation/mod.rs
  • crates/api-core/src/measured_boot/metrics_collector/mod.rs
  • crates/api-core/src/mqtt_state_change_hook/hook.rs
  • crates/api-core/src/run.rs
  • crates/api-core/src/scout_stream.rs
  • crates/api-core/src/setup.rs
  • crates/api-core/src/tests/common/api_fixtures/dpu.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/common/api_fixtures/test_machine/mod.rs
  • crates/api-core/src/tests/dns.rs
  • crates/api-core/src/tests/dpu_reprovisioning.rs
  • crates/api-core/src/tests/instance.rs
  • crates/api-core/src/tests/machine_network.rs
  • crates/api-core/src/tests/sku.rs
  • crates/api-core/tests/integration/machine_bmc_metadata.rs
  • crates/api-db/src/bmc_metadata.rs
  • crates/api-db/src/carbide_version.rs
  • crates/api-db/src/dns/resource_record.rs
  • crates/api-db/src/expected_power_shelf.rs
  • crates/api-db/src/expected_switch.rs
  • crates/api-db/src/instance.rs
  • crates/api-db/src/lib.rs
  • crates/api-db/src/machine.rs
  • crates/api-db/src/machine_interface.rs
  • crates/api-db/src/machine_topology.rs
  • crates/api-db/src/measured_boot/bundle.rs
  • crates/api-db/src/vpc_dpu_loopback.rs
  • crates/api-db/src/work_lock_manager.rs
  • crates/api-integration-tests/tests/lib.rs
  • crates/api-model/src/dpa_interface/mod.rs
  • crates/api-model/src/firmware.rs
  • crates/api-model/src/instance/status/network.rs
  • crates/api-model/src/instance/status/nvlink.rs
  • crates/api-model/src/instance/status/spx.rs
  • crates/api-model/src/machine/mod.rs
  • crates/api-model/src/machine/nvlink.rs
  • crates/api-model/src/machine/spx.rs
  • crates/api-model/src/site_explorer/mod.rs
  • crates/api-test-helper/src/domain.rs
  • crates/api-test-helper/src/instance.rs
  • crates/api-test-helper/src/machine.rs
  • crates/api-test-helper/src/machine_a_tron.rs
  • crates/api-test-helper/src/subnet.rs
  • crates/api-test-helper/src/tenant.rs
  • crates/api-test-helper/src/vpc.rs
  • crates/api-test-helper/src/vpc_prefix.rs
  • crates/api-web/src/auth.rs
  • crates/api-web/src/interface.rs
  • crates/api-web/src/lib.rs
  • crates/api-web/src/machine.rs
  • crates/api-web/src/managed_host.rs
  • crates/api-web/src/search.rs
  • crates/bmc-explorer/src/chassis.rs
  • crates/bmc-explorer/src/computer_system.rs
  • crates/bmc-explorer/src/manager.rs
  • crates/bmc-mock/src/combined_server.rs
  • crates/bmc-mock/src/combined_service.rs
  • crates/bmc-mock/src/main.rs
  • crates/bmc-mock/src/redfish/expander_router.rs
  • crates/bmc-mock/src/tar_router.rs
  • crates/bmc-mock/src/tls.rs
  • crates/bmc-proxy/src/bmc_proxy.rs
  • crates/bmc-proxy/src/setup.rs
  • crates/dhcp-server/src/cache.rs
  • crates/dhcp-server/src/grpc_server.rs
  • crates/dhcp-server/src/main.rs
  • crates/dhcp-server/src/modes/controller.rs
  • crates/dhcp-server/src/packet_handler.rs
  • crates/dhcp-server/src/util.rs
  • crates/dns-record/src/lib.rs
  • crates/dns/src/lib.rs
  • crates/dns/src/main.rs
  • crates/dpa-manager/src/card_handler/astra.rs
  • crates/dpa-manager/src/card_handler/svpc.rs
  • crates/dpa-manager/src/lib.rs
  • crates/dpa/src/lib.rs
  • crates/dpf/src/sdk.rs
  • crates/dpu-otel-agent/src/lib.rs
  • crates/dpu-remediation/src/remediation.rs
  • crates/dsx-exchange-consumer/src/api_client.rs
  • crates/firmware/src/config.rs
  • crates/firmware/src/downloader.rs
  • crates/fmds/src/http_request_metrics.rs
  • crates/fmds/src/main.rs
  • crates/fmds/src/nic_init.rs
  • crates/fmds/src/phone_home.rs
  • crates/health/src/api_client.rs
  • crates/health/src/collectors/logs/periodic.rs
  • crates/health/src/discovery/cleanup.rs
  • crates/health/src/discovery/context.rs
  • crates/health/src/discovery/spawn.rs
  • crates/health/src/metrics.rs
  • crates/host-support/src/hardware_enumeration.rs
  • crates/host-support/src/hardware_enumeration/dpu.rs
  • crates/host-support/src/hardware_enumeration/gpu.rs
  • crates/host-support/src/hardware_enumeration/tpm.rs
  • crates/host-support/src/registration.rs
  • crates/http-connector/src/connector.rs
  • crates/http-connector/src/resolver.rs
  • crates/ib-fabric/src/lib.rs
  • crates/ib-partition-controller/src/handler.rs
  • crates/ipmi/src/tool.rs
  • crates/kms-provider/src/providers/transit.rs
  • crates/libmlx/src/device/discovery.rs
  • crates/libnmxc/src/lib.rs
  • crates/libnmxm/src/lib.rs
  • crates/machine-a-tron/src/api_client.rs
  • crates/machine-a-tron/src/api_throttler.rs
  • crates/machine-a-tron/src/bmc_mock_wrapper.rs
  • crates/machine-a-tron/src/dhcp_wrapper.rs
  • crates/machine-a-tron/src/host_machine.rs
  • crates/machine-a-tron/src/machine_a_tron.rs
  • crates/machine-a-tron/src/machine_state_machine.rs
  • crates/machine-a-tron/src/machine_utils.rs
  • crates/machine-a-tron/src/main.rs
  • crates/machine-a-tron/src/mock_ssh_server.rs
  • crates/machine-a-tron/src/subnet.rs
  • crates/machine-a-tron/src/tui.rs
  • crates/machine-a-tron/src/vpc.rs
  • crates/machine-controller/src/dpf.rs
  • crates/machine-controller/src/handler.rs
  • crates/machine-controller/src/handler/attestation.rs
  • crates/machine-controller/src/handler/bios_config.rs
  • crates/machine-controller/src/handler/dpf.rs
  • crates/machine-controller/src/handler/machine_validation.rs
  • crates/machine-controller/src/handler/power.rs
  • crates/machine-controller/src/handler/sku.rs
  • crates/machine-validation/src/machine_validation.rs
  • crates/metrics-endpoint/src/lib.rs
  • crates/metrics-utils/src/lib.rs
  • crates/mqttea-example/src/main.rs
  • crates/mqttea/src/client/core.rs
  • crates/mqttea/src/client/messages.rs
  • crates/mqttea/src/registry/core.rs
  • crates/nvlink-manager/src/lib.rs
  • crates/nvlink-manager/src/switch_cert_monitor.rs
  • crates/power-shelf-controller/src/configuring.rs
  • crates/power-shelf-controller/src/deleting.rs
  • crates/power-shelf-controller/src/fetching_data.rs
  • crates/power-shelf-controller/src/initializing.rs
  • crates/preingestion-manager/src/bfb_rshim_copier.rs
  • crates/preingestion-manager/src/lib.rs
  • crates/preingestion-manager/tests/integration/host_bmc_firmware.rs
  • crates/rack-controller/src/created.rs
  • crates/rack-controller/src/discovering.rs
  • crates/rack-controller/src/error_state.rs
  • crates/rack-controller/src/handler.rs
  • crates/rack-controller/src/lib.rs
  • crates/rack-controller/src/maintenance.rs
  • crates/rack-controller/src/ready.rs
  • crates/rack-controller/src/validating.rs
  • crates/rpc-utils/src/managed_host_display.rs
  • crates/rpc/src/errors.rs
  • crates/rpc/src/forge_tls_client.rs
  • crates/rpc/src/model/dpu_remediation.rs
  • crates/scout/src/attestation.rs
  • crates/scout/src/deprovision/scrabbing.rs
  • crates/scout/src/firmware_upgrade.rs
  • crates/scout/src/main.rs
  • crates/scout/src/mlx_device.rs
  • crates/scout/src/register.rs
  • crates/scout/src/stream.rs
  • crates/scout/src/tpm.rs
  • crates/secrets/src/forge_vault.rs
  • crates/secrets/src/local_credentials/file.rs
  • crates/site-explorer/src/bmc_endpoint_explorer.rs
  • crates/site-explorer/src/explored_endpoint_index.rs
  • crates/site-explorer/src/lib.rs
  • crates/site-explorer/src/machine_creator.rs
  • crates/site-explorer/src/redfish.rs
  • crates/site-explorer/src/switch_creator.rs
  • crates/site-explorer/src/test_support/mock_endpoint_explorer.rs
  • crates/site-explorer/tests/integration/power_shelf.rs
  • crates/site-explorer/tests/integration/site_explorer.rs
  • crates/site-explorer/tests/integration/switch.rs
  • crates/spdm-controller/src/handler.rs
  • crates/ssh-console-mock-api-server/src/lib.rs
  • crates/ssh-console/src/bmc/client.rs
  • crates/ssh-console/src/bmc/connection.rs
  • crates/ssh-console/src/bmc/connection_impl/ipmi.rs
  • crates/ssh-console/src/bmc/connection_impl/ssh.rs
  • crates/ssh-console/src/bmc/message_proxy.rs
  • crates/ssh-console/src/config.rs
  • crates/ssh-console/src/console_logger.rs
  • crates/ssh-console/src/frontend.rs
  • crates/ssh-console/src/metrics.rs
  • crates/ssh-console/src/ssh_cert_parsing.rs
  • crates/ssh-console/src/ssh_server.rs
  • crates/ssh-console/tests/util/ipmi_sim.rs
  • crates/ssh-console/tests/util/mod.rs
  • crates/state-controller/src/controller/periodic_enqueuer.rs
  • crates/state-controller/src/controller/processor.rs
  • crates/switch-controller/src/certificate.rs
  • crates/switch-controller/src/configuring.rs
  • crates/switch-controller/src/created.rs
  • crates/switch-controller/src/deleting.rs
  • crates/switch-controller/src/error_state.rs
  • crates/switch-controller/src/initializing.rs
  • crates/switch-controller/src/ready.rs
  • crates/switch-controller/src/validating.rs
💤 Files with no reviewable changes (1)
  • crates/health/src/discovery/context.rs

Comment thread crates/agent/src/health.rs Outdated
Comment thread crates/agent/src/mtu.rs
Comment thread crates/agent/src/ovs.rs
Comment on lines +265 to +267
astra_status_observation = ?obs,
error = ?e,
"Failed to parse Astra DPA acknowledgment config version",

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.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

sed -n '220,320p' crates/api-core/src/handlers/astra.rs
printf '\n---\n'
rg -n "Failed to parse Astra DPA acknowledgment config version|error = \\?e|error = %e|impl Display for|enum .*Error|struct .*Error" crates/api-core/src -g '!target'

Repository: NVIDIA/infra-controller

Length of output: 12926


🏁 Script executed:

sed -n '250,305p' crates/api-core/src/handlers/astra.rs
printf '\n---\n'
rg -n "type .*ConfigVersion|struct ConfigVersion|enum ConfigVersion|impl FromStr for ConfigVersion|impl Display for ConfigVersion|from_str\\(" crates/api-core/src -g '!target'

Repository: NVIDIA/infra-controller

Length of output: 25526


🏁 Script executed:

rg -n "pub async fn find_by|async fn find_by|fn find_by" crates/api-core/src crates -g '!target'
printf '\n---\n'
rg -n "ConfigVersion" crates/api-core/src crates -g '!target'

Repository: NVIDIA/infra-controller

Length of output: 50379


🏁 Script executed:

sed -n '235,310p' crates/config-version/src/lib.rs
printf '\n---\n'
rg -n "enum DatabaseError|impl Display for DatabaseError|thiserror::Error.*DatabaseError|pub enum DatabaseError" crates/api-db/src crates -g '!target'

Repository: NVIDIA/infra-controller

Length of output: 2776


🏁 Script executed:

sed -n '235,310p' crates/config-version/src/lib.rs
printf '\n---\n'
rg -n "enum DatabaseError|impl Display for DatabaseError|thiserror::Error.*DatabaseError|pub enum DatabaseError|type DatabaseResult" crates/api-db/src crates -g '!target'

Repository: NVIDIA/infra-controller

Length of output: 2944


🏁 Script executed:

sed -n '325,436p' crates/api-db/src/lib.rs
printf '\n---\n'
sed -n '1,120p' crates/api-core/src/handlers/astra.rs

Repository: NVIDIA/infra-controller

Length of output: 9491


Use Display formatting for these error fields

Both ConfigVersionParseError and DatabaseError implement Display, so error = %e is preferable to error = ?e in both log sites. It keeps the output cleaner and easier to search.

🤖 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/handlers/astra.rs` around lines 265 - 267, Update the
error fields in both Astra acknowledgment-config parsing log sites to use
Display formatting (`%e`) instead of Debug formatting (`?e`). Apply this to the
`ConfigVersionParseError` and `DatabaseError` log entries while preserving their
existing messages and fields.

Source: Coding guidelines

Comment thread crates/api-core/src/handlers/finder.rs
Comment thread crates/machine-controller/src/handler.rs Outdated
Comment thread crates/machine-controller/src/handler.rs Outdated
Comment thread crates/machine-controller/src/handler/sku.rs Outdated
Comment thread crates/machine-validation/src/machine_validation.rs
Comment thread crates/preingestion-manager/src/lib.rs
@chet chet force-pushed the gh-issue-3476 branch 2 times, most recently from 7ddd0b8 to e1691b0 Compare July 15, 2026 07:21
@chet

chet commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full_review, thanks!

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

@chet, understood — kicking off a full review of the current state of the PR now.

(=^・ω・^=)

✅ Action performed

Full review finished.

NICo's tracing events now keep operational values in named fields and use stable messages, making logfmt output easier to search and aggregate. Along the way, this establishes common keys wherever the value makes that practical -- easier searches and docs now, and a useful step toward deriving log schemas later.

Primary callouts are:

- Convert roughly 1,500 direct tracing events across more than 50 crates to stable messages with semantic fields.
- Standardize common keys such as `error`, `machine_id`, `bmc_ip_address`, and type-derived identifiers while keeping role names where they add real context.
- Keep trace levels and intentional `Display`, `Debug`, custom formatting, and domain-specific fields intact.
- Strengthen `STYLE_GUIDE.md` with the core field vocabulary and rules for IDs, addresses, states, counts, and quantities.
- Leave CLI output, child-process streams, aligned or multiline displays, and logging fixtures rendered where the text itself is the payload.

This supports NVIDIA#3476

Signed-off-by: Chet Nichols III <chetn@nvidia.com>
@chet

chet commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full_review, thanks!

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

@chet, acknowledged — kicking off a full review of the current state of the PR now.

(=^・ω・^=)

✅ Action performed

Full review finished.

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