fix(admin-cli): avoid panic for domainless machine interfaces#3988
fix(admin-cli): avoid panic for domainless machine interfaces#3988AlexGridnev wants to merge 2 commits into
Conversation
|
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)
🚧 Files skipped from review as they are similar to previous changes (1)
Summary by CodeRabbit
WalkthroughMachine-interface output now resolves known, missing, and unknown domain IDs through a shared helper. Both table and detail formatters render ChangesMachine interface domain resolution
Estimated code review effort: 2 (Simple) | ~10 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: 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/admin-cli/src/machine_interfaces/show/cmd.rs`:
- Around line 280-314: Add a table-driven test covering both domainless and
unknown-domain inputs for the formatter functions exercised by
formatters_render_unavailable_domain_name_for_domainless_interface. Include an
unknown Some(domain_id) case with an empty DomainList, and assert
convert_machine_to_nice_format and convert_machines_to_nice_table both render
UNAVAILABLE_DOMAIN_NAME (“NA”) for that case while preserving the existing None
case.
🪄 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: 47b1f109-8059-435d-a3aa-bd82feabbe29
📒 Files selected for processing (1)
crates/admin-cli/src/machine_interfaces/show/cmd.rs
Render unavailable domain names as NA instead of unwrapping them. Add regression coverage for list and detail output with missing or unknown domains. Signed-off-by: Alexey Gridnev <agridnev@nvidia.com>
Add table-driven formatter coverage for domainless and unknown-domain machine interfaces, ensuring both detail and table output render NA. Signed-off-by: Alexey Gridnev <agridnev@nvidia.com>
020c5a4 to
f30ea01
Compare
| .map(String::as_str) | ||
| .unwrap_or(UNAVAILABLE_DOMAIN_NAME) | ||
| } | ||
|
|
There was a problem hiding this comment.
one line functions are kinda pointless. and only used once
There was a problem hiding this comment.
oh, it is used twice. still kinda pointless ;)
Render unavailable domain names as NA instead of unwrapping them.
Add regression coverage for list and detail output with missing or unknown domains.
Related issues
#3992
Type of Change
Breaking Changes
Testing
Additional Notes