Skip to content

fix(admin-cli): avoid panic for domainless machine interfaces#3988

Open
AlexGridnev wants to merge 2 commits into
NVIDIA:mainfrom
AlexGridnev:fix/domainless-machine-interface-display
Open

fix(admin-cli): avoid panic for domainless machine interfaces#3988
AlexGridnev wants to merge 2 commits into
NVIDIA:mainfrom
AlexGridnev:fix/domainless-machine-interface-display

Conversation

@AlexGridnev

@AlexGridnev AlexGridnev commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

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

  • Add - New feature or capability
  • Change - Changes in existing functionality
  • Fix - Bug fixes
  • Remove - Removed features or deprecated functionality
  • Internal - Internal changes (refactoring, tests, docs, etc.)

Breaking Changes

  • This PR contains breaking changes

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed
  • No testing required (docs, internal refactor, etc.)

Additional Notes

@AlexGridnev
AlexGridnev requested a review from a team as a code owner July 23, 2026 16:48
@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: 175d2a37-00ab-46f9-8c79-a85ec5856f5b

📥 Commits

Reviewing files that changed from the base of the PR and between 020c5a4 and f30ea01.

📒 Files selected for processing (1)
  • crates/admin-cli/src/machine_interfaces/show/cmd.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • crates/admin-cli/src/machine_interfaces/show/cmd.rs

Summary by CodeRabbit

  • Bug Fixes
    • Improved machine-interface displays when a domain is missing or unknown.
    • Domainless interfaces now show “NA” consistently in both table and detail views.
    • Prevented display failures caused by unavailable domain information.

Walkthrough

Machine-interface output now resolves known, missing, and unknown domain IDs through a shared helper. Both table and detail formatters render "NA" when no matching domain is available, with unit tests covering resolution and output behavior.

Changes

Machine interface domain resolution

Layer / File(s) Summary
Domain resolution and formatter coverage
crates/admin-cli/src/machine_interfaces/show/cmd.rs
Adds a shared domain-name resolver with an "NA" fallback, applies it to table and detail formatting, and tests known, missing, and unknown domain cases.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 42.86% 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 captures the main fix: preventing panics for machine interfaces without a domain.
Description check ✅ Passed The description directly matches the change by describing NA fallback rendering and added regression tests.
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

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between d851387 and ae2c84f.

📒 Files selected for processing (1)
  • crates/admin-cli/src/machine_interfaces/show/cmd.rs

Comment thread 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>
@AlexGridnev
AlexGridnev force-pushed the fix/domainless-machine-interface-display branch from 020c5a4 to f30ea01 Compare July 23, 2026 17:53
.map(String::as_str)
.unwrap_or(UNAVAILABLE_DOMAIN_NAME)
}

@wminckler wminckler Jul 24, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one line functions are kinda pointless. and only used once

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, it is used twice. still kinda pointless ;)

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.

2 participants