Skip to content

feat(dsx): provider implementation - #452

Open
ravisoundar wants to merge 1 commit into
mainfrom
rs-dsx
Open

feat(dsx): provider implementation#452
ravisoundar wants to merge 1 commit into
mainfrom
rs-dsx

Conversation

@ravisoundar

@ravisoundar ravisoundar commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Description

Added dsx provider implementation

@ravisoundar
ravisoundar requested a review from dmitsh as a code owner August 7, 2026 21:37
@copy-pr-bot

copy-pr-bot Bot commented Aug 7, 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.

@ravisoundar

Copy link
Copy Markdown
Collaborator Author

/ok-to-test b462f7d

@greptile-apps

greptile-apps Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR implements and registers the DSX topology provider, including authenticated HTTP access, paginated topology retrieval, topology conversion, simulation support, tests, and provider documentation.

  • Adds DSX API client and loader configuration.
  • Accumulates paginated switch adjacency data before building topology.
  • Adds cycle, page-count, and generation-duration termination guards.
  • Registers real and simulated DSX providers.

Confidence Score: 4/5

The PR is not yet safe to merge because retryable DSX failures can still recreate the ten-minute generation deadline and keep one generation active for roughly 50 minutes.

The current code makes deadline expiry terminal, but an API error returned just before expiry remains a retryable 502; the server then invokes the provider again and creates another full generation deadline.

Files Needing Attention: pkg/providers/dsx/instance_topology.go, pkg/server/engine.go

Important Files Changed

Filename Overview
pkg/providers/dsx/instance_topology.go Adds complete pagination, cross-page topology assembly, cycle detection, page limits, and a per-invocation generation deadline.
pkg/providers/dsx/client.go Implements the context-aware DSX HTTP client, authentication header, query construction, and response decoding.
pkg/providers/dsx/provider.go Implements DSX provider loading, parameter and credential decoding, client construction, and graph generation.
pkg/providers/dsx/provider_sim.go Updates DSX simulation output to match the ordered switch-adjacency API shape.
pkg/registry/registry.go Registers the real and simulated DSX provider loaders.

Sequence Diagram

sequenceDiagram
    participant Server
    participant DSXProvider
    participant DSXClient
    participant DSXAPI
    Server->>DSXProvider: GenerateTopologyConfig
    loop Until empty token or termination guard
        DSXProvider->>DSXClient: GetTopology(genCtx, token)
        DSXClient->>DSXAPI: GET /v1/topology/nodes
        DSXAPI-->>DSXClient: switches + next_page_token
        DSXClient-->>DSXProvider: topology page
    end
    DSXProvider->>DSXProvider: Resolve cross-page ancestry
    DSXProvider-->>Server: Canonical topology graph
Loading

Reviews (18): Last reviewed commit: "feat(dsx): provider implementation" | Re-trigger Greptile

Comment thread pkg/providers/dsx/instance_topology.go Outdated
@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 68.00000% with 32 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.87%. Comparing base (8468abe) to head (0783bcb).
⚠️ Report is 49 commits behind head on main.

Files with missing lines Patch % Lines
pkg/providers/dsx/client.go 0.00% 24 Missing ⚠️
pkg/providers/dsx/provider.go 68.42% 3 Missing and 3 partials ⚠️
pkg/providers/dsx/instance_topology.go 95.91% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #452      +/-   ##
==========================================
+ Coverage   72.15%   76.87%   +4.71%     
==========================================
  Files          89       97       +8     
  Lines        5689     7053    +1364     
==========================================
+ Hits         4105     5422    +1317     
+ Misses       1382     1350      -32     
- Partials      202      281      +79     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread pkg/providers/dsx/instance_topology.go Outdated
@dmitsh

dmitsh commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: c65d9c74-f22c-4ffb-9b51-6b3d405180de

📥 Commits

Reviewing files that changed from the base of the PR and between 8cdf937 and 1eb166d.

📒 Files selected for processing (4)
  • pkg/providers/dsx/client.go
  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/instance_topology_test.go
  • pkg/providers/dsx/provider_sim.go
📜 Recent review details
⏰ Context from checks skipped due to timeout. (1)
  • GitHub Check: Greptile Review
🧰 Additional context used
📓 Path-based instructions (5)
**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

**/*.go: Run go fmt ./...; Go formatting is authoritative and code should not be hand-formatted.
Every new Go file must include the NVIDIA copyright header followed by the matching Apache 2.0 boilerplate.

Files:

  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/client.go
  • pkg/providers/dsx/provider_sim.go
  • pkg/providers/dsx/instance_topology_test.go
pkg/providers/**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

pkg/providers/**/*.go: Providers must return a *topology.Graph and *httperr.Error; plain error is not acceptable at the provider interface boundary.
Providers discover topology and return the canonical topology.Graph; they must not emit scheduler-specific output.
When using ClusterTopology, populate fabric tiers closest-first, preserve optional accelerator domain and sub-domain fields, and call ToGraph.

Files:

  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/client.go
  • pkg/providers/dsx/provider_sim.go
  • pkg/providers/dsx/instance_topology_test.go
**/*

📄 CodeRabbit inference engine (AGENTS.md)

**/*: Do not publicly disclose suspected security vulnerabilities; report them privately through NVIDIA PSIRT using the channels documented in SECURITY.md.
Every commit must include a Signed-off-by: trailer for DCO compliance.
Use Conventional Commits with an allowed type such as feat, fix, docs, chore, refactor, test, build, or ci.
Before pushing, run make qualify; all CI checks, including Go build/test/lint, Codecov, and DCO, must be green before merge.
Changes to provider, engine, chart, API, configuration schema, labels, annotations, or user-facing behavior must include the corresponding documentation updates described in the documentation impact table.

Files:

  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/client.go
  • pkg/providers/dsx/provider_sim.go
  • pkg/providers/dsx/instance_topology_test.go
{cmd,pkg,internal}/**/*.go

⚙️ CodeRabbit configuration file

{cmd,pkg,internal}/**/*.go: Focus on correctness, robustness, and failure paths:

  • Check error handling and propagation, including whether callers
    receive enough context to diagnose failures.
  • Verify context propagation, cancellation, timeouts, resource cleanup,
    and goroutine lifecycle.
  • Look for races, deadlocks, unsafe shared state, leaks, and partial
    updates that can leave state inconsistent.
  • Check nil, empty, malformed, duplicate, boundary, and partial inputs.
  • Verify deterministic and idempotent behavior where operations may be
    retried or repeated.
  • Preserve public contracts and the architectural boundaries documented
    in AGENTS.md.
  • Flag behavior changes that lack meaningful regression coverage.

Files:

  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/client.go
  • pkg/providers/dsx/provider_sim.go
  • pkg/providers/dsx/instance_topology_test.go
**/*_test.go

📄 CodeRabbit inference engine (AGENTS.md)

New or changed public behavior and new code paths should be covered by tests.

Files:

  • pkg/providers/dsx/instance_topology_test.go

⚙️ CodeRabbit configuration file

**/*_test.go: Flag missing negative, cancellation, concurrency, malformed-input,
boundary, and regression cases. Check that assertions would fail if
the behavior under test were broken.

Files:

  • pkg/providers/dsx/instance_topology_test.go
