feat: per-machine BMC vendor override#2912
Conversation
d38e985 to
04c592a
Compare
|
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 (23)
✅ Files skipped from review due to trivial changes (5)
🚧 Files skipped from review as they are similar to previous changes (18)
Summary by CodeRabbit
WalkthroughAdds a machine-level Redfish BMC vendor override through the RPC, database, 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 Suggested labels: 🚥 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
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>
304b943 to
fd86083
Compare
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