docs: Remove invalid Allocation Constraint endpoints from OpenAPI schema - #584
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughOpenAPI adds UnauthorizedError and expands 400/403/401 responses, removes GET/DELETE for allocation-constraint; generated Go SDK removes corresponding request types, sets Accept: application/json, and decodes NICoAPIError for specific statuses; CI/Makefile lint now skips no-ambiguous-paths. ChangesAPI Contract and SDK Generation
Estimated code review effort🎯 4 (Complex) | ⏱️ ~40 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
🔐 TruffleHog Secret Scan✅ No secrets or credentials found! Your code has been scanned for 700+ types of secrets and credentials. All clear! 🎉 🕐 Last updated: 2026-05-28 21:37:42 UTC | Commit: 3078fa3 |
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 `@Makefile`:
- Line 674: The Makefile command currently uses "npx `@redocly/cli` lint
--skip-rule=no-ambiguous-paths ./openapi/spec.yaml", which causes local lint to
diverge from CI; either remove the "--skip-rule=no-ambiguous-paths" flag from
that Makefile target so local lint matches CI, or move the rule override into
the shared Redocly config (e.g., add the no-ambiguous-paths rule disable to the
repo-wide Redocly config consumed by both CI and Makefile) and then update the
Makefile to call "npx `@redocly/cli` lint ./openapi/spec.yaml" so both paths use
the same configuration.
🪄 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: e0807fd0-6a97-4268-b4b6-183abcc0dcc6
📒 Files selected for processing (11)
Makefiledocs/index.htmlopenapi/spec.yamlsdk/standard/api_allocation.gosdk/standard/api_instance.gosdk/standard/api_instance_type.gosdk/standard/api_ip_block.gosdk/standard/api_machine.gosdk/standard/api_metadata.gosdk/standard/api_site.gosdk/standard/api_user.go
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 @.github/workflows/lint-and-test.yml:
- Around line 114-115: The workflow currently skips the Redocly rule
no-ambiguous-paths in the "Run OpenAPI lint" step; either add a brief inline
comment in that step explaining why the rule is intentionally skipped (e.g.,
documented design decision that /type/{instanceTypeId} and /{instanceId}/... are
distinct resources and cannot be disambiguated by linting), or fix the OpenAPI
spec to remove ambiguity by renaming or restructuring the conflicting paths
(adjust /v2/org/{org}/nico/instance/type/{instanceTypeId} and the
instance-specific paths /v2/org/{org}/nico/instance/{instanceId}/status-history,
/interface, /infiniband-interface, /nvlink-interface so path segments are
uniquely identifiable), and update the workflow to stop skipping
no-ambiguous-paths once resolved.
🪄 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: 4c28a47a-d4f8-415e-a707-185b64e3480e
📒 Files selected for processing (1)
.github/workflows/lint-and-test.yml
| - name: Run OpenAPI lint | ||
| run: redocly lint ./openapi/spec.yaml --format=github-actions | ||
| run: redocly lint ./openapi/spec.yaml --format=github-actions --skip-rule=no-ambiguous-paths |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Identify paths flagged by the no-ambiguous-paths rule
# Run redocly lint without the skip flag to see what it flags
npx `@redocly/cli` lint ./openapi/spec.yaml 2>&1 | grep -i "ambiguous\|no-ambiguous-paths" || echo "No ambiguous paths warnings found"Repository: NVIDIA/infra-controller-rest
Length of output: 1003
Document why we skip no-ambiguous-paths (or fix the OpenAPI paths)
redocly lint flags real no-ambiguous-paths issues for:
/v2/org/{org}/nico/instance/type/{instanceTypeId}vs/v2/org/{org}/nico/instance/{instanceId}/status-history/v2/org/{org}/nico/instance/type/{instanceTypeId}vs/v2/org/{org}/nico/instance/{instanceId}/interface/v2/org/{org}/nico/instance/type/{instanceTypeId}vs/v2/org/{org}/nico/instance/{instanceId}/infiniband-interface/v2/org/{org}/nico/instance/type/{instanceTypeId}vs/v2/org/{org}/nico/instance/{instanceId}/nvlink-interface
Skipping the rule at .github/workflows/lint-and-test.yml (lines 114–115) needs an explicit rationale, or the spec should be refactored to remove the ambiguity.
Suggested inline documentation
- name: Run OpenAPI lint
- run: redocly lint ./openapi/spec.yaml --format=github-actions --skip-rule=no-ambiguous-paths
+ # Skip no-ambiguous-paths: [brief explanation of why this rule is not applicable or produces false positives]
+ run: redocly lint ./openapi/spec.yaml --format=github-actions --skip-rule=no-ambiguous-paths📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - name: Run OpenAPI lint | |
| run: redocly lint ./openapi/spec.yaml --format=github-actions | |
| run: redocly lint ./openapi/spec.yaml --format=github-actions --skip-rule=no-ambiguous-paths | |
| - name: Run OpenAPI lint | |
| # Skip no-ambiguous-paths: [brief explanation of why this rule is not applicable or produces false positives] | |
| run: redocly lint ./openapi/spec.yaml --format=github-actions --skip-rule=no-ambiguous-paths |
🤖 Prompt for 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.
In @.github/workflows/lint-and-test.yml around lines 114 - 115, The workflow
currently skips the Redocly rule no-ambiguous-paths in the "Run OpenAPI lint"
step; either add a brief inline comment in that step explaining why the rule is
intentionally skipped (e.g., documented design decision that
/type/{instanceTypeId} and /{instanceId}/... are distinct resources and cannot
be disambiguated by linting), or fix the OpenAPI spec to remove ambiguity by
renaming or restructuring the conflicting paths (adjust
/v2/org/{org}/nico/instance/type/{instanceTypeId} and the instance-specific
paths /v2/org/{org}/nico/instance/{instanceId}/status-history, /interface,
/infiniband-interface, /nvlink-interface so path segments are uniquely
identifiable), and update the workflow to stop skipping no-ambiguous-paths once
resolved.
There was a problem hiding this comment.
The ambigous path lint error is raised by redocly linter because it doesn't take into account the UUID format for the param.
/v2/org/{org}/nico/instance/type/{instanceTypeId} differs from /v2/org/{org}/nico/instance/{instanceId}/interface because type is a plain string in the former whereas {instanceId} is a string of UUID format.
Having said that, we do have plans to migrate /v2/org/{org}/nico/instance/type/* to /v2/org/{org}/nico/instance-type/* which can resolve this concern.
There was a problem hiding this comment.
@thossain-nv, understood — that is a well-known limitation of structural path-ambiguity analysis in OpenAPI linters. Redocly evaluates path segments purely lexically and has no visibility into format: uuid constraints on path parameters, which means the literal type segment in .../instance/type/{instanceTypeId} is indistinguishable from a UUID-format {instanceId} segment at lint time, producing a false positive.
The planned migration to /v2/org/{org}/nico/instance-type/* is the correct long-term fix, as it eliminates the structural overlap entirely.
In the interim, I would strongly recommend capturing this rationale as an inline comment so future maintainers do not inadvertently remove the skip or miscategorize it as technical debt:
- name: Run OpenAPI lint
# Skip no-ambiguous-paths: Redocly does not evaluate parameter format
# constraints (e.g., format: uuid), so it incorrectly flags
# /instance/type/{instanceTypeId} (literal 'type' segment) as
# ambiguous with /instance/{instanceId}/... (UUID-format parameter).
# This will be resolved when /instance/type/* is migrated to
# /instance-type/* (tracked in <issue-link>).
run: redocly lint ./openapi/spec.yaml --format=github-actions --skip-rule=no-ambiguous-pathsWould you like me to open a follow-up issue to track the /instance/type/* → /instance-type/* path migration?
✏️ Learnings added
Learnt from: thossain-nv
Repo: NVIDIA/infra-controller-rest PR: 584
File: .github/workflows/lint-and-test.yml:114-115
Timestamp: 2026-05-28T23:29:05.792Z
Learning: In the NVIDIA/infra-controller-rest repository, the Redocly OpenAPI linter rule `no-ambiguous-paths` is intentionally skipped in `.github/workflows/lint-and-test.yml` because Redocly does not account for parameter format constraints (e.g., `format: uuid`). The false positive arises from the structural overlap between `/v2/org/{org}/nico/instance/type/{instanceTypeId}` (literal `type` segment) and `/v2/org/{org}/nico/instance/{instanceId}/...` (UUID-format `{instanceId}` parameter). There is a planned migration of `/v2/org/{org}/nico/instance/type/*` to `/v2/org/{org}/nico/instance-type/*` which will structurally resolve the ambiguity.
Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.
🔍 Container Scan Summary
Per-CVE detail lives in the per-service |
9e82783 to
f846653
Compare
b83b716 to
c16ec90
Compare
Signed-off-by: Tareque Hossain <thossain@nvidia.com>
Signed-off-by: Tareque Hossain <thossain@nvidia.com>
Signed-off-by: Tareque Hossain <thossain@nvidia.com>
Signed-off-by: Tareque Hossain <thossain@nvidia.com>
c16ec90 to
049168c
Compare
Description
OpenAPI schema is incorrectly listing the following endpoints, this PR removed them.
The PR also fixes missing 4xx responses for certain endpoints that were causing lint errors.
This PR also enables skipping
no-ambigous-pathlint error reported by redocly linter which is not taking into account the UUID format of strings to disambiguate paths.Type of Change
Services Affected
None
Related Issues (Optional)
None
Breaking Changes
Testing
Additional Notes
None