🔇 Additional comments (5)
pkg/providers/dsx/client.go (1)

61-108: Add direct HTTP-client regression tests.

The supplied changes still do not add the httptest coverage requested in the prior review for NewHTTPClient(...).GetTopology.

Source: Coding guidelines

pkg/providers/dsx/instance_topology.go (1)

2-209: LGTM!

pkg/providers/dsx/instance_topology_test.go (1)

1-618: LGTM!

pkg/providers/dsx/provider_sim.go (2)

2-14: LGTM!


53-74: LGTM!


📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added support for the DSX topology provider.
    • Added configurable connection settings, optional bearer-token authentication, instance filtering, and tier selection.
    • Added paginated topology retrieval with cross-page relationships, NVLink details, and request safeguards.
    • Added a DSX simulator option for testing topology integrations.
    • Added deterministic topology results by filtering duplicate and empty entries.
  • Documentation

    • Added setup, configuration, authentication, API behavior, pagination, troubleshooting, and verification guidance for DSX.

Walkthrough

Changes

The PR adds the DSX topology provider. It implements configuration loading, authenticated HTTP retrieval, pagination, topology construction, simulation support, registry registration, tests, and documentation.

DSX provider integration

Layer / File(s) Summary
Provider contract and loading
pkg/providers/dsx/provider.go, pkg/providers/dsx/client.go, pkg/providers/dsx/provider_test.go, pkg/providers/dsx/client_test.go, pkg/registry/registry.go
DSX models support ordered switch adjacency entries and pagination. The loader validates configuration and credentials, constructs the HTTP client, registers the provider, and tests request behavior.
Paginated topology construction
pkg/providers/dsx/instance_topology.go, pkg/providers/dsx/instance_topology_test.go
Topology generation deduplicates and sorts node IDs, accumulates pages, detects token cycles and page limits, handles API errors and timeouts, and resolves cross-page fabric relationships.
Simulation compatibility
pkg/providers/dsx/provider_sim.go, pkg/providers/dsx/provider_sim_test.go
The simulation provider emits the ordered switch adjacency format and uses the shared topology builder.
Provider documentation
docs/overview.md, docs/providers/dsx.md
The documentation describes DSX selection, configuration, authentication, requests, pagination, topology translation, verification, and simulation usage.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant generateInstanceTopology
  participant httpClient
  participant DSX_API
  participant buildClusterTopology
  generateInstanceTopology->>httpClient: GetTopology(page token)
  httpClient->>DSX_API: Send topology request
  DSX_API-->>httpClient: Return topology page and next_page_token
  httpClient-->>generateInstanceTopology: Decode topology response
  generateInstanceTopology->>httpClient: Request subsequent pages
  generateInstanceTopology->>buildClusterTopology: Pass accumulated switch data
  buildClusterTopology-->>generateInstanceTopology: Return instance topologies
Loading

Suggested reviewers: dmitsh

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% 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 clearly identifies the main change: implementing the DSX provider.
Description check ✅ Passed The description directly states that the pull request adds the DSX provider implementation.
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 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch rs-dsx

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 `@docs/providers/dsx.md`:
- Line 5: Align the provider documentation with the implementation: remove the
explicit per-VPC endpoint guidance and describe only the global GET
/v1/topology/nodes request, including that it aggregates
topology.ComputeInstances across regions without using Region or a VPC ID.
🪄 Autofix

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: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: a2bce70a-5a15-4992-b38e-92f7d0127b0f

📥 Commits

Reviewing files that changed from the base of the PR and between d617ae4 and c7a6835.

📒 Files selected for processing (10)
  • docs/overview.md
  • docs/providers/dsx.md
  • pkg/providers/dsx/client.go
  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/instance_topology_test.go
  • pkg/providers/dsx/provider.go
  • pkg/providers/dsx/provider_sim.go
  • pkg/providers/dsx/provider_sim_test.go
  • pkg/providers/dsx/provider_test.go
  • pkg/registry/registry.go

Comment thread docs/providers/dsx.md Outdated
@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Comment thread pkg/providers/dsx/instance_topology.go Outdated
Comment thread pkg/providers/dsx/instance_topology.go

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 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 `@docs/providers/dsx.md`:
- Line 130: Update the pagination description near the graph-building
explanation to state that switch entries are accumulated across pages, and the
topology graph is built only after the final page is fetched, when cross-page
ancestry is resolved. Remove the claim that each page is merged before
requesting the next page.

In `@pkg/providers/dsx/client.go`:
- Around line 54-93: Add direct httptest-based regression tests that construct
the real client through NewHTTPClient and call GetTopology, covering both VPC
and node URL paths, query parameter encoding, conditional Authorization headers,
non-2xx responses, and malformed JSON in an otherwise successful response. Keep
the existing mockClient tests unchanged and assert the resulting responses or
errors for each scenario.

In `@pkg/providers/dsx/instance_topology_test.go`:
- Around line 85-199: Extend the topology test table with malformed-input cases:
add a cyclic switch relationship and assert topology construction terminates
without looping, and add repeated occurrences of the same NodeID and assert that
requested instances are emitted only once. Anchor both cases to the existing
topology-building test flow and preserve the current want/wantLen validation
pattern.
🪄 Autofix

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: ASSERTIVE

Plan: Enterprise

Run ID: f1a02019-1f1b-4693-9d8c-cf2fc4ef81f1

📥 Commits

Reviewing files that changed from the base of the PR and between c7a6835 and 2967041.

📒 Files selected for processing (3)
  • docs/providers/dsx.md
  • pkg/providers/dsx/client.go
  • pkg/providers/dsx/instance_topology_test.go
📜 Review details
⏰ Context from checks skipped due to timeout. (1)
  • GitHub Check: Greptile Review
🧰 Additional context used
📓 Path-based instructions (6)
**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

**/*.go: Run go fmt ./...; Go formatting is authoritative and code should not be hand-formatted.
Every new Go file must include the NVIDIA copyright header followed by the matching Apache 2.0 boilerplate.

Files:

  • pkg/providers/dsx/client.go
  • pkg/providers/dsx/instance_topology_test.go
pkg/providers/**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

pkg/providers/**/*.go: Providers must return a *topology.Graph and *httperr.Error; plain error is not acceptable at the provider interface boundary.
Providers discover topology and return the canonical topology.Graph; they must not emit scheduler-specific output.
When using ClusterTopology, populate fabric tiers closest-first, preserve optional accelerator domain and sub-domain fields, and call ToGraph.

Files:

  • pkg/providers/dsx/client.go
  • pkg/providers/dsx/instance_topology_test.go
**/*

📄 CodeRabbit inference engine (AGENTS.md)

**/*: Do not publicly disclose suspected security vulnerabilities; report them privately through NVIDIA PSIRT using the channels documented in SECURITY.md.
Every commit must include a Signed-off-by: trailer for DCO compliance.
Use Conventional Commits with an allowed type such as feat, fix, docs, chore, refactor, test, build, or ci.
Before pushing, run make qualify; all CI checks, including Go build/test/lint, Codecov, and DCO, must be green before merge.
Changes to provider, engine, chart, API, configuration schema, labels, annotations, or user-facing behavior must include the corresponding documentation updates described in the documentation impact table.

