feat: per-machine BMC vendor override#2912
Conversation
d38e985 to
04c592a
Compare
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
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 ignored due to path filters (2)
📒 Files selected for processing (25)
✅ Files skipped from review due to trivial changes (7)
🚧 Files skipped from review as they are similar to previous changes (16)
Summary by CodeRabbit
WalkthroughAdds a machine-level Redfish BMC vendor override through the RPC, storage, Redfish client, and admin CLI paths. The override can now be set, cleared, shown, and propagated into Redfish client creation. ChangesVendor override flow
Estimated code review effort: 4 (Complex) | ~60 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
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/admin-cli/src/machine/vendor_override/args.rs`:
- Around line 43-47: The `vendor` argument on `VendorOverrideArgs` currently
accepts any string and only fails back to auto-detection later, so invalid
values slip through parse time. Update the `clap` field in `VendorOverrideArgs`
to validate against the exact `RedfishVendor` variant names (case-sensitive) by
using a `ValueEnum` or a custom parser/validator. Ensure `--vendor` is rejected
immediately for typos and only the supported vendor names are accepted.
In `@crates/api-core/src/handlers/machine.rs`:
- Around line 325-333: Validate the incoming bmc_vendor_override in
machine::update before calling db::machine::update_bmc_vendor_override: reject
any non-empty value that redfish_vendor_from_str does not accept and return
NicoError::InvalidArgument instead of persisting it. Keep the existing
empty/absent handling, but only pass through vendor names that map to a known
Redfish vendor so typos cannot be stored and later silently ignored when the
client is built.
🪄 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: 97cbfb50-bbec-4b40-8551-a3ed7fcd7472
📒 Files selected for processing (23)
crates/admin-cli/src/machine/mod.rscrates/admin-cli/src/machine/vendor_override/args.rscrates/admin-cli/src/machine/vendor_override/cmd.rscrates/admin-cli/src/machine/vendor_override/mod.rscrates/admin-cli/src/rpc.rscrates/api-core/src/api.rscrates/api-core/src/handlers/instance.rscrates/api-core/src/handlers/machine.rscrates/api-db/migrations/20260625120000_machine_bmc_vendor_override.sqlcrates/api-db/src/machine.rscrates/api-db/src/machine_interface.rscrates/api-model/src/machine/json.rscrates/api-model/src/machine/mod.rscrates/redfish/src/libredfish/conv.rscrates/redfish/src/libredfish/mod.rscrates/rpc/proto/forge.protocrates/rpc/src/model/machine/mod.rscrates/utils/src/redfish.rsdocs/manuals/nico-admin-cli/commands/machine/machine-vendor-override-clear.mddocs/manuals/nico-admin-cli/commands/machine/machine-vendor-override-set.mddocs/manuals/nico-admin-cli/commands/machine/machine-vendor-override-show.mddocs/manuals/nico-admin-cli/commands/machine/machine-vendor-override.mddocs/manuals/nico-admin-cli/commands/machine/machine.md
04c592a to
304b943
Compare
304b943 to
fd86083
Compare
|
/ok to test fd86083 |
|
🌿 Preview your docs: https://nvidia-preview-pull-request-2912.docs.buildwithfern.com/infra-controller |
🔐 TruffleHog Secret Scan✅ No secrets or credentials found! Your code has been scanned for 700+ types of secrets and credentials. All clear! 🎉 🕐 Last updated: 2026-07-08 07:51:52 UTC | Commit: fd86083 |
🔍 Container Scan Summary
Per-CVE detail lives in the per-service |
fd86083 to
a026f88
Compare
rebased and regenerated protos |
|
conflicts |
a026f88 to
148ab9c
Compare
rebased |
|
/ok to test 148ab9c |
Pin a Redfish BMC vendor per machine, forced into libredfish instead of automatic detection. The value is a plain string matched against libredfish's RedfishVendor enum at client creation, and an unknown name warns and falls back, so NICo keeps no vendor list. It rides on BmcAccessInfo so every client_by_info caller honors it, and the direct instance power and force delete paths pass it too. Adds the machines.bmc_vendor_override column and migration, the UpdateMachineBmcVendorOverride RPC and a field on Machine, the forced vendor in client_by_info, and a machine vendor override set, clear, and show CLI command. Signed-off-by: s3rj1k <evasive.gyron@gmail.com>
148ab9c to
c6614cf
Compare
RBAC tests have failed, fixed (hopefully) and rebased, sorry about that |
Pin a Redfish BMC vendor per machine, forced into libredfish instead of auto-detection. The value is a plain string matched against libredfish's RedfishVendor enum at client creation (an unknown name warns and falls back), so NICo keeps no vendor list. It rides on BmcAccessInfo so every client_by_info caller honors it, plus the direct instance-power and force-delete paths.
Related issues
Type of Change
Breaking Changes
Testing
Additional Notes