Skip to content

fix(nmxc-browser): resolve NMX-C endpoint by rack ID as well. - #4475

Open
rtamma-nv wants to merge 2 commits into
NVIDIA:mainfrom
rtamma-nv:fix/nmxc_browser
Open

fix(nmxc-browser): resolve NMX-C endpoint by rack ID as well.#4475
rtamma-nv wants to merge 2 commits into
NVIDIA:mainfrom
rtamma-nv:fix/nmxc_browser

Conversation

@rtamma-nv

Copy link
Copy Markdown
Contributor

Currently, NMX-C browser expects chassis_serial->nmx_c_endpoint mapping to be available in nvlink_nmx_c_endpoint table. In sites where there are ingested racks, nmx_c_endpoint table is not required to be populated.
Add rack_id as an alternative to chassis_serial in NmxcBrowseRequest. When rack_id is provided the endpoint is resolved from the rack's ready control-plane switch NVOS IP via resolve_nmx_c_endpoint_url, removing the requirement for a nvlink_nmxc_endpoints row.

Related issues

](#4474)

Type of Change

  • [ X] 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
  • [ X] Manual testing performed
  • No testing required (docs, internal refactor, etc.)

Additional Notes

Add rack_id as an alternative to chassis_serial in NmxcBrowseRequest.
When rack_id is provided the endpoint is resolved from the rack's ready
control-plane switch NVOS IP via resolve_nmx_c_endpoint_url, removing
the requirement for a nvlink_nmxc_endpoints row.

Signed-off-by: Roopesh Tamma <rtamma@nvidia.com>
@rtamma-nv
rtamma-nv requested a review from a team as a code owner August 1, 2026 09:35
@coderabbitai

coderabbitai Bot commented Aug 1, 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: c0ea5b58-17fc-4375-9ac5-5c4565f7312c

📥 Commits

Reviewing files that changed from the base of the PR and between de7bc75 and 3b31da7.

📒 Files selected for processing (2)
  • crates/api-core/src/handlers/nmxc_browse.rs
  • crates/rpc/proto/forge.proto
🚧 Files skipped from review as they are similar to previous changes (2)
  • crates/rpc/proto/forge.proto
  • crates/api-core/src/handlers/nmxc_browse.rs

Summary by CodeRabbit

  • New Features
    • Added rack ID support for NMX-C browsing alongside chassis serial lookup.
    • Updated the web interface and CLI to let users select either a chassis or rack endpoint.
    • Added validation to require exactly one endpoint identifier.
    • Rack-based requests now resolve through the rack’s available control-plane endpoint.

Walkthrough

NMX-C browsing now accepts either a chassis serial or rack ID. CLI and web inputs validate the selectors. The API resolves rack endpoints through the ready control-plane switch NVOS IP.

Changes

NMX-C rack endpoint browsing

Layer / File(s) Summary
Request contract and CLI wiring
crates/rpc/proto/forge.proto, crates/admin-cli/src/browse/nmxc/*, crates/admin-cli/src/machine/nvlink_info/cmd.rs
The request supports an optional rack_id. CLI arguments require exactly one endpoint selector. Existing callers set rack_id explicitly when unset.
API endpoint resolution
crates/api-core/src/handlers/nmxc_browse.rs
The handler validates selectors, trims chassis serials, derives the managed host group type, and resolves rack or chassis endpoints through resolve_nmx_c_endpoint_url.
Web selector and query flow
crates/api-web/src/nmxc_browser.rs, crates/api-web/templates/nmxc_browser.html
The browser supports chassis and rack inputs, validates rack IDs, sends the selected endpoint, and renders results after query execution.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Browser
  participant nmxc_browser
  participant nmxc_browse
  participant resolve_nmx_c_endpoint_url
  Browser->>nmxc_browser: Submit chassis serial or rack ID
  nmxc_browser->>nmxc_browse: Send validated selector
  nmxc_browse->>resolve_nmx_c_endpoint_url: Resolve NMX-C endpoint
  resolve_nmx_c_endpoint_url-->>nmxc_browse: Return endpoint URL
  nmxc_browse-->>nmxc_browser: Return browse result
  nmxc_browser-->>Browser: Render query result
Loading

Possibly related issues

Possibly related PRs

Suggested labels: rack health

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes adding rack ID support for NMX-C endpoint resolution.
Description check ✅ Passed The description explains the rack ID alternative, endpoint resolution behavior, and testing performed.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown

🔐 TruffleHog Secret Scan

No secrets or credentials found!

Your code has been scanned for 700+ types of secrets and credentials. All clear! 🎉

🔗 View scan details

🕐 Last updated: 2026-08-01 09:38:34 UTC | Commit: de7bc75

@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: 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/api-core/src/handlers/nmxc_browse.rs`:
- Around line 155-171: Add table-driven tests for the selector validation logic
in nmxc_browse, covering rack-only, chassis-only, both-provided, and
neither-provided inputs. Use the existing scenarios! or check_cases pattern, and
assert the expected ManagedHostGroupType or validation error for each case.

In `@crates/rpc/proto/forge.proto`:
- Around line 8037-8045: Update the field comments for chassis_serial and
rack_id to document that the request must provide at least one of these fields,
while preserving the existing mutual-exclusion and endpoint-resolution
descriptions.
🪄 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: 4bdba87d-9d62-4bac-b681-284a23cc0db4

📥 Commits

Reviewing files that changed from the base of the PR and between 5b9a312 and de7bc75.

📒 Files selected for processing (7)
  • crates/admin-cli/src/browse/nmxc/args.rs
  • crates/admin-cli/src/browse/nmxc/cmd.rs
  • crates/admin-cli/src/machine/nvlink_info/cmd.rs
  • crates/api-core/src/handlers/nmxc_browse.rs
  • crates/api-web/src/nmxc_browser.rs
  • crates/api-web/templates/nmxc_browser.html
  • crates/rpc/proto/forge.proto

Comment thread crates/api-core/src/handlers/nmxc_browse.rs Outdated
Comment thread crates/rpc/proto/forge.proto
Signed-off-by: Roopesh Tamma <rtamma@nvidia.com>
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.

1 participant