Files:

  • pkg/providers/dsx/client.go
  • docs/providers/dsx.md
  • pkg/providers/dsx/instance_topology_test.go
{cmd,pkg,internal}/**/*.go

⚙️ CodeRabbit configuration file

{cmd,pkg,internal}/**/*.go: Focus on correctness, robustness, and failure paths:

  • Check error handling and propagation, including whether callers
    receive enough context to diagnose failures.
  • Verify context propagation, cancellation, timeouts, resource cleanup,
    and goroutine lifecycle.
  • Look for races, deadlocks, unsafe shared state, leaks, and partial
    updates that can leave state inconsistent.
  • Check nil, empty, malformed, duplicate, boundary, and partial inputs.
  • Verify deterministic and idempotent behavior where operations may be
    retried or repeated.
  • Preserve public contracts and the architectural boundaries documented
    in AGENTS.md.
  • Flag behavior changes that lack meaningful regression coverage.

Files:

  • pkg/providers/dsx/client.go
  • pkg/providers/dsx/instance_topology_test.go
docs/providers/**/*.md

📄 CodeRabbit inference engine (AGENTS.md)

Provider additions or changes require the corresponding provider documentation, including prerequisites, credentials, parameters, operation, and verification.

Files:

  • docs/providers/dsx.md
**/*_test.go

📄 CodeRabbit inference engine (AGENTS.md)

New or changed public behavior and new code paths should be covered by tests.

Files:

  • pkg/providers/dsx/instance_topology_test.go

⚙️ CodeRabbit configuration file

**/*_test.go: Flag missing negative, cancellation, concurrency, malformed-input,
boundary, and regression cases. Check that assertions would fail if
the behavior under test were broken.

Files:

  • pkg/providers/dsx/instance_topology_test.go

Comment thread docs/providers/dsx.md Outdated
Comment thread pkg/providers/dsx/client.go
Comment thread pkg/providers/dsx/instance_topology_test.go

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 6

🤖 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 `@pkg/providers/dsx/client_test.go`:
- Around line 64-179: Add a caller-cancellation case to
TestHTTPClientGetTopology using a blocking httptest.Server handler that signals
request receipt, then cancel the context and release or observe the blocked
request. Invoke GetTopology with that context and assert it returns an error
with a nil response promptly, without waiting for requestTimeout, while
preserving the existing table-driven coverage.
- Around line 183-186: Update the query-parameter assertions in the test loop
over tc.wantQuery: when want is empty, assert cap.query does not contain param
instead of using url.Values.Get; retain require.Equal for non-empty expected
values. Ensure the empty nodeIDs and zero pageSize cases fail if the client
sends those parameters with empty values.

In `@pkg/providers/dsx/instance_topology_test.go`:
- Around line 38-50: Extend mockClient.GetTopology to record each request’s
pageSize and pageToken, then update
TestGenerateInstanceTopologyCrossPageAncestry to assert tokens ["", "page2"] and
verify a configured page size is forwarded unchanged on every call. Ensure the
assertions inspect the recorded arguments so they fail if
generateInstanceTopology stops propagating the response token or configured page
size.

In `@pkg/providers/dsx/instance_topology.go`:
- Around line 89-93: Validate the successful result from Client.GetTopology
before accessing response.Switches: when response is nil and apiErr is nil,
return an httperr.NewError with HTTP 502 instead of dereferencing it. Add a
regression test using a client that returns nil, nil and verify the gateway
error is returned.
- Around line 48-61: After building nodeIDs in the topology-fetch flow, return
topology.NewClusterTopology() immediately when nodeIDs is empty, without calling
httpClient.GetTopology. Update the affected test in
pkg/providers/dsx/instance_topology_test.go:448-463 to expect an empty topology,
zero client calls, and mc.idx == 0; the production change is in
pkg/providers/dsx/instance_topology.go:48-61.
- Around line 53-60: Update the node ID collection near want and nodeIDs so each
instance ID is appended only when first inserted into want, preventing
duplicates across cis entries. After collecting all IDs, sort nodeIDs before the
first GetTopology call to ensure deterministic requests.
🪄 Autofix

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: ASSERTIVE

Plan: Enterprise

Run ID: c4754ea9-f326-443d-8e67-4c959475b0ec

📥 Commits

Reviewing files that changed from the base of the PR and between 2967041 and b761857.

📒 Files selected for processing (4)
  • docs/providers/dsx.md
  • pkg/providers/dsx/client_test.go
  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/instance_topology_test.go
📜 Review details
🧰 Additional context used
📓 Path-based instructions (6)
**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

**/*.go: Run go fmt ./...; Go formatting is authoritative and code should not be hand-formatted.
Every new Go file must include the NVIDIA copyright header followed by the matching Apache 2.0 boilerplate.

Files:

  • pkg/providers/dsx/client_test.go
  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/instance_topology_test.go
pkg/providers/**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

pkg/providers/**/*.go: Providers must return a *topology.Graph and *httperr.Error; plain error is not acceptable at the provider interface boundary.
Providers discover topology and return the canonical topology.Graph; they must not emit scheduler-specific output.
When using ClusterTopology, populate fabric tiers closest-first, preserve optional accelerator domain and sub-domain fields, and call ToGraph.

Files:

  • pkg/providers/dsx/client_test.go
  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/instance_topology_test.go
**/*_test.go

📄 CodeRabbit inference engine (AGENTS.md)

New or changed public behavior and new code paths should be covered by tests.

Files:

  • pkg/providers/dsx/client_test.go
  • pkg/providers/dsx/instance_topology_test.go

⚙️ CodeRabbit configuration file

**/*_test.go: Flag missing negative, cancellation, concurrency, malformed-input,
boundary, and regression cases. Check that assertions would fail if
the behavior under test were broken.

Files:

  • pkg/providers/dsx/client_test.go
  • pkg/providers/dsx/instance_topology_test.go
**/*

📄 CodeRabbit inference engine (AGENTS.md)

**/*: Do not publicly disclose suspected security vulnerabilities; report them privately through NVIDIA PSIRT using the channels documented in SECURITY.md.
Every commit must include a Signed-off-by: trailer for DCO compliance.
Use Conventional Commits with an allowed type such as feat, fix, docs, chore, refactor, test, build, or ci.
Before pushing, run make qualify; all CI checks, including Go build/test/lint, Codecov, and DCO, must be green before merge.
Changes to provider, engine, chart, API, configuration schema, labels, annotations, or user-facing behavior must include the corresponding documentation updates described in the documentation impact table.

Files:

  • pkg/providers/dsx/client_test.go
  • docs/providers/dsx.md
  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/instance_topology_test.go
{cmd,pkg,internal}/**/*.go

⚙️ CodeRabbit configuration file

{cmd,pkg,internal}/**/*.go: Focus on correctness, robustness, and failure paths:

  • Check error handling and propagation, including whether callers
    receive enough context to diagnose failures.
  • Verify context propagation, cancellation, timeouts, resource cleanup,
    and goroutine lifecycle.
  • Look for races, deadlocks, unsafe shared state, leaks, and partial
    updates that can leave state inconsistent.
  • Check nil, empty, malformed, duplicate, boundary, and partial inputs.
  • Verify deterministic and idempotent behavior where operations may be
    retried or repeated.
  • Preserve public contracts and the architectural boundaries documented
    in AGENTS.md.
  • Flag behavior changes that lack meaningful regression coverage.

