Skip to content

refactor: split BmcInfo into BmcEndpoint (ingestion) and BmcStatus (observed)#3969

Open
RajMandaliya wants to merge 10 commits into
NVIDIA:mainfrom
RajMandaliya:feat/split-bmcinfo-endpoint-status
Open

refactor: split BmcInfo into BmcEndpoint (ingestion) and BmcStatus (observed)#3969
RajMandaliya wants to merge 10 commits into
NVIDIA:mainfrom
RajMandaliya:feat/split-bmcinfo-endpoint-status

Conversation

@RajMandaliya

Copy link
Copy Markdown
Contributor

Addresses #3516.

Problem

BmcInfo currently bundles two conceptually different kinds of data into one message: connection details established once at ingestion (ip, mac, port, machine_interface_id) and observed/runtime state (version, firmware_version). Per the design discussion referenced in the issue, these should live in separate messages that match where they actually belong on Machine/MachineStatus.

Approach

Mirrors the pattern already established and merged in #2847 (the Machine config/status split): add new, more precisely-scoped messages, populate them alongside the existing flat field, and mark the old field deprecated rather than removing it — so existing consumers are unaffected until a follow-up PR migrates them.

  • Add BmcEndpoint (ip, mac, port, machine_interface_id) on Machine — ingestion-time connection details, not operator-mutable.
  • Add BmcStatus (version, firmware_version) on MachineStatus - observed/runtime state.
  • Deprecate BmcInfo/Machine.bmc_info, kept fully populated for backward compatibility.
  • Regenerated the rest-api Go mirror (nico_nico.proto, nico_nico.pb.go) via make core-proto, matching the same sync
    step refactor(machine): separate Machine fields into config/status #2847 performed.

Scope

This PR is intentionally limited to the schema/conversion layer - adding the new messages and populating them - without migrating the 25 existing call sites that currently read the deprecated flat bmc_info field. That migration is a separate, follow-up piece of work, exactly mirroring how #2847's own consumer migration was tracked as a distinct follow-up (#2798) rather than done in the same PR.

Testing

Verified clean build across every crate that touches BmcInfo (api-model, api-db, api-web, health, site-explorer,
machine-controller, spdm-controller, admin-cli, rpc-utils) and the full rest-api Go module. Confirmed the field numbers used (52 on Machine, 25 on MachineStatus) were genuinely free before adding them.

RajMandaliya and others added 10 commits July 8, 2026 12:58
Keeping Pace with original repo
…bserved)

Mirrors the pattern established in NVIDIA#2847 (Machine config/status split):
add new, more precisely-scoped messages, populate them alongside the
existing flat field, and mark the old field deprecated rather than
removing it, so existing consumers are unaffected until a follow-up
migration.

- Add BmcEndpoint (ip, mac, port, machine_interface_id) on Machine --
  ingestion-time connection details, not operator-mutable.
- Add BmcStatus (version, firmware_version) on MachineStatus --
  observed/runtime state.
- Deprecate BmcInfo/Machine.bmc_info, kept fully populated for
  compatibility.
- Regenerated the rest-api Go mirror (nico_nico.proto,
  nico_nico.pb.go) via make core-proto, matching the same sync step
  NVIDIA#2847 performed.

Verified: clean build across every crate that touches BmcInfo
(api-model, api-db, api-web, health, site-explorer,
machine-controller, spdm-controller, admin-cli, rpc-utils) and the
full rest-api Go module.

Addresses NVIDIA#3516.

Signed-off-by: RajMandaliya <rajmandaliya2249@gmail.com>
@copy-pr-bot

copy-pr-bot Bot commented Jul 23, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: b087cda4-d388-4e70-9692-663d0d31f597

📥 Commits

Reviewing files that changed from the base of the PR and between 2de970b and 1b1944f.

⛔ Files ignored due to path filters (1)
  • rest-api/proto/core/gen/v1/nico_nico.pb.go is excluded by !**/*.pb.go, !**/gen/**, !rest-api/**/*.pb.go
📒 Files selected for processing (5)
  • crates/rpc/build.rs
  • crates/rpc/proto/forge.proto
  • crates/rpc/src/model/bmc_info.rs
  • crates/rpc/src/model/machine/mod.rs
  • rest-api/proto/core/src/v1/nico_nico.proto

Summary by CodeRabbit

  • New Features

    • Added separate BMC endpoint and runtime status information to machine data.
    • Machine status now reports observed BMC details, including version and firmware information.
    • BMC connection details now include interface, IP address, port, and MAC address.
  • Documentation

    • Marked the legacy BMC information field and message as deprecated in favor of the new structured fields.

Walkthrough

The RPC and REST protobuf schemas separate BMC connection details from observed runtime state, deprecate legacy BMC fields, derive serialization for new RPC types, and map local BMC data into machine responses.

Changes

BMC model split

Layer / File(s) Summary
Define BMC endpoint and status contracts
crates/rpc/proto/forge.proto, rest-api/proto/core/src/v1/nico_nico.proto, crates/rpc/build.rs
Adds BmcEndpoint and BmcStatus, adds machine endpoint/status fields, deprecates BmcInfo, and configures serde derives for generated RPC types.
Map local BMC data into RPC models
crates/rpc/src/model/bmc_info.rs, crates/rpc/src/model/machine/mod.rs
Converts local BMC data into endpoint and status messages and assigns them to machine and machine-status responses.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main schema split from BmcInfo into BmcEndpoint and BmcStatus.
Description check ✅ Passed The description matches the change set and correctly explains the BMC schema split and compatibility approach.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ast-grep (0.44.1)
crates/rpc/build.rs

ast-grep timed out on this file


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

@RajMandaliya
RajMandaliya marked this pull request as ready for review July 23, 2026 09:35
@RajMandaliya
RajMandaliya requested a review from a team as a code owner July 23, 2026 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant