Skip to content

fix(api): accept versionless legacy bundle recipes - #1943

Merged
njhensley merged 1 commit into
NVIDIA:mainfrom
yuanchen8911:fix/v1-bundle-versionless-openapi
Jul 29, 2026
Merged

njhensley merged 1 commit into
NVIDIA:mainfrom
yuanchen8911:fix/v1-bundle-versionless-openapi

Conversation

@yuanchen8911

@yuanchen8911 yuanchen8911 commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Align the /v1/bundle OpenAPI request contract with the server's supported
legacy RecipeResult header shapes. Keep current recipe responses strict while
reusing the same request schema in the deprecated bundle wrapper.

Motivation / Context

The runtime accepts legacy recipes with missing or empty header fields, but the
published request schema required canonical apiVersion and kind values.
OpenAPI validators and generated clients therefore rejected supported requests
before they reached the server.

Fixes #1941.

Fixes: #1941
Related: #1933 (overlapping schema and test surface), #1953 (runtime kind
normalization follow-up)

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)
  • Build/CI/tooling

Component(s) Affected

  • CLI (cmd/aicr, pkg/cli)
  • API server (cmd/aicrd, pkg/server)
  • Recipe engine / data (pkg/recipe)
  • Bundlers (pkg/bundler, pkg/component/*)
  • Collectors / snapshotter (pkg/collector, pkg/snapshotter)
  • Validator (pkg/validator)
  • Core libraries (pkg/errors, pkg/k8s)
  • Docs/examples (docs/, examples/)
  • Other: ____________

Implementation Notes

  • Split the shared RecipeResult shape from wrappers that impose header
    requirements and constraints.
  • Keep RecipeResponse strict while allowing /v1/bundle requests to omit
    apiVersion or kind, or carry their legacy empty-string values.
  • Keep the legacy kind: Recipe value valid on the request side. It was the
    value this contract published through v0.18.0, and the handler validates no
    header field, so removing it would make previously conforming clients
    spec-invalid against a request-validating gateway.
  • Apply the same request schema to the deprecated BundleRequest.recipe field.
  • Correct the resource kind to RecipeResult, fail closed when shared header
    properties disappear, and document both OpenAPI contract tests.
  • Gate runtime acceptance separately from the spec: TestBundleHandler_LegacyRecipeHeaders
    posts absent, empty, single-field, and legacy kind: Recipe bodies to the
    handler. The spec gate alone only checks the spec against itself.
  • Assert the /v1/recipe response $ref sites, and match allOf branches by
    content rather than position so a reordered — or grafted-on — branch is caught.

Testing

# Full package. Run outside the agent sandbox: TestGracefulShutdown binds a
# port, which the sandbox denies with "operation not permitted".
GOFLAGS="-mod=vendor" go test -race -count=1 ./pkg/server
GOFLAGS="-mod=vendor" go test -race -count=1 ./pkg/server -run '^(TestOpenAPIV1BundleRecipeContract|TestOpenAPIEnumsMatchGoTypes|TestBundleHandler_LegacyRecipeHeaders|TestBundleHandler_EmptyComponentRefs|TestBundleHandler_IncoherentComponentRef)$'
env -u GITLAB_TOKEN make test-coverage
golangci-lint run -c .golangci.yaml ./pkg/server/...
yamllint -c .yamllint.yaml api/aicr/v1/server.yaml
./tools/check-docs-mdx
git diff origin/main...HEAD --check

Control checks. Every new gate was verified to fail when the defect it
guards against is introduced, then reverted:

  • Adding a kind check to HandleBundles fails the legacy cases in
    TestBundleHandler_LegacyRecipeHeaders while the canonical control passes.
  • Adding a paired-header check ((kind == "") != (apiVersion == "")) fails
    exactly the five single-field cases and none of the paired ones — the shape
    the earlier version of this test would have missed entirely.
  • Removing Recipe from the BundleRecipeRequest kind enum fails
    TestOpenAPIV1BundleRecipeContract.
  • Grafting a third strict $ref onto the allOf fails the contract gate. Before
    the fail-closed rewrite of the helper it passed silently.

Project coverage passed at 80.7% against the 80% threshold; pkg/server is
unchanged at 78.7% on both this branch and origin/main. Scoped lint reports
zero issues.

Full make qualify was not rerun for the focused test and doc passes: the
change touches only the OpenAPI contract, docs, and tests, with no production Go
code.

Risk Assessment

  • Low — Isolated change, well-tested, easy to revert
  • Medium — Touches multiple components or has broader impact
  • High — Breaking change, affects critical paths, or complex rollout

Rollout notes: No migration is required. Current versioned requests remain
valid, and requests written against the v0.18.0 contract stay valid; the schema
now represents the legacy input already accepted at runtime.

The request schema is deliberately looser than the response schema because
bundleHandler.HandleBundles performs no header validation at all. Tightening
the runtime to enforce the documented contract is a separate question and is
not in scope here.

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

@coderabbitai

coderabbitai Bot commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

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

The OpenAPI contract now uses RecipeResult consistently and models /v1/bundle requests as versioned or legacy artifacts. The deprecated BundleRequest schema references the same request contract. Endpoint examples, API documentation, contributor guidance, and synchronization tests were updated to reflect and validate these constraints.

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

Possibly related PRs

  • NVIDIA/aicr#1933: Modifies related v1 bundle and recipe OpenAPI contract schemas.

Suggested labels: area/tests

Suggested reviewers: lockwobr

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The change set aligns /v1/bundle and the deprecated wrapper with the requested legacy recipe contract and adds sync tests.
Out of Scope Changes check ✅ Passed The docs and tests are directly tied to the bundle contract update; no unrelated changes stand out.
Title check ✅ Passed It is concise and clearly summarizes the main change: accepting legacy bundle recipes without versioned headers.
Description check ✅ Passed It directly describes the OpenAPI contract, runtime compatibility, and docs/tests updated in this PR.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@yuanchen8911
yuanchen8911 force-pushed the fix/v1-bundle-versionless-openapi branch 2 times, most recently from f7b5ab7 to 14bf3d0 Compare July 29, 2026 05:21
@github-actions github-actions Bot added size/L and removed size/M labels Jul 29, 2026
njhensley
njhensley previously approved these changes Jul 29, 2026

@njhensley njhensley left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🧭 Multi-Persona Review — Approve with comments

Method: four parallel persona reviewers (API-contract, Correctness, Test-coverage, Docs) followed by an adversarial senior meta-reviewer that independently re-derived each finding from the resolved code at head 14bf3d0.

Legend: 🔴 Blocker · 🟠 Major · 🟡 Minor · 🔵 Nitpick

Assessment

A clean, well-scoped contract + docs + test-only change — no production Go touched. It relaxes the /v1/bundle OpenAPI request schema (RecipeResponse → shared RecipeResponseBase + strict RecipeResponse / permissive BundleRecipeRequest allOf wrappers) to match what the server already accepts, and adds a TestOpenAPIV1BundleRecipeContract gate.

The central premise is verified against the code: the bundle handler decodes straight into recipe.RecipeResult (decode → AdoptRecipe → PrepareAndValidate) and never inspects apiVersion/kind, so versionless/empty-header legacy recipes are genuinely accepted. The PR also silently fixes a pre-existing contract bug — the old response enum was [Recipe] while the server actually stamps RecipeResult, so conforming clients would have rejected the real GET /v1/recipe body.

No blockers. The one substantive theme (the two 🟡 inline comments) is that the newly-advertised versionless-acceptance contract is real but un-gated and untested at the HTTP boundary, and the request enum is actually stricter than the fully-lenient handler — worth one behavioral test and/or a doc note, not a hold.

Confirmed non-issues (examined, cleared)

  • Versionless-not-required IS gated — the test asserts the bundle-request closure has no required and RecipeResponseBase.Required is empty, so re-adding a header requirement fails CI.
  • Constant-vs-literal enum comparison is a protective gate — a GroupVersion bump that misses the YAML literal fails the test.
  • Recipe→RecipeResult examples are a correct fix, not churn — the old response enum [Recipe] was wrong vs the server's emitted RecipeResult.
  • Deprecated BundleRequest wrapper has no live Go decode path — relaxing its $ref is documentation-only.
  • Docs are accurate, complete, and anchor-clean — both user + contributor pages updated, no stale kind: Recipe examples remain.

Summary

🔴 Blocker 🟠 Major 🟡 Minor 🔵 Nitpick
0 0 2 4

Reviewed with a multi-persona panel + adversarial meta-reviewer. All six findings were independently reproduced against the code at head 14bf3d0.

h := newTestBundleHandler(t)

body := `{"apiVersion": "aicr.run/v1alpha2", "kind": "Recipe", "componentRefs": []}`
body := `{"apiVersion": "aicr.run/v1alpha2", "kind": "RecipeResult", "componentRefs": []}`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🟡 Minor — Versionless/empty-header acceptance is untested at the HTTP handler boundary

The behavior this PR advertises — /v1/bundle accepting recipes with absent or empty apiVersion/kind — has no test that exercises the handler. TestOpenAPIV1BundleRecipeContract only inspects the YAML spec text (os.ReadFile+yaml.Unmarshal) and never starts a handler. The two edited handler tests both send fully-versioned bodies and assert 400 on unrelated paths. loader_test.go's empty-kind coverage does not apply — the HTTP path decodes straight into recipe.RecipeResult and bypasses loader.go (decode → AdoptRecipe → PrepareAndValidate, none of which inspect the header).

Blast radius: Low today; a future decode/validation refactor that adds header gating would silently break versionless acceptance with no failing test.

Fix: Add a table case POSTing {"componentRefs":[...]} and empty-string-header variants, asserting non-4xx-on-header-grounds. Minor rather than Major because there is no header-gating logic on this path to regress against today.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in d46eec6.

Added TestBundleHandler_LegacyRecipeHeaders in pkg/server/bundle_handler_test.go: a table-driven test that posts a real resolved recipe body to HandleBundles in four shapes — canonical, absent apiVersion/kind, empty-string headers, and kind: Recipe — and asserts 200 for each.

The canonical case is included as a control, so a passing run means the body was genuinely accepted rather than the assertion being vacuous. The test also fails closed if the fixture ever stops being the canonical shape, since a "legacy" case has to differ from the baseline to mean anything.

Verified the test actually does its job: temporarily adding a kind check to HandleBundles makes the three legacy cases fail with 400 while the control still passes.

Comment thread api/aicr/v1/server.yaml
type: string
description: >
Current API version, or empty after a legacy struct round trip
enum: ["", aicr.run/v1alpha2]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🟡 Minor — BundleRecipeRequest enum is stricter than the handler (permissive-direction spec/runtime drift)

BundleRecipeRequest pins apiVersion to ["", aicr.run/v1alpha2] and kind to ["", RecipeResult], but the handler validates neither — PrepareAndValidate checks only ref coherence, and the IsSupportedAPIVersion gate lives on the file-load path (loader.go:102), which this endpoint bypasses. So the running server accepts any apiVersion/kind string (e.g. aicr.run/v1alpha1, Recipe), silently ignoring it. This is exactly the drift direction the parity test's own docstring warns about ("clients conforming to the spec will reject inputs the server actually accepts").

Blast radius: Harmless in practice and arguably a defensible allowlist-of-intent, but undocumented.

Fix: Either add a one-line note (schema description or api-server.md) that the enum is advisory client/codegen guidance rather than server-enforced, or fail closed on unknown non-empty apiVersions via header.IsSupportedAPIVersion so spec and handler converge. A doc note is sufficient.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Partly fixed, partly intentional.

kind — the enum now includes the legacy value: ["", Recipe, RecipeResult]. That was the value this contract published from v0.14.0 through v0.18.0 (verified against each tag), and since the handler validates nothing, a client written against the released spec would otherwise have become spec-invalid at a request-validating gateway. Fixed in d46eec6.

apiVersion — stays ["", aicr.run/v1alpha2] deliberately. pkg/header documents the group/version bump as a hard break with no transition window, and pkg/recipe/loader.go rejects a prior group/version on the file-load path. Publishing aicr.nvidia.com/v1alpha1 as valid would contradict that policy. The schema description and docs/user/api-reference.md now state the asymmetry and the reason for it, which they previously did not.

The remaining direction of the drift — the handler validating no header field at all — is unchanged here. That is better closed by tightening the runtime than by loosening the spec further, and it is a behavioral change rather than a contract fix, so it belongs in its own PR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Filed the runtime-side follow-up as #1953 — normalize the legacy kind on ingest so the emitted bundle/recipe.yaml stays reloadable, keeping apiVersion strict per the hard-break policy.

Comment thread pkg/server/openapi_sync_test.go Outdated
if got := tt.schema.AllOf[0].Ref; got != want {
t.Errorf("base $ref = %q, want %q", got, want)
}
closure := tt.schema.AllOf[1]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🔵 Nitpick — Contract test indexes allOf positionally; allOf is order-independent

The test asserts AllOf[0].Ref == RecipeResponseBase and reads required/enums from AllOf[1]. OpenAPI allOf is semantically unordered, so a spec author who swaps the two entries (a still-valid, equivalent contract) would trip a spurious failure. Downgraded from Minor to Nitpick: the failure is loud (base $ref + enum mismatch → CI red), never a silent false-pass, and the same author co-owns both entries.

Blast radius: None — fail-safe brittleness, not a correctness gap.

Fix: Optional: locate the base entry by Ref == RecipeResponseBase and the closure by Ref == "" instead of indexing [0]/[1].

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in d46eec6.

Replaced the positional indexing with an allOfConstraint helper that identifies the base $ref and the inline constraint object by content rather than position, so swapping the two allOf entries — an equivalent contract — no longer trips the gate.

It still fails closed: a missing base $ref, or any number of inline constraint objects other than exactly one, is an error rather than a silently skipped assertion.

Comment thread pkg/server/openapi_sync_test.go Outdated
return true
}

func equalStringSets(a, b []string) bool {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🔵 Nitpick — equalStringSets is a sorted-slice compare, not true set semantics

The helper sorts copies then defers to equalStrings (length + element compare), so ["a","a"] vs ["a"] returns false — duplicates are not collapsed, and the name overstates it.

Blast radius: Harmless — every enum input is a unique literal.

Fix: Optional: rename to equalStringsUnordered, or dedupe both sides if true set semantics are intended.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in d46eec6. Renamed to equalStringsUnordered, which describes what it actually does.

Kept the duplicate-sensitive behavior on purpose and documented why on the helper: a repeated enum member is itself a spec defect worth failing on, not something to collapse silently.

Comment thread docs/user/api-reference.md Outdated

The request body is the recipe (RecipeResult) directly. No wrapper object needed.
The request body is the recipe (`RecipeResult`) directly. No wrapper object is
needed. Current artifacts carry `apiVersion: aicr.run/v1alpha2` and `kind:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🔵 Nitpick — Inline code span split across a source line break (renders fine)

The span kind: RecipeResult opens at the end of one line and closes on the next; backticks are balanced and CommonMark folds the intra-span line ending to a single space, so it renders correctly on GitHub and Fern.

Blast radius: None — purely cosmetic.

Fix: Optional: reflow so the span sits on one source line for readability.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Already fixed — the span was reflowed onto a single source line when that paragraph was rewritten, so this thread is showing against an outdated diff.

Comment thread api/aicr/v1/server.yaml
description: Deployment constraints (driver versions, etc.)
additionalProperties: true

RecipeResponse:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🔵 Nitpick — RecipeResponse flat-object → allOf composition may churn external codegen

The RecipeResponse type name is preserved and both in-repo $refs (spec L190/L420) stay intact, and there is no generated client in this repo, so nothing breaks here. Strict OpenAPI generators may emit a differently-shaped composed type for external SDK consumers who regenerate.

Blast radius: Speculative, out of repo scope.

Fix: Worth a line in the API changelog if published SDKs exist; otherwise no action.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Acknowledged — accepting this risk rather than changing the composition.

Confirmed there is no in-repo generator, CI job, Fern config, or e2e fixture consuming api/aicr/v1/server.yaml; the only consumer is pkg/server/openapi_sync_test.go. So nothing in this repo changes shape.

External SDK users who regenerate may get a composed type for RecipeResponse. The type name is preserved and both response $ref sites still point at it, so the wire contract is unchanged — only the generated Go/Python/TS type shape could differ. There is no way to verify generator output here without running codegen, so flagging it rather than claiming it is a non-issue.

@yuanchen8911
yuanchen8911 marked this pull request as draft July 29, 2026 14:43
@yuanchen8911
yuanchen8911 force-pushed the fix/v1-bundle-versionless-openapi branch from 14bf3d0 to fc3d80c Compare July 29, 2026 14:56

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

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

⚠️ Outside diff range comments (1)
pkg/server/bundle_handler_test.go (1)

340-371: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Legacy/versionless acceptance still untested at the handler boundary.

Both updated tests here (and the rest of this file) only exercise fully-versioned apiVersion/kind bodies. The PR's core behavioral claim — that /v1/bundle also accepts missing/empty apiVersion/kind or the legacy kind: Recipe — is asserted only by TestOpenAPIV1BundleRecipeContract, which parses the OpenAPI YAML text and never invokes HandleBundles. A future change to decode/validation logic could silently break versionless acceptance with nothing here to catch it.

Add a table case (or two) POSTing a body with componentRefs but no apiVersion/kind, and one with empty-string values, asserting the response is not a 4xx caused by header validation.

🤖 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 `@pkg/server/bundle_handler_test.go` around lines 340 - 371, Extend the
handler-level tests around TestBundleHandler_EmptyComponentRefs or
TestBundleHandler_IncoherentComponentRef with table cases that POST valid
componentRefs using omitted apiVersion/kind and empty-string apiVersion/kind
values. Assert HandleBundles does not return a 4xx attributable to header
validation, covering legacy/versionless acceptance at the /v1/bundle boundary.
🤖 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 `@pkg/server/bundle_handler_test.go`:
- Around line 340-371: Extend the handler-level tests around
TestBundleHandler_EmptyComponentRefs or TestBundleHandler_IncoherentComponentRef
with table cases that POST valid componentRefs using omitted apiVersion/kind and
empty-string apiVersion/kind values. Assert HandleBundles does not return a 4xx
attributable to header validation, covering legacy/versionless acceptance at the
/v1/bundle boundary.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 7f500091-33ec-4929-9176-3b80a1fcb2d7

📥 Commits

Reviewing files that changed from the base of the PR and between 14bf3d0 and fc3d80c.

📒 Files selected for processing (5)
  • api/aicr/v1/server.yaml
  • docs/contributor/api-server.md
  • docs/user/api-reference.md
  • pkg/server/bundle_handler_test.go
  • pkg/server/openapi_sync_test.go

@yuanchen8911
yuanchen8911 force-pushed the fix/v1-bundle-versionless-openapi branch from fc3d80c to d46eec6 Compare July 29, 2026 15:55
@yuanchen8911
yuanchen8911 force-pushed the fix/v1-bundle-versionless-openapi branch 2 times, most recently from 0b536d2 to 06d223d Compare July 29, 2026 16:37
@yuanchen8911
yuanchen8911 requested a review from njhensley July 29, 2026 16:38
@yuanchen8911
yuanchen8911 marked this pull request as ready for review July 29, 2026 16:39
njhensley
njhensley previously approved these changes Jul 29, 2026

@njhensley njhensley left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🔁 Re-review — approve stands (head 06d223d)

Re-reviewed after the force-push. The update directly and thoroughly addresses every finding from my prior pass, and strengthens the PR beyond it. Verified each fix against the code at 06d223d.

Prior findings — all resolved

  • 🟡 Missing HTTP-boundary test → new TestBundleHandler_LegacyRecipeHeaders: a 10-case table (control + fail-closed fixture guard + absent/empty single & both fields + legacy Recipe kind) that POSTs to HandleBundles and asserts 200. Exactly the behavioral gate that was missing.
  • 🟡 Request enum stricter than handler → kind enum widened to ["", Recipe, RecipeResult] to match the lenient handler; schema + api-reference.md + api-server.md now document the back-compat window, the kind: Recipe round-trip caveat (verified accurate — the input recipe is copied into the bundle's recipe.yaml and the CLI loader rejects Recipe), and the deliberate apiVersion hard-break policy. Bonus: a new response-site guard asserts /v1/recipe 200s still point at the strict RecipeResponse, blocking a future silent relax to the permissive enum.
  • 🔵 allOf positional indexing → allOfConstraint() now matches branches by content (baseRef), not position.
  • 🔵 equalStringSets naming → renamed equalStringsUnordered.
  • 🔵 Split code span → reflowed onto one source line.

One optional wording nit

See the single inline comment — the docs describe a prior apiVersion as "must be regenerated rather than accepted," which reads as handler enforcement, but the handler is actually lenient (it validates nothing and would 200). Fail-safe and already self-disclosed; non-blocking.

Summary

🔴 Blocker 🟠 Major 🟡 Minor 🔵 Nitpick
0 0 0 1 (optional)

Approval stands. Nice, comprehensive response to review.

Comment thread docs/user/api-reference.md Outdated

`apiVersion` has no equivalent legacy window on purpose. An artifact
group/version bump is a hard break with no transition period, so a recipe
stamped with a prior group/version must be regenerated rather than accepted.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🔵 Nitpick — Docs say a prior apiVersion "must be regenerated rather than accepted," but the handler accepts it

The prose states an artifact stamped with a prior group/version "must be regenerated rather than accepted." But the bundle handler validates no header field (there is no IsSupportedAPIVersion check on the /v1/bundle path — that gate lives only on the CLI file-load path in loader.go), so a POST with e.g. apiVersion: aicr.run/v1alpha1 still returns 200, the field silently ignored. The new TestBundleHandler_LegacyRecipeHeaders covers only empty/absent apiVersion, not a bogus non-empty one. The word "accepted" reads as handler behavior when it actually describes the client-contract policy.

Blast radius: None — fail-safe, and self-disclosed five lines earlier ("The handler does not validate these header fields"). Wording-precision only.

Fix: Optional: soften to "should be regenerated rather than sent," or add a negative case to TestBundleHandler_LegacyRecipeHeaders documenting that the server is lenient here too (a prior apiVersion is ignored, not rejected).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed — that wording was mine and it does read as handler behavior when it states a client-contract rule. Fixed in 3f0fab1, in both the docs prose and the BundleRecipeRequest schema description, which carried the same phrasing.

Now: "should be regenerated rather than sent", followed by an explicit statement that this is a client-contract rule rather than an enforced one — a prior apiVersion is ignored, not rejected, and the CLI file-load path is where it is actually enforced.

On the alternative you offered: I did not add a negative case pinning the lenient apiVersion behavior. #1953 explicitly weighs making the handler reject an unsupported non-empty apiVersion the way the loader does, so a test asserting 200 for a bogus value would encode behavior we may deliberately change, and would then have to be rewritten by that fix. Happy to add it as a characterization test if you would rather have the current behavior pinned in the meantime — just say so.

@njhensley njhensley left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🔁 Re-review — approve, clean pass (head 3f0fab1)

Re-reviewed after the latest push. The single wording nit from my prior pass is resolved and there are no remaining findings.

The docs and schema no longer imply the /v1/bundle handler rejects a prior apiVersion. Both now state the enum is a client-contract rule, not enforced — the endpoint validates no header field (a prior apiVersion is ignored, request still 200s), while the CLI file-load path (loader.go, IsSupportedAPIVersion) does reject an unsupported apiVersion outright. Both claims verified against the code.

Summary of the review arc

  • Original (14bf3d0): 2 🟡 + 4 🔵 — missing HTTP-boundary test, request enum stricter than handler, allOf positional indexing, helper naming, split code span, codegen note.
  • Re-review 1 (06d223d): all six resolved (new TestBundleHandler_LegacyRecipeHeaders, widened kind enum + round-trip caveat docs, content-based allOf matching, rename, reflow, plus a response-site strictness guard); one new 🔵 wording nit.
  • Re-review 2 (3f0fab1): wording nit resolved.
🔴 Blocker 🟠 Major 🟡 Minor 🔵 Nitpick
0 0 0 0

A well-run PR — thorough, responsive to review, and cleanly documented. LGTM.

@njhensley
njhensley enabled auto-merge (squash) July 29, 2026 17:10
@njhensley
njhensley merged commit 470397f into NVIDIA:main Jul 29, 2026
38 checks passed
mohityadav8 added a commit to mohityadav8/aicr that referenced this pull request Jul 31, 2026
…alth checks

Closes NVIDIA#1246.

- kueue: resourceflavors/clusterqueues/localqueues.kueue.x-k8s.io (verified via in-tree manifests)
- kubeflow-trainer: trainjobs.trainer.kubeflow.org (verified via tests/chainsaw/ai-conformance/kind-training-kubeflow/assert-crds.yaml)
- network-operator: nicclusterpolicies.mellanox.com (verified via components/network-operator/manifests/nic-cluster-policy-aks.yaml)
- k8s-nim-operator: nimservices/nimcaches/nimpipelines.apps.nvidia.com (verified via docs/conformance/cncf/v1.35/nim-eks/evidence/robust-operator.md)
- gatekeeper: constrainttemplates.templates.gatekeeper.sh + configs.config.gatekeeper.sh (needs live-cluster confirmation against chart 3.22.2, flagged inline)
- slinky-slurm-operator: negative finding documented - crds.enabled: false, CRDs owned entirely by sibling slinky-slurm-operator-crds chart

Signed-off-by: Mohit Yadav <[email protected]>

docs: restore slinky-slurm-operator health check, add comment-only negative finding

Signed-off-by: Mohit Yadav <[email protected]>

fix: address review comments on NVIDIA#1246 CRD backfill

fix: sync kubeflow-trainer CRD docs with asserted trainingruntimes (coderabbitai)

address review: soften gatekeeper verification wording, fix volatile line refs, rename CRD step for consistency

chore: pausing scans

chore: skills cleanup

chore(deps): Update python Docker tag to v3.14 (NVIDIA#1906)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Mark Chmarny <[email protected]>

revert(validators): pin aiperf-bench base back to python:3.13-slim (NVIDIA#1909)

Signed-off-by: Nathan Hensley <[email protected]>

fix(rekor-monitor): correlate identity via release-workflow run history (NVIDIA#1903)

Signed-off-by: Brian Lockwood <[email protected]>
Co-authored-by: Mark Chmarny <[email protected]>

fix(validators): multi-stage aiperf-bench build; bump aiperf to 0.11.0 (NVIDIA#1912)

Signed-off-by: Nathan Hensley <[email protected]>

feat(skills): download UAT debug bundles for failure triage (NVIDIA#1913)

Signed-off-by: Nathan Hensley <[email protected]>

chore: deps: bump renovatebot/github-action from 46.1.20 to 46.1.21 (NVIDIA#1923)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

feat(skills): add aicr-triage skill for project board triage (NVIDIA#1911)

chore(deps): regenerate stale THIRD_PARTY_NOTICES.md (NVIDIA#1926)

Signed-off-by: Nathan Hensley <[email protected]>

feat(server): non-interactive bundle attestation for /v1/bundle (NVIDIA#1891)

chore(deps): Update dependency awscli to v1.45.52 (NVIDIA#1905)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Mark Chmarny <[email protected]>
Co-authored-by: Nathan Hensley <[email protected]>

ci(stale): drop phantom priority/critical exempt label (NVIDIA#1925)

Signed-off-by: Yuan Chen <[email protected]>

chore(deps): Update dependency sigstore/cosign to v3.1.2 (NVIDIA#1924)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Lalit Adithya <[email protected]>
Co-authored-by: Brian Lockwood <[email protected]>

feat(skills): add aicr-cross-review skill for multi-agent PR review (NVIDIA#1915)

Signed-off-by: Yuan Chen <[email protected]>

chore: deps: bump github.com/prometheus/client_golang from 1.24.0 to 1.24.1 (NVIDIA#1922)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Lalit Adithya <[email protected]>
Co-authored-by: Brian Lockwood <[email protected]>

fix: resolve goconst and errorlint warnings across OCI, coverage, validators (NVIDIA#1916)

Signed-off-by: Andrew White <[email protected]>

chore(deps): Update testing-tools (NVIDIA#1934)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

fix(skills): harden UAT debug-bundle triage against malformed input (NVIDIA#1914)

Signed-off-by: Nathan Hensley <[email protected]>

chore: deps: bump actions/stale from 10.4.0 to 11.0.0 (NVIDIA#1931)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Lalit Adithya <[email protected]>

fix(ci): sync coverage docs to 80% and fail closed on bad threshold (NVIDIA#1937)

docs: correct issue/PR lifecycle table, fix reminder dedupe (NVIDIA#1921)

Signed-off-by: Yuan Chen <[email protected]>
Co-authored-by: Nathan Hensley <[email protected]>

chore: deps: bump actions/checkout from 7.0.0 to 7.0.1 (NVIDIA#1930)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Nathan Hensley <[email protected]>
Co-authored-by: Brian Lockwood <[email protected]>

fix(recipe,client): reject duplicate ComponentRef names, omit disable… (NVIDIA#1917)

Co-authored-by: Nathan Hensley <[email protected]>

fix(validators): pass aiperf model via --model flag (NVIDIA#1939)

Signed-off-by: Nathan Hensley <[email protected]>

fix(skills): recover cross-review lanes, harden consensus/fallback (NVIDIA#1932)

Signed-off-by: Yuan Chen <[email protected]>

feat(rekor-monitor): resumable identity scan to catch up large backlogs (NVIDIA#1929)

Signed-off-by: Brian Lockwood <[email protected]>

fix(bundler): create argocd-helm static/ only when populated (NVIDIA#1944)

Signed-off-by: Yuan Chen <[email protected]>

chore: deps: update hashicorp/azurerm requirement from ~> 4.0 to ~> 5.0 in /infra/uat-azure-account (NVIDIA#1945)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

fix(ci): run validators/ unit tests in make test, exclude from coverage gate (NVIDIA#1918)

Signed-off-by: Mohit Yadav <[email protected]>
Co-authored-by: Nathan Hensley <[email protected]>

feat(corroborate): improve evidence dashboard UX (NVIDIA#1935)

Signed-off-by: Nathan Hensley <[email protected]>

fix(api): accept versionless legacy bundle recipes (NVIDIA#1943)

Signed-off-by: Yuan Chen <[email protected]>

test(bundler): cover argocd-helm OCP bundling and pin its error contract (NVIDIA#1950)

Signed-off-by: Yuan Chen <[email protected]>

chore: remove stray MOFED debug artifacts from repo root (NVIDIA#1955)

Signed-off-by: Nathan Hensley <[email protected]>

fix(deps): bump network-operator default to v26.4.1 (NVIDIA#1938)

Signed-off-by: Atif Mahmood <[email protected]>
Co-authored-by: Atif Mahmood <[email protected]>

chore: deps: bump renovatebot/github-action from 46.1.21 to 46.2.0 (NVIDIA#1964)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

chore(deps): Update ministackorg/ministack Docker tag to v1.4.7 (NVIDIA#1965)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Lalit Adithya <[email protected]>

feat(recipe): implement the ADR-015 profile core (NVIDIA#1933)

Signed-off-by: Yuan Chen <[email protected]>

fix(bom): extract nested operator images (NVIDIA#1960)

Signed-off-by: Yuan Chen <[email protected]>

address yuanchen8911 review: bump network-operator to 26.4.1 with nicnodepolicies exclusion, close gatekeeper TODO with verification
mohityadav8 added a commit to mohityadav8/aicr that referenced this pull request Jul 31, 2026
…alth checks

Closes NVIDIA#1246.

- kueue: resourceflavors/clusterqueues/localqueues.kueue.x-k8s.io (verified via in-tree manifests)
- kubeflow-trainer: trainjobs.trainer.kubeflow.org (verified via tests/chainsaw/ai-conformance/kind-training-kubeflow/assert-crds.yaml)
- network-operator: nicclusterpolicies.mellanox.com (verified via components/network-operator/manifests/nic-cluster-policy-aks.yaml)
- k8s-nim-operator: nimservices/nimcaches/nimpipelines.apps.nvidia.com (verified via docs/conformance/cncf/v1.35/nim-eks/evidence/robust-operator.md)
- gatekeeper: constrainttemplates.templates.gatekeeper.sh + configs.config.gatekeeper.sh (needs live-cluster confirmation against chart 3.22.2, flagged inline)
- slinky-slurm-operator: negative finding documented - crds.enabled: false, CRDs owned entirely by sibling slinky-slurm-operator-crds chart

Signed-off-by: Mohit Yadav <[email protected]>

docs: restore slinky-slurm-operator health check, add comment-only negative finding

Signed-off-by: Mohit Yadav <[email protected]>

fix: address review comments on NVIDIA#1246 CRD backfill

fix: sync kubeflow-trainer CRD docs with asserted trainingruntimes (coderabbitai)

address review: soften gatekeeper verification wording, fix volatile line refs, rename CRD step for consistency

chore: pausing scans

chore: skills cleanup

chore(deps): Update python Docker tag to v3.14 (NVIDIA#1906)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Mark Chmarny <[email protected]>

revert(validators): pin aiperf-bench base back to python:3.13-slim (NVIDIA#1909)

Signed-off-by: Nathan Hensley <[email protected]>

fix(rekor-monitor): correlate identity via release-workflow run history (NVIDIA#1903)

Signed-off-by: Brian Lockwood <[email protected]>
Co-authored-by: Mark Chmarny <[email protected]>

fix(validators): multi-stage aiperf-bench build; bump aiperf to 0.11.0 (NVIDIA#1912)

Signed-off-by: Nathan Hensley <[email protected]>

feat(skills): download UAT debug bundles for failure triage (NVIDIA#1913)

Signed-off-by: Nathan Hensley <[email protected]>

chore: deps: bump renovatebot/github-action from 46.1.20 to 46.1.21 (NVIDIA#1923)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

feat(skills): add aicr-triage skill for project board triage (NVIDIA#1911)

chore(deps): regenerate stale THIRD_PARTY_NOTICES.md (NVIDIA#1926)

Signed-off-by: Nathan Hensley <[email protected]>

feat(server): non-interactive bundle attestation for /v1/bundle (NVIDIA#1891)

chore(deps): Update dependency awscli to v1.45.52 (NVIDIA#1905)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Mark Chmarny <[email protected]>
Co-authored-by: Nathan Hensley <[email protected]>

ci(stale): drop phantom priority/critical exempt label (NVIDIA#1925)

Signed-off-by: Yuan Chen <[email protected]>

chore(deps): Update dependency sigstore/cosign to v3.1.2 (NVIDIA#1924)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Lalit Adithya <[email protected]>
Co-authored-by: Brian Lockwood <[email protected]>

feat(skills): add aicr-cross-review skill for multi-agent PR review (NVIDIA#1915)

Signed-off-by: Yuan Chen <[email protected]>

chore: deps: bump github.com/prometheus/client_golang from 1.24.0 to 1.24.1 (NVIDIA#1922)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Lalit Adithya <[email protected]>
Co-authored-by: Brian Lockwood <[email protected]>

fix: resolve goconst and errorlint warnings across OCI, coverage, validators (NVIDIA#1916)

Signed-off-by: Andrew White <[email protected]>

chore(deps): Update testing-tools (NVIDIA#1934)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

fix(skills): harden UAT debug-bundle triage against malformed input (NVIDIA#1914)

Signed-off-by: Nathan Hensley <[email protected]>

chore: deps: bump actions/stale from 10.4.0 to 11.0.0 (NVIDIA#1931)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Lalit Adithya <[email protected]>

fix(ci): sync coverage docs to 80% and fail closed on bad threshold (NVIDIA#1937)

docs: correct issue/PR lifecycle table, fix reminder dedupe (NVIDIA#1921)

Signed-off-by: Yuan Chen <[email protected]>
Co-authored-by: Nathan Hensley <[email protected]>

chore: deps: bump actions/checkout from 7.0.0 to 7.0.1 (NVIDIA#1930)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Nathan Hensley <[email protected]>
Co-authored-by: Brian Lockwood <[email protected]>

fix(recipe,client): reject duplicate ComponentRef names, omit disable… (NVIDIA#1917)

Co-authored-by: Nathan Hensley <[email protected]>

fix(validators): pass aiperf model via --model flag (NVIDIA#1939)

Signed-off-by: Nathan Hensley <[email protected]>

fix(skills): recover cross-review lanes, harden consensus/fallback (NVIDIA#1932)

Signed-off-by: Yuan Chen <[email protected]>

feat(rekor-monitor): resumable identity scan to catch up large backlogs (NVIDIA#1929)

Signed-off-by: Brian Lockwood <[email protected]>

fix(bundler): create argocd-helm static/ only when populated (NVIDIA#1944)

Signed-off-by: Yuan Chen <[email protected]>

chore: deps: update hashicorp/azurerm requirement from ~> 4.0 to ~> 5.0 in /infra/uat-azure-account (NVIDIA#1945)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

fix(ci): run validators/ unit tests in make test, exclude from coverage gate (NVIDIA#1918)

Signed-off-by: Mohit Yadav <[email protected]>
Co-authored-by: Nathan Hensley <[email protected]>

feat(corroborate): improve evidence dashboard UX (NVIDIA#1935)

Signed-off-by: Nathan Hensley <[email protected]>

fix(api): accept versionless legacy bundle recipes (NVIDIA#1943)

Signed-off-by: Yuan Chen <[email protected]>

test(bundler): cover argocd-helm OCP bundling and pin its error contract (NVIDIA#1950)

Signed-off-by: Yuan Chen <[email protected]>

chore: remove stray MOFED debug artifacts from repo root (NVIDIA#1955)

Signed-off-by: Nathan Hensley <[email protected]>

fix(deps): bump network-operator default to v26.4.1 (NVIDIA#1938)

Signed-off-by: Atif Mahmood <[email protected]>
Co-authored-by: Atif Mahmood <[email protected]>

chore: deps: bump renovatebot/github-action from 46.1.21 to 46.2.0 (NVIDIA#1964)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

chore(deps): Update ministackorg/ministack Docker tag to v1.4.7 (NVIDIA#1965)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Lalit Adithya <[email protected]>

feat(recipe): implement the ADR-015 profile core (NVIDIA#1933)

Signed-off-by: Yuan Chen <[email protected]>

fix(bom): extract nested operator images (NVIDIA#1960)

Signed-off-by: Yuan Chen <[email protected]>

address yuanchen8911 review: bump network-operator to 26.4.1 with nicnodepolicies exclusion, close gatekeeper TODO with verification
@yuanchen8911
yuanchen8911 deleted the fix/v1-bundle-versionless-openapi branch August 19, 2026 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Align /v1/bundle OpenAPI schema with versionless legacy recipe support

2 participants