Files:

  • pkg/providers/dsx/client_test.go
  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/instance_topology_test.go
docs/providers/**/*.md

📄 CodeRabbit inference engine (AGENTS.md)

Provider additions or changes require the corresponding provider documentation, including prerequisites, credentials, parameters, operation, and verification.

Files:

  • docs/providers/dsx.md
🔇 Additional comments (6)
docs/providers/dsx.md (1)

1-170: LGTM!

pkg/providers/dsx/client_test.go (1)

1-62: LGTM!

pkg/providers/dsx/instance_topology.go (2)

2-45: LGTM!


108-170: LGTM!

pkg/providers/dsx/instance_topology_test.go (2)

63-242: LGTM!


465-491: LGTM!

Comment thread pkg/providers/dsx/client_test.go
Comment thread pkg/providers/dsx/client_test.go
Comment thread pkg/providers/dsx/instance_topology_test.go Outdated
Comment thread pkg/providers/dsx/instance_topology.go
Comment thread pkg/providers/dsx/instance_topology.go Outdated
Comment thread pkg/providers/dsx/instance_topology.go

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 `@pkg/providers/dsx/instance_topology_test.go`:
- Around line 40-54: Update mockClient.GetTopology to record a copy of the
nodeIDs argument, preserving each request’s IDs for assertions. Extend the
generateInstanceTopology tests with duplicate IDs across ComputeInstances
groups, then assert a request contains the sorted, unique IDs; ensure the
assertion would fail if deduplication or sorting were removed.

In `@pkg/providers/dsx/instance_topology.go`:
- Around line 153-167: Prevent duplicate fabric tiers in the tierIDs
construction around parentOf ancestry by tracking already emitted IDs and
skipping repeated spineID or coreID values, while preserving closest-first
ordering and non-empty filtering. Update pkg/providers/dsx/instance_topology.go
lines 153-167 and add an assertion in
pkg/providers/dsx/instance_topology_test.go lines 206-220 that cyclic input
produces unique FabricTiers IDs.
🪄 Autofix

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: ASSERTIVE

Plan: Enterprise

Run ID: 709bbaf3-42c0-4960-a8b5-281b41fd0aba

📥 Commits

Reviewing files that changed from the base of the PR and between b761857 and e99a00d.

📒 Files selected for processing (3)
  • pkg/providers/dsx/client_test.go
  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/instance_topology_test.go
📜 Review details
⏰ Context from checks skipped due to timeout. (1)
  • GitHub Check: Greptile Review
🧰 Additional context used
📓 Path-based instructions (5)
**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

**/*.go: Run go fmt ./...; Go formatting is authoritative and code should not be hand-formatted.
Every new Go file must include the NVIDIA copyright header followed by the matching Apache 2.0 boilerplate.

Files:

  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/instance_topology_test.go
  • pkg/providers/dsx/client_test.go
pkg/providers/**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

pkg/providers/**/*.go: Providers must return a *topology.Graph and *httperr.Error; plain error is not acceptable at the provider interface boundary.
Providers discover topology and return the canonical topology.Graph; they must not emit scheduler-specific output.
When using ClusterTopology, populate fabric tiers closest-first, preserve optional accelerator domain and sub-domain fields, and call ToGraph.

Files:

  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/instance_topology_test.go
  • pkg/providers/dsx/client_test.go
**/*

📄 CodeRabbit inference engine (AGENTS.md)

**/*: Do not publicly disclose suspected security vulnerabilities; report them privately through NVIDIA PSIRT using the channels documented in SECURITY.md.
Every commit must include a Signed-off-by: trailer for DCO compliance.
Use Conventional Commits with an allowed type such as feat, fix, docs, chore, refactor, test, build, or ci.
Before pushing, run make qualify; all CI checks, including Go build/test/lint, Codecov, and DCO, must be green before merge.
Changes to provider, engine, chart, API, configuration schema, labels, annotations, or user-facing behavior must include the corresponding documentation updates described in the documentation impact table.

Files:

  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/instance_topology_test.go
  • pkg/providers/dsx/client_test.go
{cmd,pkg,internal}/**/*.go

⚙️ CodeRabbit configuration file

{cmd,pkg,internal}/**/*.go: Focus on correctness, robustness, and failure paths:

  • Check error handling and propagation, including whether callers
    receive enough context to diagnose failures.
  • Verify context propagation, cancellation, timeouts, resource cleanup,
    and goroutine lifecycle.
  • Look for races, deadlocks, unsafe shared state, leaks, and partial
    updates that can leave state inconsistent.
  • Check nil, empty, malformed, duplicate, boundary, and partial inputs.
  • Verify deterministic and idempotent behavior where operations may be
    retried or repeated.
  • Preserve public contracts and the architectural boundaries documented
    in AGENTS.md.
  • Flag behavior changes that lack meaningful regression coverage.

Files:

  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/instance_topology_test.go
  • pkg/providers/dsx/client_test.go
**/*_test.go

📄 CodeRabbit inference engine (AGENTS.md)

New or changed public behavior and new code paths should be covered by tests.

Files:

  • pkg/providers/dsx/instance_topology_test.go
  • pkg/providers/dsx/client_test.go

⚙️ CodeRabbit configuration file

**/*_test.go: Flag missing negative, cancellation, concurrency, malformed-input,
boundary, and regression cases. Check that assertions would fail if
the behavior under test were broken.

Files:

  • pkg/providers/dsx/instance_topology_test.go
  • pkg/providers/dsx/client_test.go
🔇 Additional comments (1)
pkg/providers/dsx/client_test.go (1)

1-244: LGTM!

Comment thread pkg/providers/dsx/instance_topology_test.go Outdated
Comment thread pkg/providers/dsx/instance_topology.go Outdated
Comment thread pkg/providers/dsx/instance_topology.go

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 `@pkg/providers/dsx/instance_topology_test.go`:
- Around line 408-425: Update the comment in
TestGenerateInstanceTopologyTotalTimeout to state that the stalled request must
return a 422 Unprocessable Entity, matching the http.StatusUnprocessableEntity
assertion and generateInstanceTopology behavior; leave the test logic unchanged.

In `@pkg/providers/dsx/instance_topology.go`:
- Around line 99-111: Update the apiErr handling around client.GetTopology in
the topology-generation flow to check the parent ctx cancellation before
treating genCtx.Err() as a total-generation deadline. Return a separate
cancellation error when ctx is canceled, while preserving the existing deadline
message for totalGenerationTimeout expiry and the BadGateway path for other API
errors.
🪄 Autofix

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: ASSERTIVE

Plan: Enterprise

Run ID: d61761d0-b63e-497f-b281-794047297cb5

📥 Commits

Reviewing files that changed from the base of the PR and between e99a00d and f567506.

📒 Files selected for processing (2)
  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/instance_topology_test.go
📜 Review details
⏰ Context from checks skipped due to timeout. (1)
  • GitHub Check: Greptile Review
🧰 Additional context used
📓 Path-based instructions (5)
**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

