Skip to content

fix(bundler): honor bundlers query param; driver-managed cleanup#1606

Merged
mchmarny merged 1 commit into
mainfrom
fix/bundlers-filter-cleanup-uvm
Jul 3, 2026
Merged

fix(bundler): honor bundlers query param; driver-managed cleanup#1606
mchmarny merged 1 commit into
mainfrom
fix/bundlers-filter-cleanup-uvm

Conversation

@mchmarny

@mchmarny mchmarny commented Jul 3, 2026

Copy link
Copy Markdown
Member

Summary

Implements the documented POST /v1/bundle bundlers query parameter as a positive component-name filter, and makes tools/cleanup detect driver-managed clusters and print the GPU-node reboot guidance needed to avoid a wedged nvidia_uvm on redeploy.

Motivation / Context

bundlers was documented in the OpenAPI spec and API reference but never read by the server — every request bundled all components. Separately, tools/cleanup on driver-managed clusters (gpu-operator driver.enabled=true, e.g. EKS) can leave nvidia_uvm wedged mid-unload, breaking the next install until the GPU nodes are rebooted; the script gave no warning.

Fixes: #1531
Fixes: #1553

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

Component(s) Affected

  • API server (cmd/aicrd, pkg/server)
  • Bundlers (pkg/bundler, pkg/component/*)
  • Docs/examples (docs/, examples/)
  • Other: tools/cleanup, DEVELOPMENT.md

Implementation Notes

  • The filter is applied in filterEnabledComponents after recipe-level enabled and --set toggles: unlisted enabled components are skipped exactly like disabled ones, so the existing dependency-edge pruning treats them as satisfied externally (no false circular-dependency in helmfile). An unknown name, or a name the recipe disables, is rejected with ErrCodeInvalidRequest (HTTP 400) rather than silently ignored.
  • tools/cleanup detects driver-managed mode via the nvidia-driver-daemonset (primary; robust to release-name drift) with a helm get values driver.enabled fallback (yq, or a 2-space-indent-anchored awk that cannot false-positive on nested keys like driver.rdma.enabled). Detection is read-only, fail-open, and prints cordon → reboot → uncordon guidance both before the confirmation prompt and after completion. Automated drain/reboot is cloud-specific and out of scope per the issue.

Testing

make qualify

make qualify passed locally (unit tests with -race, golangci-lint + yamllint, e2e incl. chainsaw 23/23, grype scan clean, license headers). shellcheck -x tools/cleanup clean. New table-driven tests: TestMake_BundlersFilter, TestMake_BundlersFilterDependencyPruned, TestParseBundleConfig_Bundlers, TestWithBundlers.

Coverage: pkg/bundler/... 78.3% → 79.3% (+1.0%).

Risk Assessment

  • Low — Isolated change, well-tested, easy to revert

Rollout notes: No behavior change for requests that omit bundlers (previously-ignored values now take effect or return 400, which matches the documented contract). Cleanup-script change is output-only.

Checklist

  • Tests pass locally (make test with -race)
  • Linter passes (make lint)
  • I did not skip/disable tests to make CI green
  • I added/updated tests for new functionality
  • I updated docs if user-facing behavior changed
  • Changes follow existing patterns in the codebase
  • Commits are cryptographically signed (git commit -S) — GPG signing info

@mchmarny mchmarny requested a review from a team as a code owner July 3, 2026 12:01
@mchmarny mchmarny added the theme/deployer Helm, ArgoCD, and deployment bundle generation label Jul 3, 2026
@mchmarny mchmarny self-assigned this Jul 3, 2026
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Recipe evidence check

No leaf overlays affected by this PR.

This gate is warning-only and never blocks merge.

@mchmarny

mchmarny commented Jul 3, 2026

Copy link
Copy Markdown
Member Author

@CodeRabbit full review

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Coverage Report ✅

Metric Value
Coverage 78.5%
Threshold 75%
Status Pass
Coverage Badge
![Coverage](https://img.shields.io/badge/coverage-78.5%25-green)

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ 🤖
github.com/NVIDIA/aicr/pkg/bundler 72.54% (+4.59%) 👍
github.com/NVIDIA/aicr/pkg/bundler/config 96.68% (+0.13%) 👍
github.com/NVIDIA/aicr/pkg/server 78.04% (ø)

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/NVIDIA/aicr/pkg/bundler/bundler.go 76.47% (+0.65%) 748 (+20) 572 (+20) 176 👍
github.com/NVIDIA/aicr/pkg/bundler/config/config.go 95.89% (+0.20%) 219 (+10) 210 (+10) 9 👍
github.com/NVIDIA/aicr/pkg/bundler/handler.go 37.86% (+37.86%) 103 (+7) 39 (+39) 64 (-32) 🌟
github.com/NVIDIA/aicr/pkg/server/bundle_handler.go 47.17% (ø) 53 25 28

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR adds a bundlers query-parameter filter for POST /v1/bundle, wiring it through config, request parsing, bundling validation/pruning, tests, and documentation. It also updates tools/cleanup to detect driver-managed GPU clusters and print reboot guidance, and adds a redeployment troubleshooting note in DEVELOPMENT.md.

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

Changes

Area Changes
Bundle filter feature New Config.bundlers field, Bundlers() getter, WithBundlers option; handler parsing/validation of bundlers; filterEnabledComponents validation and pruning logic; associated tests
API documentation Updated OpenAPI spec, integrator docs, API reference, and handler doc comment for bundlers semantics
Cleanup tooling Driver-managed detection and reboot guidance messaging in tools/cleanup; new troubleshooting section in DEVELOPMENT.md

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant Handler as ParseQueryParams
  participant Config
  participant Bundler as filterEnabledComponents
  Client->>Handler: POST /v1/bundle?bundlers=a,b
  Handler->>Handler: split, trim, drop empty names
  Handler->>Config: WithBundlers(names)
  Config-->>Bundler: Bundlers() filter set
  Bundler->>Bundler: validate names declared & enabled
  alt unknown or disabled name
    Bundler-->>Client: ErrCodeInvalidRequest (HTTP 400)
  else valid names
    Bundler->>Bundler: prune enabledRefs and enabledSet
    Bundler-->>Client: bundle with requested subset
  end
Loading

Related issues: #1531, #1553

Related PRs: None identified.

Suggested labels: documentation, enhancement, bundler, tools

Suggested reviewers: Reviewers familiar with the bundler package and cleanup tooling.

Poem

Names in a list, trimmed and neat,
Bundles keep only what they need.
And on driver-managed nodes in sight,
Reboot first, then redeploy right.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title summarizes both the bundler query-param fix and the cleanup guidance update.
Description check ✅ Passed The description is directly about implementing the bundlers filter and cleanup warnings.
Linked Issues check ✅ Passed The changes satisfy [#1531, #1553] by implementing the bundlers filter and driver-managed cleanup guidance.
Out of Scope Changes check ✅ Passed No obvious out-of-scope changes were introduced beyond docs, tests, and cleanup behavior tied to the stated objectives.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/bundlers-filter-cleanup-uvm

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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
api/aicr/v1/server.yaml (2)

1557-1565: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Deprecated BundleRequest.bundlers schema still describes old semantics.

Enum still lists a fixed 6-value "bundler type" set and describes "bundler types to execute", contradicting the new dynamic recipe component-name filter. Since this schema is deprecated and no longer referenced by the actual /v1/bundle requestBody, low priority, but worth a note so it doesn't confuse readers of the deprecated path.

As per coding guidelines, "Keep the OpenAPI contract in sync with user-visible API changes, including new endpoints, query parameters, and enum values."

🤖 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 `@api/aicr/v1/server.yaml` around lines 1557 - 1565, The deprecated
BundleRequest.bundlers schema still reflects the old fixed bundler-type
semantics, which no longer match the dynamic recipe component-name filtering.
Update the deprecated schema in api/aicr/v1/server.yaml so its description and
example clearly align with the current behavior, and remove or revise the
hardcoded enum values in the BundleRequest definition to avoid exposing outdated
API contract details. Keep the changes localized to the deprecated BundleRequest
schema and related OpenAPI metadata.

Source: Coding guidelines


1026-1055: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Stale invalidBundler 400 example.

The invalidBundler example under POST /v1/bundle still documents the old "bundler type" validation error ("Invalid bundler type", "unsupported bundle type: ..."), not the new component-name filter's actual error format (unknown component %q in bundlers filter; recipe declares: %s or the "disabled" variant from filterEnabledComponents). This directly contradicts the semantics just documented for the bundlers parameter above (lines 745-750).

As per coding guidelines, "Keep the OpenAPI contract in sync with user-visible API changes, including new endpoints, query parameters, and enum values."

📝 Proposed fix
                 invalidBundler:
-                  summary: Invalid bundler type
+                  summary: Unknown component in bundlers filter
                   value:
                     code: INVALID_REQUEST
-                    message: "Invalid bundler type"
+                    message: "unknown component \"invalid-bundler\" in bundlers filter; recipe declares: gpu-operator, network-operator"
                     details:
-                      bundler: "invalid-bundler"
-                      error: "unsupported bundle type: invalid-bundler"
-                      valid: ["gpu-operator", "network-operator", "nodewright-operator", "nvsentinel", "cert-manager", "nvidia-dra-driver-gpu"]
                     requestId: "550e8400-e29b-41d4-a716-446655440000"
                     timestamp: "2025-01-15T10:30:00Z"
                     retryable: false
🤖 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 `@api/aicr/v1/server.yaml` around lines 1026 - 1055, The `invalidBundler`
example for `POST /v1/bundle` is stale and still shows the old bundler-type
validation message. Update the OpenAPI example in `server.yaml` to match the
current `bundlers` filter behavior and the actual errors produced by
`filterEnabledComponents` / the bundlers validation path, including the `unknown
component %q in bundlers filter; recipe declares: %s` and disabled-component
variant as appropriate. Keep the example payload aligned with the `Error` schema
and the user-visible behavior documented for the `bundlers` query parameter.

Source: Coding guidelines

🤖 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.

Outside diff comments:
In `@api/aicr/v1/server.yaml`:
- Around line 1557-1565: The deprecated BundleRequest.bundlers schema still
reflects the old fixed bundler-type semantics, which no longer match the dynamic
recipe component-name filtering. Update the deprecated schema in
api/aicr/v1/server.yaml so its description and example clearly align with the
current behavior, and remove or revise the hardcoded enum values in the
BundleRequest definition to avoid exposing outdated API contract details. Keep
the changes localized to the deprecated BundleRequest schema and related OpenAPI
metadata.
- Around line 1026-1055: The `invalidBundler` example for `POST /v1/bundle` is
stale and still shows the old bundler-type validation message. Update the
OpenAPI example in `server.yaml` to match the current `bundlers` filter behavior
and the actual errors produced by `filterEnabledComponents` / the bundlers
validation path, including the `unknown component %q in bundlers filter; recipe
declares: %s` and disabled-component variant as appropriate. Keep the example
payload aligned with the `Error` schema and the user-visible behavior documented
for the `bundlers` query parameter.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 2d1d8dc3-cfcc-4dbf-9bcc-821260aa22e9

📥 Commits

Reviewing files that changed from the base of the PR and between bdd91fc and 41c9430.

📒 Files selected for processing (12)
  • DEVELOPMENT.md
  • api/aicr/v1/server.yaml
  • docs/integrator/index.md
  • docs/user/api-reference.md
  • pkg/bundler/bundler.go
  • pkg/bundler/bundler_test.go
  • pkg/bundler/config/config.go
  • pkg/bundler/config/config_test.go
  • pkg/bundler/handler.go
  • pkg/bundler/handler_test.go
  • pkg/server/bundle_handler.go
  • tools/cleanup

@mchmarny mchmarny force-pushed the fix/bundlers-filter-cleanup-uvm branch from 41c9430 to 972648c Compare July 3, 2026 12:17
@github-actions github-actions Bot added size/XL and removed size/L labels Jul 3, 2026
@mchmarny

mchmarny commented Jul 3, 2026

Copy link
Copy Markdown
Member Author

@CodeRabbit full review

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
api/aicr/v1/server.yaml (1)

1026-1055: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Stale invalidBundler 400 example doesn't match new filter error semantics.

The bundlers parameter now rejects unknown/disabled component names with messages like "unknown component ... in bundlers filter" or "component ... is disabled and cannot be selected via the bundlers filter" (per filterEnabledComponents), but the invalidBundler example still documents the old "Invalid bundler type" / "unsupported bundle type" shape with a fixed valid enum list. Update the example (and consider renaming it) to reflect the new unknown-name/disabled-name rejection.

As per coding guidelines: api/aicr/v1/server.yaml: "Keep the OpenAPI contract in sync with user-visible API changes, including new endpoints, query parameters, and enum values."

📝 Proposed fix
                 invalidBundler:
-                  summary: Invalid bundler type
+                  summary: Unknown component in bundlers filter
                   value:
                     code: INVALID_REQUEST
-                    message: "Invalid bundler type"
+                    message: "unknown component \"invalid-bundler\" in bundlers filter; recipe declares: gpu-operator, network-operator"
                     details:
-                      bundler: "invalid-bundler"
-                      error: "unsupported bundle type: invalid-bundler"
-                      valid: ["gpu-operator", "network-operator", "nodewright-operator", "nvsentinel", "cert-manager", "nvidia-dra-driver-gpu"]
                     requestId: "550e8400-e29b-41d4-a716-446655440000"
                     timestamp: "2025-01-15T10:30:00Z"
                     retryable: false
🤖 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 `@api/aicr/v1/server.yaml` around lines 1026 - 1055, The 400 response example
for bundler filtering is outdated and no longer matches the error shapes
produced by filterEnabledComponents. Update the OpenAPI example under the
invalidBundler example to reflect the new user-visible failures for unknown or
disabled component names in the bundlers filter, including the new message text
and a details payload consistent with those cases. If the current example name
no longer fits, rename it to something that clearly describes unknown/disabled
bundler selection rather than “Invalid bundler type,” and remove the stale fixed
valid enum list.

Source: Coding guidelines

🤖 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/bundler/handler.go`:
- Around line 269-284: The bundlers query parsing in handler.go cannot
distinguish an absent parameter from an explicitly empty one because
Query.Get("bundlers") returns the same value for both, causing ?bundlers= to
bypass validation and fall back to bundling everything. Update the bundler
parsing logic in the request handler to detect parameter presence separately
from value (for example, using the query map’s key presence) and treat an
explicitly empty bundlers value the same as other unusable inputs by returning
the existing invalid-request error from the bundlers parsing block.

In `@tools/cleanup`:
- Around line 118-149: The driver-managed detection in detect_driver_managed is
hardcoded to the gpu-operator namespace, so it can miss Talos installs in
privileged-gpu-operator and fail to set DRIVER_MANAGED. Update the kubectl get
ds and helm get values probes to resolve the actual release/daemonset namespace
dynamically or search across namespaces, matching the approach used by
pkg/bundler/deployer/helm/templates/deploy.sh.tmpl. Keep the existing fail-open
behavior, but make the namespace lookup robust so the warning is emitted
whenever gpu-operator is actually managing the driver.

---

Outside diff comments:
In `@api/aicr/v1/server.yaml`:
- Around line 1026-1055: The 400 response example for bundler filtering is
outdated and no longer matches the error shapes produced by
filterEnabledComponents. Update the OpenAPI example under the invalidBundler
example to reflect the new user-visible failures for unknown or disabled
component names in the bundlers filter, including the new message text and a
details payload consistent with those cases. If the current example name no
longer fits, rename it to something that clearly describes unknown/disabled
bundler selection rather than “Invalid bundler type,” and remove the stale fixed
valid enum list.
🪄 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: ASSERTIVE

Plan: Enterprise

Run ID: 6ad8663d-1a17-40eb-ab46-2bed1f36c022

📥 Commits

Reviewing files that changed from the base of the PR and between bdd91fc and 41c9430.

📒 Files selected for processing (12)
  • DEVELOPMENT.md
  • api/aicr/v1/server.yaml
  • docs/integrator/index.md
  • docs/user/api-reference.md
  • pkg/bundler/bundler.go
  • pkg/bundler/bundler_test.go
  • pkg/bundler/config/config.go
  • pkg/bundler/config/config_test.go
  • pkg/bundler/handler.go
  • pkg/bundler/handler_test.go
  • pkg/server/bundle_handler.go
  • tools/cleanup

Comment thread pkg/bundler/handler.go
Comment thread tools/cleanup
@mchmarny mchmarny force-pushed the fix/bundlers-filter-cleanup-uvm branch from 972648c to 661a0e2 Compare July 3, 2026 12:27

@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 `@api/aicr/v1/server.yaml`:
- Around line 1565-1570: The deprecated schema description for the recipe
component list is too broad about what the bundlers query parameter accepts.
Update the OpenAPI text near the bundled components field in
api/aicr/v1/server.yaml to match the filtering behavior in
filterEnabledComponents, stating that only enabled recipe components are
accepted and that recipe-declared but disabled components are rejected with HTTP
400. Keep the wording aligned with the existing bundler contract so the
server.yaml description stays in sync with user-visible behavior.
- Around line 745-750: The bundlers documentation is missing the rejection case
for components disabled via the set query parameter. Update the OpenAPI
descriptions in server.yaml for both the bundlers query parameter and the
deprecated BundleRequest.bundlers field so they explicitly say that names the
recipe does not declare, or the recipe/--set disables, are rejected with HTTP
400. Use the existing bundlers filtering wording and keep it aligned with the
bundle-time validation in the server bundle request flow.
🪄 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: ASSERTIVE

Plan: Enterprise

Run ID: dcc97eea-123f-4fea-a94e-fa8433aaaaa4

📥 Commits

Reviewing files that changed from the base of the PR and between 41c9430 and 972648c.

📒 Files selected for processing (12)
  • DEVELOPMENT.md
  • api/aicr/v1/server.yaml
  • docs/integrator/index.md
  • docs/user/api-reference.md
  • pkg/bundler/bundler.go
  • pkg/bundler/bundler_test.go
  • pkg/bundler/config/config.go
  • pkg/bundler/config/config_test.go
  • pkg/bundler/handler.go
  • pkg/bundler/handler_test.go
  • pkg/server/bundle_handler.go
  • tools/cleanup

Comment thread api/aicr/v1/server.yaml Outdated
Comment thread api/aicr/v1/server.yaml
@mchmarny mchmarny force-pushed the fix/bundlers-filter-cleanup-uvm branch from 661a0e2 to b7dc449 Compare July 3, 2026 12:29

@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 `@tools/cleanup`:
- Around line 124-163: The cleanup detection pipelines in
detect_driver_managed() can still terminate the script under set -euo pipefail
when kubectl or helm returns non-zero, which breaks the intended fail-open
behavior. Update the kubectl get daemonset ... | awk and helm list -A ... | awk
paths so their exit status is neutralized (for example by appending || true or
equivalent handling) while keeping the existing DRIVER_MANAGED logic intact.
🪄 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: ASSERTIVE

Plan: Enterprise

Run ID: caedd1c0-68b2-4e17-b089-fc7a29ee9992

📥 Commits

Reviewing files that changed from the base of the PR and between 972648c and b7dc449.

📒 Files selected for processing (12)
  • DEVELOPMENT.md
  • api/aicr/v1/server.yaml
  • docs/integrator/index.md
  • docs/user/api-reference.md
  • pkg/bundler/bundler.go
  • pkg/bundler/bundler_test.go
  • pkg/bundler/config/config.go
  • pkg/bundler/config/config_test.go
  • pkg/bundler/handler.go
  • pkg/bundler/handler_test.go
  • pkg/server/bundle_handler.go
  • tools/cleanup

Comment thread tools/cleanup
@mchmarny mchmarny force-pushed the fix/bundlers-filter-cleanup-uvm branch from b7dc449 to f822d6f Compare July 3, 2026 12:47
@mchmarny

mchmarny commented Jul 3, 2026

Copy link
Copy Markdown
Member Author

@CodeRabbit full review

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@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.

♻️ Duplicate comments (2)
api/aicr/v1/server.yaml (2)

744-750: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Bundlers doc still omits --set-disabled rejection case.

The current description only says a name "the recipe disables" is rejected; it doesn't mention that a component disabled via the set query parameter (--set component:enabled=false) is also rejected with the same component "X" is disabled and cannot be selected via the bundlers filter error, per filterEnabledComponents in pkg/bundler/bundler.go. This was flagged in a prior review round and marked "addressed", but the text shown here still matches the original, unfixed wording.

📝 Suggested doc fix
-            Comma-delimited list of recipe component names to bundle.
-            If not specified, all enabled components are bundled.
-            Components not listed are skipped as if disabled (their
-            dependency edges are treated as satisfied externally).
-            A name the recipe does not declare, or one the recipe
-            disables, is rejected with HTTP 400.
+            Comma-delimited list of recipe component names to bundle.
+            If not specified, all enabled components are bundled.
+            Components not listed are skipped as if disabled (their
+            dependency edges are treated as satisfied externally).
+            A name the recipe does not declare, or one disabled by the
+            recipe or a `set` override, is rejected with HTTP 400.

As per coding guidelines, api/aicr/v1/server.yaml: "Keep the OpenAPI contract in sync with user-visible API changes, including new endpoints, query parameters, and enum values."

🤖 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 `@api/aicr/v1/server.yaml` around lines 744 - 750, Update the Bundlers API
description in the server.yaml OpenAPI contract to explicitly mention that a
component disabled via the set query parameter (--set component:enabled=false)
is also rejected by the bundlers filter. Keep the wording aligned with
filterEnabledComponents in pkg/bundler/bundler.go and make clear that both
recipe-disabled and set-disabled components return the same HTTP 400 rejection.

Source: Coding guidelines


1565-1569: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Deprecated field description still overstates accepted names.

The text "accepts any component name the recipe declares" is inaccurate — a declared-but-disabled component is rejected with HTTP 400 by filterEnabledComponents, not accepted. This was flagged previously and marked "addressed", but the wording shown here is unchanged from the original.

📝 Suggested doc fix
-            Optional list of recipe component names to bundle.
-            If not specified, all enabled components are bundled.
-            Superseded by the "bundlers" query parameter, which accepts
-            any component name the recipe declares.
+            Optional list of recipe component names to bundle.
+            If not specified, all enabled components are bundled.
+            Superseded by the "bundlers" query parameter, which only
+            accepts enabled recipe components; a name the recipe does
+            not declare, or one disabled by the recipe or a `set`
+            override, is rejected with HTTP 400.

As per coding guidelines, api/aicr/v1/server.yaml: "Keep the OpenAPI contract in sync with user-visible API changes."

🤖 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 `@api/aicr/v1/server.yaml` around lines 1565 - 1569, Update the deprecated
bundler description in server.yaml so it no longer claims the query parameter
accepts any declared component name. Align the wording with
filterEnabledComponents and the bundlers parameter behavior by stating that only
enabled component names are accepted and declared-but-disabled components are
rejected with HTTP 400. Keep the rest of the OpenAPI text unchanged while
correcting the user-visible contract language.

Source: Coding guidelines

🤖 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.

Duplicate comments:
In `@api/aicr/v1/server.yaml`:
- Around line 744-750: Update the Bundlers API description in the server.yaml
OpenAPI contract to explicitly mention that a component disabled via the set
query parameter (--set component:enabled=false) is also rejected by the bundlers
filter. Keep the wording aligned with filterEnabledComponents in
pkg/bundler/bundler.go and make clear that both recipe-disabled and set-disabled
components return the same HTTP 400 rejection.
- Around line 1565-1569: Update the deprecated bundler description in
server.yaml so it no longer claims the query parameter accepts any declared
component name. Align the wording with filterEnabledComponents and the bundlers
parameter behavior by stating that only enabled component names are accepted and
declared-but-disabled components are rejected with HTTP 400. Keep the rest of
the OpenAPI text unchanged while correcting the user-visible contract language.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: d247f95d-66a8-4082-b38c-1d2a23e96e1d

📥 Commits

Reviewing files that changed from the base of the PR and between b7dc449 and 82badaf.

📒 Files selected for processing (12)
  • DEVELOPMENT.md
  • api/aicr/v1/server.yaml
  • docs/integrator/index.md
  • docs/user/api-reference.md
  • pkg/bundler/bundler.go
  • pkg/bundler/bundler_test.go
  • pkg/bundler/config/config.go
  • pkg/bundler/config/config_test.go
  • pkg/bundler/handler.go
  • pkg/bundler/handler_test.go
  • pkg/server/bundle_handler.go
  • tools/cleanup

Implement the documented POST /v1/bundle 'bundlers' query parameter as a
positive filter on recipe component names: unlisted enabled components are
skipped like disabled ones (dependency edges pruned as satisfied
externally); unknown or disabled names are rejected with 400.

tools/cleanup now detects driver-managed clusters (gpu-operator
driver.enabled=true) and prints cordon/reboot/uncordon guidance before the
confirmation prompt and after completion, since uninstalling gpu-operator
can leave nvidia_uvm wedged mid-unload and break the next install.
DEVELOPMENT.md documents the redeploy workaround.

Fixes: #1531
Fixes: #1553
Signed-off-by: Mark Chmarny <[email protected]>
@mchmarny mchmarny force-pushed the fix/bundlers-filter-cleanup-uvm branch from 82badaf to 733f74e Compare July 3, 2026 13:10
coderabbitai[bot]

This comment was marked as resolved.

@mchmarny

mchmarny commented Jul 3, 2026

Copy link
Copy Markdown
Member Author

Re the two duplicate comments in review 4626014951: that review ran against 82badaf4 (the pre-rebase branch state) and raced the force-push. Both wording fixes are already in the current head 733f74e9 — the bundlers query-param description covers the set-disabled rejection, and the deprecated BundleRequest.bundlers description no longer claims any declared name is accepted.

@mchmarny mchmarny merged commit a4be19a into main Jul 3, 2026
160 of 161 checks passed
@mchmarny mchmarny deleted the fix/bundlers-filter-cleanup-uvm branch July 3, 2026 13:25

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
DEVELOPMENT.md (1)

549-581: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider linking the new subsection from the Common Issues table.

The table above (Line 553-560) lists quick-reference issues but doesn't point readers to this new subsection for driver-managed redeploy failures.

📝 Optional addition to the Common Issues table
 | Build failures | Run `make tidy` to update dependencies |
 | K8s connection fails | Check `~/.kube/config` or `KUBECONFIG` env |
+| Reinstall fails after `make cleanup` on a driver-managed cluster | See [Redeploying on Driver-Managed Clusters](`#redeploying-on-driver-managed-clusters`) |
🤖 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 `@DEVELOPMENT.md` around lines 549 - 581, Add a reference from the Common
Issues table to the new “Redeploying on Driver-Managed Clusters” subsection so
readers can jump directly to the driver-managed GPU-node reboot guidance. Update
the table entry set in DEVELOPMENT.md near the existing “Build failures” and
“K8s connection fails” rows, and point it at the new subsection that describes
`make cleanup`, `driver.enabled`, and `nvidia-driver-daemonset` behavior.
🤖 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.

Outside diff comments:
In `@DEVELOPMENT.md`:
- Around line 549-581: Add a reference from the Common Issues table to the new
“Redeploying on Driver-Managed Clusters” subsection so readers can jump directly
to the driver-managed GPU-node reboot guidance. Update the table entry set in
DEVELOPMENT.md near the existing “Build failures” and “K8s connection fails”
rows, and point it at the new subsection that describes `make cleanup`,
`driver.enabled`, and `nvidia-driver-daemonset` behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: e6a2e78e-1210-43ac-8ccc-707d341e98a7

📥 Commits

Reviewing files that changed from the base of the PR and between 82badaf and 733f74e.

📒 Files selected for processing (12)
  • DEVELOPMENT.md
  • api/aicr/v1/server.yaml
  • docs/integrator/index.md
  • docs/user/api-reference.md
  • pkg/bundler/bundler.go
  • pkg/bundler/bundler_test.go
  • pkg/bundler/config/config.go
  • pkg/bundler/config/config_test.go
  • pkg/bundler/handler.go
  • pkg/bundler/handler_test.go
  • pkg/server/bundle_handler.go
  • tools/cleanup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/api area/bundler area/docs size/XL theme/deployer Helm, ArgoCD, and deployment bundle generation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tools/cleanup leaves nvidia_uvm wedged on driver-managed GPU nodes (EKS) POST /v1/bundle: documented 'bundlers' query param is silently ignored

1 participant