refactor: resolve the boot NIC through one shared step#3194
Conversation
|
@coderabbitai full_review, thanks! |
|
(=^・ω・^=)ノ ✅ Action performedFull review finished. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
Summary by CodeRabbit
WalkthroughRefactors boot-interface resolution in ChangesBoot interface resolution refactor
Estimated code review effort: 2 (Simple) | ~15 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/machine-controller/src/handler.rs`:
- Around line 4930-4960: Add direct unit coverage for require_boot_interface in
handler.rs, since it wraps resolve_boot_interface and currently lacks focused
tests. Create cases for RequiredBootInterface::Ready,
RequiredBootInterface::Wait from BootInterfaceResolution::AwaitingNic (verify
the wait constructor is invoked with the expected message), and the Missing path
returning StateHandlerError::GenericError. Use the require_boot_interface and
RequiredBootInterface symbols to locate the code and assert the wrapper’s
mapping behavior independently of resolve_boot_interface.
🪄 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: 652ac3c8-8a61-42df-83da-97ce7f747806
📒 Files selected for processing (1)
crates/machine-controller/src/handler.rs
Four Redfish boot steps -- the three boot-order substates (SetBootOrder, WaitForHttpBootDeviceApplied, CheckBootOrder) and host boot repair -- each opened with the same fifteen-line block resolving the host's boot NIC, with only the wait message differing. The resolution step now lives in one helper, `require_boot_interface`, and each caller states just the activity it's blocked on: a zero-DPU host still discovering its boot NIC maps to the caller's wait outcome, and a host with no resolvable interface stays a hard error. - One source of truth for the resolve-or-wait-or-fail choreography, so the boot steps can't drift apart as the state machine grows. - Behavior-preserving: every caller keeps its exact wait message (the helper templates "before <activity>"), and wait-vs-error semantics are unchanged. - Call sites shrink from fifteen lines to a handful each. This supports NVIDIA#3193 Signed-off-by: Chet Nichols III <chetn@nvidia.com>
|
@coderabbitai full_review, thanks! |
|
✅ Action performedFull review finished. |
🔍 Container Scan Summary
Per-CVE detail lives in the per-service |
…ingestion (#4012) > [!IMPORTANT] > This PR cherry-picks the host boot-interface configuration convergence arc into `release/v2.0`, in merge order: > - #3139 (`78aa3766a`) -- skip the SetBootOrder re-apply when the boot config is already set > - #3186 (`064ce21bc`) -- apply SetBootOrder boot config once per reboot > - #3194 (`428135d4f`) -- resolve the boot NIC through one shared step > - #3369 (`a2ab63f2c`) -- ensure a correct boot config during machine validation > - #3454 (`9d80c7fcd`) -- generalized convergence for host boot interface configuration ## Related issues This supports #2821 (nvbug 6430706). ## Type of Change - [ ] **Add** - New feature or capability - [ ] **Change** - Changes in existing functionality - [x] **Fix** - Bug fixes - [ ] **Remove** - Removed features or deprecated functionality - [ ] **Internal** - Internal changes (refactoring, tests, docs, etc.) ## Breaking Changes - [ ] **This PR contains breaking changes** ## Testing - [x] Unit tests added/updated - [x] Integration tests added/updated - [ ] Manual testing performed - [ ] No testing required (docs, internal refactor, etc.) ## Additional Notes Backports the boot-interface convergence follow-ups that a v2.0 NIC-mode host needs to clear `PollingBiosSetup`/`BiosSetupFailed` (nvbug 6430706 / #2821). The base fix -- #2950, re-assert the HTTP boot device during NIC-mode -- is already in `release/v2.0`; this arc is the refinement set that lands the boot config by interface ID when the Dell NDF MAC goes empty, and converges it across host init, assigned setup, DPU reprovision, and validation. - **One conflict, in #3454** (`crates/machine-controller/Cargo.toml` `[dev-dependencies]`): resolved to `carbide-redfish` + `carbide-test-harness` + `carbide-test-support`, dropping `carbide-instrument` -- that crate does not exist on `release/v2.0` and nothing in the picked code references it. All other commits applied cleanly. - **libredfish:** no bump needed. The interface-ID boot resolution requires libredfish >= v0.44.16; `release/v2.0` already pins **v0.44.21** (`main` is at v0.44.22). - **#2896 intentionally excluded:** it was closed unmerged (a libredfish pin bump + test), superseded by #2950, which is already in v2.0. --------- Signed-off-by: Chet Nichols III <chetn@nvidia.com>
Four Redfish boot steps -- the three boot-order substates (SetBootOrder,
WaitForHttpBootDeviceApplied, CheckBootOrder) and host boot repair -- each
opened with the same fifteen-line block resolving the host's boot NIC, with
only the wait message differing. The resolution step now lives in one helper,
require_boot_interface, and each caller states just the activity it'sblocked on: a zero-DPU host still discovering its boot NIC maps to the
caller's wait outcome, and a host with no resolvable interface stays a hard
error.
boot steps can't drift apart as the state machine grows.
templates "before "), and wait-vs-error semantics are unchanged.
This supports #3193
Signed-off-by: Chet Nichols III chetn@nvidia.com
Closes #3193