**/*.go: Run go fmt ./...; Go formatting is authoritative and code should not be hand-formatted.
Every new Go file must include the NVIDIA copyright header followed by the matching Apache 2.0 boilerplate.

Files:

  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/instance_topology_test.go
pkg/providers/**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

pkg/providers/**/*.go: Providers must return a *topology.Graph and *httperr.Error; plain error is not acceptable at the provider interface boundary.
Providers discover topology and return the canonical topology.Graph; they must not emit scheduler-specific output.
When using ClusterTopology, populate fabric tiers closest-first, preserve optional accelerator domain and sub-domain fields, and call ToGraph.

Files:

  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/instance_topology_test.go
**/*

📄 CodeRabbit inference engine (AGENTS.md)

**/*: Do not publicly disclose suspected security vulnerabilities; report them privately through NVIDIA PSIRT using the channels documented in SECURITY.md.
Every commit must include a Signed-off-by: trailer for DCO compliance.
Use Conventional Commits with an allowed type such as feat, fix, docs, chore, refactor, test, build, or ci.
Before pushing, run make qualify; all CI checks, including Go build/test/lint, Codecov, and DCO, must be green before merge.
Changes to provider, engine, chart, API, configuration schema, labels, annotations, or user-facing behavior must include the corresponding documentation updates described in the documentation impact table.

Files:

  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/instance_topology_test.go
{cmd,pkg,internal}/**/*.go

⚙️ CodeRabbit configuration file

{cmd,pkg,internal}/**/*.go: Focus on correctness, robustness, and failure paths:

  • Check error handling and propagation, including whether callers
    receive enough context to diagnose failures.
  • Verify context propagation, cancellation, timeouts, resource cleanup,
    and goroutine lifecycle.
  • Look for races, deadlocks, unsafe shared state, leaks, and partial
    updates that can leave state inconsistent.
  • Check nil, empty, malformed, duplicate, boundary, and partial inputs.
  • Verify deterministic and idempotent behavior where operations may be
    retried or repeated.
  • Preserve public contracts and the architectural boundaries documented
    in AGENTS.md.
  • Flag behavior changes that lack meaningful regression coverage.

Files:

  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/instance_topology_test.go
**/*_test.go

📄 CodeRabbit inference engine (AGENTS.md)

New or changed public behavior and new code paths should be covered by tests.

Files:

  • pkg/providers/dsx/instance_topology_test.go

⚙️ CodeRabbit configuration file

**/*_test.go: Flag missing negative, cancellation, concurrency, malformed-input,
boundary, and regression cases. Check that assertions would fail if
the behavior under test were broken.

Files:

  • pkg/providers/dsx/instance_topology_test.go
🔇 Additional comments (5)
pkg/providers/dsx/instance_topology.go (3)

2-14: LGTM!

Also applies to: 23-46, 54-70


112-126: LGTM!


128-187: LGTM!

pkg/providers/dsx/instance_topology_test.go (2)

1-59: LGTM!

Also applies to: 61-258


264-407: LGTM!

Also applies to: 427-542

Comment thread pkg/providers/dsx/instance_topology_test.go
Comment thread pkg/providers/dsx/instance_topology.go

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 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 `@pkg/providers/dsx/instance_topology_test.go`:
- Around line 464-466: Update the test assertions around the page-limit error to
also verify that the mock client index is 3, confirming maxPaginationPages
prevents a fourth GetTopology request. Retain the existing error status and
message assertions.
- Around line 404-405: Update TestGenerateInstanceTopologyContextCancelled and
TestGenerateInstanceTopologyTotalTimeout to assert the expected error
classifications in addition to HTTP 422: “context cancelled” for caller
cancellation and “DSX topology generation deadline exceeded” for the total
timeout. Ensure these assertions distinguish the two error paths and fail if
generateInstanceTopology incorrectly routes either case through the other
classification.

In `@pkg/providers/dsx/instance_topology.go`:
- Around line 139-147: Make multi-key SwitchEntry processing deterministic in
the topology-building logic: collect and sort switch names before both
map-iteration passes, then use that ordered list when selecting parents and
appending instances. Preserve the existing warning for malformed entries, and
add a regression test covering a multi-key entry to verify deterministic,
idempotent ordering across repeated runs.
🪄 Autofix

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: ASSERTIVE

Plan: Enterprise

Run ID: 05ed62aa-c854-48a3-8cb7-652baea9e4b9

📥 Commits

Reviewing files that changed from the base of the PR and between f567506 and d98f8be.

📒 Files selected for processing (2)
  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/instance_topology_test.go
📜 Review details
⏰ Context from checks skipped due to timeout. (1)
  • GitHub Check: Greptile Review
🧰 Additional context used
📓 Path-based instructions (5)
**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

**/*.go: Run go fmt ./...; Go formatting is authoritative and code should not be hand-formatted.
Every new Go file must include the NVIDIA copyright header followed by the matching Apache 2.0 boilerplate.

Files:

  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/instance_topology_test.go
pkg/providers/**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

pkg/providers/**/*.go: Providers must return a *topology.Graph and *httperr.Error; plain error is not acceptable at the provider interface boundary.
Providers discover topology and return the canonical topology.Graph; they must not emit scheduler-specific output.
When using ClusterTopology, populate fabric tiers closest-first, preserve optional accelerator domain and sub-domain fields, and call ToGraph.

Files:

  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/instance_topology_test.go
**/*

📄 CodeRabbit inference engine (AGENTS.md)

**/*: Do not publicly disclose suspected security vulnerabilities; report them privately through NVIDIA PSIRT using the channels documented in SECURITY.md.
Every commit must include a Signed-off-by: trailer for DCO compliance.
Use Conventional Commits with an allowed type such as feat, fix, docs, chore, refactor, test, build, or ci.
Before pushing, run make qualify; all CI checks, including Go build/test/lint, Codecov, and DCO, must be green before merge.
Changes to provider, engine, chart, API, configuration schema, labels, annotations, or user-facing behavior must include the corresponding documentation updates described in the documentation impact table.

Files:

  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/instance_topology_test.go
{cmd,pkg,internal}/**/*.go

⚙️ CodeRabbit configuration file

{cmd,pkg,internal}/**/*.go: Focus on correctness, robustness, and failure paths:

  • Check error handling and propagation, including whether callers
    receive enough context to diagnose failures.
  • Verify context propagation, cancellation, timeouts, resource cleanup,
    and goroutine lifecycle.
  • Look for races, deadlocks, unsafe shared state, leaks, and partial
    updates that can leave state inconsistent.
  • Check nil, empty, malformed, duplicate, boundary, and partial inputs.
  • Verify deterministic and idempotent behavior where operations may be
    retried or repeated.
  • Preserve public contracts and the architectural boundaries documented
    in AGENTS.md.
  • Flag behavior changes that lack meaningful regression coverage.

Files:

  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/instance_topology_test.go
**/*_test.go

📄 CodeRabbit inference engine (AGENTS.md)

New or changed public behavior and new code paths should be covered by tests.

Files:

  • pkg/providers/dsx/instance_topology_test.go

⚙️ CodeRabbit configuration file

**/*_test.go: Flag missing negative, cancellation, concurrency, malformed-input,
boundary, and regression cases. Check that assertions would fail if
the behavior under test were broken.

Files:

  • pkg/providers/dsx/instance_topology_test.go

Comment thread pkg/providers/dsx/instance_topology_test.go
Comment thread pkg/providers/dsx/instance_topology_test.go
Comment thread pkg/providers/dsx/instance_topology.go

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 `@pkg/providers/dsx/instance_topology.go`:
- Around line 184-193: The buildClusterTopology logic in
pkg/providers/dsx/instance_topology.go lines 184-193 must exclude empty swName
values or otherwise construct tierIDs using only non-empty IDs, preventing empty
fabric tier IDs while preserving duplicate filtering. Add a malformed-input test
in pkg/providers/dsx/instance_topology_test.go lines 234-271 with a SwitchEntry
keyed by "" and assert that no emitted FabricTiers entry contains an empty ID.
🪄 Autofix

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: ASSERTIVE

Plan: Enterprise

Run ID: f3165864-adc1-44e1-8ec0-947cf73bfd45

📥 Commits

Reviewing files that changed from the base of the PR and between d98f8be and 9aa0b8b.

📒 Files selected for processing (2)
  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/instance_topology_test.go
📜 Review details
⏰ Context from checks skipped due to timeout. (1)
  • GitHub Check: Greptile Review
🧰 Additional context used
📓 Path-based instructions (5)
**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

**/*.go: Run go fmt ./...; Go formatting is authoritative and code should not be hand-formatted.
Every new Go file must include the NVIDIA copyright header followed by the matching Apache 2.0 boilerplate.

Files:

  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/instance_topology_test.go
pkg/providers/**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

pkg/providers/**/*.go: Providers must return a *topology.Graph and *httperr.Error; plain error is not acceptable at the provider interface boundary.
Providers discover topology and return the canonical topology.Graph; they must not emit scheduler-specific output.
When using ClusterTopology, populate fabric tiers closest-first, preserve optional accelerator domain and sub-domain fields, and call ToGraph.

Files:

  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/instance_topology_test.go
**/*

📄 CodeRabbit inference engine (AGENTS.md)

**/*: Do not publicly disclose suspected security vulnerabilities; report them privately through NVIDIA PSIRT using the channels documented in SECURITY.md.
Every commit must include a Signed-off-by: trailer for DCO compliance.
Use Conventional Commits with an allowed type such as feat, fix, docs, chore, refactor, test, build, or ci.
Before pushing, run make qualify; all CI checks, including Go build/test/lint, Codecov, and DCO, must be green before merge.
Changes to provider, engine, chart, API, configuration schema, labels, annotations, or user-facing behavior must include the corresponding documentation updates described in the documentation impact table.

Files:

  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/instance_topology_test.go
{cmd,pkg,internal}/**/*.go

⚙️ CodeRabbit configuration file

{cmd,pkg,internal}/**/*.go: Focus on correctness, robustness, and failure paths:

  • Check error handling and propagation, including whether callers
    receive enough context to diagnose failures.
  • Verify context propagation, cancellation, timeouts, resource cleanup,
    and goroutine lifecycle.
  • Look for races, deadlocks, unsafe shared state, leaks, and partial
    updates that can leave state inconsistent.
  • Check nil, empty, malformed, duplicate, boundary, and partial inputs.
  • Verify deterministic and idempotent behavior where operations may be
    retried or repeated.
  • Preserve public contracts and the architectural boundaries documented
    in AGENTS.md.
  • Flag behavior changes that lack meaningful regression coverage.

Files:

  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/instance_topology_test.go
**/*_test.go

📄 CodeRabbit inference engine (AGENTS.md)

New or changed public behavior and new code paths should be covered by tests.

Files:

  • pkg/providers/dsx/instance_topology_test.go

⚙️ CodeRabbit configuration file

**/*_test.go: Flag missing negative, cancellation, concurrency, malformed-input,
boundary, and regression cases. Check that assertions would fail if
the behavior under test were broken.

Files:

  • pkg/providers/dsx/instance_topology_test.go
🔇 Additional comments (9)
pkg/providers/dsx/instance_topology.go (4)

2-14: LGTM!

Also applies to: 23-30


32-46: LGTM!


48-75: LGTM!


87-127: LGTM!

pkg/providers/dsx/instance_topology_test.go (5)

1-65: LGTM!


71-233: LGTM!


289-358: LGTM!


360-452: LGTM!


454-570: LGTM!

Comment thread pkg/providers/dsx/instance_topology.go Outdated
Comment thread pkg/providers/dsx/instance_topology.go

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 `@pkg/providers/dsx/instance_topology.go`:
- Around line 58-63: The instance topology collection must reject or skip empty
instance IDs before updating want and nodeIDs, preventing Client.GetTopology
from receiving an empty node filter; update the instanceID loop in
pkg/providers/dsx/instance_topology.go:58-63 accordingly. Add coverage in
pkg/providers/dsx/instance_topology_test.go:535-543 for an empty-key
ComputeInstances.Instances case, asserting the chosen error behavior or that
GetTopology is not called.
🪄 Autofix

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: ASSERTIVE

Plan: Enterprise

Run ID: c97cc928-e782-48b0-8475-6c5a2604ee9b

📥 Commits

Reviewing files that changed from the base of the PR and between 9aa0b8b and 3fbf3d1.

📒 Files selected for processing (2)
  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/instance_topology_test.go
📜 Review details
⏰ Context from checks skipped due to timeout. (1)
  • GitHub Check: Greptile Review
🧰 Additional context used
📓 Path-based instructions (5)
**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

**/*.go: Run go fmt ./...; Go formatting is authoritative and code should not be hand-formatted.
Every new Go file must include the NVIDIA copyright header followed by the matching Apache 2.0 boilerplate.

Files:

  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/instance_topology_test.go
pkg/providers/**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

pkg/providers/**/*.go: Providers must return a *topology.Graph and *httperr.Error; plain error is not acceptable at the provider interface boundary.
Providers discover topology and return the canonical topology.Graph; they must not emit scheduler-specific output.
When using ClusterTopology, populate fabric tiers closest-first, preserve optional accelerator domain and sub-domain fields, and call ToGraph.

Files:

  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/instance_topology_test.go
**/*

📄 CodeRabbit inference engine (AGENTS.md)

**/*: Do not publicly disclose suspected security vulnerabilities; report them privately through NVIDIA PSIRT using the channels documented in SECURITY.md.
Every commit must include a Signed-off-by: trailer for DCO compliance.
Use Conventional Commits with an allowed type such as feat, fix, docs, chore, refactor, test, build, or ci.
Before pushing, run make qualify; all CI checks, including Go build/test/lint, Codecov, and DCO, must be green before merge.
Changes to provider, engine, chart, API, configuration schema, labels, annotations, or user-facing behavior must include the corresponding documentation updates described in the documentation impact table.

Files:

  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/instance_topology_test.go
{cmd,pkg,internal}/**/*.go

⚙️ CodeRabbit configuration file

{cmd,pkg,internal}/**/*.go: Focus on correctness, robustness, and failure paths:

  • Check error handling and propagation, including whether callers
    receive enough context to diagnose failures.
  • Verify context propagation, cancellation, timeouts, resource cleanup,
    and goroutine lifecycle.
  • Look for races, deadlocks, unsafe shared state, leaks, and partial
    updates that can leave state inconsistent.
  • Check nil, empty, malformed, duplicate, boundary, and partial inputs.
  • Verify deterministic and idempotent behavior where operations may be
    retried or repeated.
  • Preserve public contracts and the architectural boundaries documented
    in AGENTS.md.
  • Flag behavior changes that lack meaningful regression coverage.

Files:

  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/instance_topology_test.go
**/*_test.go

📄 CodeRabbit inference engine (AGENTS.md)

New or changed public behavior and new code paths should be covered by tests.

Files:

  • pkg/providers/dsx/instance_topology_test.go

⚙️ CodeRabbit configuration file

**/*_test.go: Flag missing negative, cancellation, concurrency, malformed-input,
boundary, and regression cases. Check that assertions would fail if
the behavior under test were broken.

Files:

  • pkg/providers/dsx/instance_topology_test.go
🔇 Additional comments (4)
pkg/providers/dsx/instance_topology.go (2)

2-46: LGTM!


72-142: LGTM!

pkg/providers/dsx/instance_topology_test.go (2)

31-533: LGTM!


545-608: LGTM!

Comment thread pkg/providers/dsx/instance_topology.go
Comment thread pkg/providers/dsx/instance_topology.go Outdated
Comment thread pkg/providers/dsx/instance_topology.go
@ravisoundar
ravisoundar force-pushed the rs-dsx branch 2 times, most recently from 9df43dc to 51763db Compare August 10, 2026 19:21

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 `@pkg/providers/dsx/instance_topology_test.go`:
- Around line 210-232: Strengthen the checkInst assertion in the “multi-key
SwitchEntry is processed deterministically” test to verify that topo.Instances
is emitted in the exact ID order ["n1", "n2"], while retaining the existing
fabric-tier checks. Use an order-sensitive assertion so the test fails if
sortedEntryKeys is removed and map iteration changes the instance order.

In `@pkg/providers/dsx/instance_topology.go`:
- Around line 117-120: Classify non-cancellation DSX client failures as gateway
errors by changing the error status returned in
pkg/providers/dsx/instance_topology.go lines 117-120 from
http.StatusUnprocessableEntity to http.StatusBadGateway while preserving the
existing context. Update the expectation in
pkg/providers/dsx/instance_topology_test.go lines 375-392 for “backend
unavailable” to use http.StatusBadGateway.
🪄 Autofix

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: ASSERTIVE

Plan: Enterprise

Run ID: 607c0a28-fbc5-4471-908f-34053876391f

📥 Commits

Reviewing files that changed from the base of the PR and between 9df43dc and 51763db.

📒 Files selected for processing (4)
  • pkg/providers/dsx/client.go
  • pkg/providers/dsx/client_test.go
  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/instance_topology_test.go
📜 Review details
⏰ Context from checks skipped due to timeout. (1)
  • GitHub Check: Greptile Review
🧰 Additional context used
📓 Path-based instructions (5)
**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

**/*.go: Run go fmt ./...; Go formatting is authoritative and code should not be hand-formatted.
Every new Go file must include the NVIDIA copyright header followed by the matching Apache 2.0 boilerplate.

Files:

  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/client.go
  • pkg/providers/dsx/instance_topology_test.go
  • pkg/providers/dsx/client_test.go
pkg/providers/**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

pkg/providers/**/*.go: Providers must return a *topology.Graph and *httperr.Error; plain error is not acceptable at the provider interface boundary.
Providers discover topology and return the canonical topology.Graph; they must not emit scheduler-specific output.
When using ClusterTopology, populate fabric tiers closest-first, preserve optional accelerator domain and sub-domain fields, and call ToGraph.

Files:

  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/client.go
  • pkg/providers/dsx/instance_topology_test.go
  • pkg/providers/dsx/client_test.go
**/*

📄 CodeRabbit inference engine (AGENTS.md)

**/*: Do not publicly disclose suspected security vulnerabilities; report them privately through NVIDIA PSIRT using the channels documented in SECURITY.md.
Every commit must include a Signed-off-by: trailer for DCO compliance.
Use Conventional Commits with an allowed type such as feat, fix, docs, chore, refactor, test, build, or ci.
Before pushing, run make qualify; all CI checks, including Go build/test/lint, Codecov, and DCO, must be green before merge.
Changes to provider, engine, chart, API, configuration schema, labels, annotations, or user-facing behavior must include the corresponding documentation updates described in the documentation impact table.

Files:

  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/client.go
  • pkg/providers/dsx/instance_topology_test.go
  • pkg/providers/dsx/client_test.go
{cmd,pkg,internal}/**/*.go

⚙️ CodeRabbit configuration file

{cmd,pkg,internal}/**/*.go: Focus on correctness, robustness, and failure paths:

  • Check error handling and propagation, including whether callers
    receive enough context to diagnose failures.
  • Verify context propagation, cancellation, timeouts, resource cleanup,
    and goroutine lifecycle.
  • Look for races, deadlocks, unsafe shared state, leaks, and partial
    updates that can leave state inconsistent.
  • Check nil, empty, malformed, duplicate, boundary, and partial inputs.
  • Verify deterministic and idempotent behavior where operations may be
    retried or repeated.
  • Preserve public contracts and the architectural boundaries documented
    in AGENTS.md.
  • Flag behavior changes that lack meaningful regression coverage.

Files:

  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/client.go
  • pkg/providers/dsx/instance_topology_test.go
  • pkg/providers/dsx/client_test.go
**/*_test.go

📄 CodeRabbit inference engine (AGENTS.md)

New or changed public behavior and new code paths should be covered by tests.

Files:

  • pkg/providers/dsx/instance_topology_test.go
  • pkg/providers/dsx/client_test.go

⚙️ CodeRabbit configuration file

**/*_test.go: Flag missing negative, cancellation, concurrency, malformed-input,
boundary, and regression cases. Check that assertions would fail if
the behavior under test were broken.

Files:

  • pkg/providers/dsx/instance_topology_test.go
  • pkg/providers/dsx/client_test.go
🔇 Additional comments (2)
pkg/providers/dsx/client.go (1)

1-106: LGTM!

pkg/providers/dsx/client_test.go (1)

32-256: LGTM!

Comment thread pkg/providers/dsx/instance_topology_test.go
Comment thread pkg/providers/dsx/instance_topology.go Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 `@pkg/providers/dsx/instance_topology_test.go`:
- Around line 242-246: Update the checkInst assertion in the
buildClusterTopology test case for the empty SwitchEntry key to assert the exact
expected length of topo.Instances[0].FabricTiers before validating tier IDs,
ensuring the test fails when tiers are unexpectedly omitted or emitted.
🪄 Autofix

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: ASSERTIVE

Plan: Enterprise

Run ID: a5f73d7b-96b8-4e42-8dd4-19c7dfdcccf4

📥 Commits

Reviewing files that changed from the base of the PR and between 51763db and 7000545.

📒 Files selected for processing (2)
  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/instance_topology_test.go
📜 Review details
🧰 Additional context used
📓 Path-based instructions (5)
**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

**/*.go: Run go fmt ./...; Go formatting is authoritative and code should not be hand-formatted.
Every new Go file must include the NVIDIA copyright header followed by the matching Apache 2.0 boilerplate.

Files:

  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/instance_topology_test.go
pkg/providers/**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

pkg/providers/**/*.go: Providers must return a *topology.Graph and *httperr.Error; plain error is not acceptable at the provider interface boundary.
Providers discover topology and return the canonical topology.Graph; they must not emit scheduler-specific output.
When using ClusterTopology, populate fabric tiers closest-first, preserve optional accelerator domain and sub-domain fields, and call ToGraph.

Files:

  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/instance_topology_test.go
**/*

📄 CodeRabbit inference engine (AGENTS.md)

**/*: Do not publicly disclose suspected security vulnerabilities; report them privately through NVIDIA PSIRT using the channels documented in SECURITY.md.
Every commit must include a Signed-off-by: trailer for DCO compliance.
Use Conventional Commits with an allowed type such as feat, fix, docs, chore, refactor, test, build, or ci.
Before pushing, run make qualify; all CI checks, including Go build/test/lint, Codecov, and DCO, must be green before merge.
Changes to provider, engine, chart, API, configuration schema, labels, annotations, or user-facing behavior must include the corresponding documentation updates described in the documentation impact table.

Files:

  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/instance_topology_test.go
{cmd,pkg,internal}/**/*.go

⚙️ CodeRabbit configuration file

{cmd,pkg,internal}/**/*.go: Focus on correctness, robustness, and failure paths:

  • Check error handling and propagation, including whether callers
    receive enough context to diagnose failures.
  • Verify context propagation, cancellation, timeouts, resource cleanup,
    and goroutine lifecycle.
  • Look for races, deadlocks, unsafe shared state, leaks, and partial
    updates that can leave state inconsistent.
  • Check nil, empty, malformed, duplicate, boundary, and partial inputs.
  • Verify deterministic and idempotent behavior where operations may be
    retried or repeated.
  • Preserve public contracts and the architectural boundaries documented
    in AGENTS.md.
  • Flag behavior changes that lack meaningful regression coverage.

Files:

  • pkg/providers/dsx/instance_topology.go
  • pkg/providers/dsx/instance_topology_test.go
**/*_test.go

📄 CodeRabbit inference engine (AGENTS.md)

New or changed public behavior and new code paths should be covered by tests.

Files:

  • pkg/providers/dsx/instance_topology_test.go

⚙️ CodeRabbit configuration file

**/*_test.go: Flag missing negative, cancellation, concurrency, malformed-input,
boundary, and regression cases. Check that assertions would fail if
the behavior under test were broken.

Files:

  • pkg/providers/dsx/instance_topology_test.go
🔇 Additional comments (8)
pkg/providers/dsx/instance_topology.go (5)

2-14: LGTM!

Also applies to: 23-47


49-80: LGTM!


82-136: LGTM!


138-164: LGTM!


166-213: LGTM!

pkg/providers/dsx/instance_topology_test.go (3)

1-65: LGTM!


303-509: LGTM!


511-595: LGTM!

Comment thread pkg/providers/dsx/instance_topology_test.go

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 `@pkg/providers/dsx/instance_topology_test.go`:
- Around line 395-429: Strengthen both cycle-detection tests for
generateInstanceTopology: after the error assertions in
TestGenerateInstanceTopologyDirectCyclePageToken, assert mc.idx equals 2, and
after the assertions in
TestGenerateInstanceTopologyNonConsecutiveCyclePageToken, assert mc.idx equals
3. This verifies pagination stops immediately when a repeated token is received
and prevents an extra GetTopology request.
🪄 Autofix

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: ASSERTIVE

Plan: Enterprise

Run ID: a11eb80c-72de-4de7-9e9e-ad65f54d605d

📥 Commits

Reviewing files that changed from the base of the PR and between 7000545 and 8cdf937.

📒 Files selected for processing (1)
  • pkg/providers/dsx/instance_topology_test.go
📜 Review details
⏰ Context from checks skipped due to timeout. (1)
  • GitHub Check: Greptile Review
🧰 Additional context used
📓 Path-based instructions (5)
**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

**/*.go: Run go fmt ./...; Go formatting is authoritative and code should not be hand-formatted.
Every new Go file must include the NVIDIA copyright header followed by the matching Apache 2.0 boilerplate.

Files:

  • pkg/providers/dsx/instance_topology_test.go
pkg/providers/**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

pkg/providers/**/*.go: Providers must return a *topology.Graph and *httperr.Error; plain error is not acceptable at the provider interface boundary.
Providers discover topology and return the canonical topology.Graph; they must not emit scheduler-specific output.
When using ClusterTopology, populate fabric tiers closest-first, preserve optional accelerator domain and sub-domain fields, and call ToGraph.

Files:

  • pkg/providers/dsx/instance_topology_test.go
**/*_test.go

📄 CodeRabbit inference engine (AGENTS.md)

New or changed public behavior and new code paths should be covered by tests.

Files:

  • pkg/providers/dsx/instance_topology_test.go

⚙️ CodeRabbit configuration file

**/*_test.go: Flag missing negative, cancellation, concurrency, malformed-input,
boundary, and regression cases. Check that assertions would fail if
the behavior under test were broken.

Files:

  • pkg/providers/dsx/instance_topology_test.go
**/*

📄 CodeRabbit inference engine (AGENTS.md)

**/*: Do not publicly disclose suspected security vulnerabilities; report them privately through NVIDIA PSIRT using the channels documented in SECURITY.md.
Every commit must include a Signed-off-by: trailer for DCO compliance.
Use Conventional Commits with an allowed type such as feat, fix, docs, chore, refactor, test, build, or ci.
Before pushing, run make qualify; all CI checks, including Go build/test/lint, Codecov, and DCO, must be green before merge.
Changes to provider, engine, chart, API, configuration schema, labels, annotations, or user-facing behavior must include the corresponding documentation updates described in the documentation impact table.

Files:

  • pkg/providers/dsx/instance_topology_test.go
{cmd,pkg,internal}/**/*.go

⚙️ CodeRabbit configuration file

{cmd,pkg,internal}/**/*.go: Focus on correctness, robustness, and failure paths:

  • Check error handling and propagation, including whether callers
    receive enough context to diagnose failures.
  • Verify context propagation, cancellation, timeouts, resource cleanup,
    and goroutine lifecycle.
  • Look for races, deadlocks, unsafe shared state, leaks, and partial
    updates that can leave state inconsistent.
  • Check nil, empty, malformed, duplicate, boundary, and partial inputs.
  • Verify deterministic and idempotent behavior where operations may be
    retried or repeated.
  • Preserve public contracts and the architectural boundaries documented
    in AGENTS.md.
  • Flag behavior changes that lack meaningful regression coverage.

Files:

  • pkg/providers/dsx/instance_topology_test.go
🔇 Additional comments (1)
pkg/providers/dsx/instance_topology_test.go (1)

1-394: LGTM!

Also applies to: 431-597

Comment thread pkg/providers/dsx/instance_topology_test.go
Signed-off-by: Ravi Shankar <ravish@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.

2 participants