fix(bundler): argocd-helm parent App uses native-OCI source shape#1051
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Enterprise Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThis PR changes the argocdhelm deployer to dispatch two parent Application render shapes by repoURL scheme: for oci:// inputs the parent App emits spec.source.repoURL as "/<.Chart.Name>", clears spec.source.chart, and sets spec.source.path="."; for non-OCI helm repos it emits repoURL and spec.source.chart. Corresponding docs, testdata, live-render tests, and operator logging were updated to match the new contract. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
PR NVIDIA#1047 / NVIDIA#1048 tried to fix the argocd-helm-oci KWOK failures by adjusting how the wrapper script passes `--set repoURL=…`, but the root cause is in the bundler's parent App template, not the wrapper. # Why the previous fix did not hold `parentAppTemplate` (pkg/bundler/deployer/argocdhelm/argocdhelm.go) rendered a Helm-OCI shape: source: repoURL: <Values.repoURL> # e.g., oci://reg/path chart: <.Chart.Name> # e.g., my-bundle targetRevision: <tag> The design assumed Argo CD would resolve this as `<repoURL>/<chart>:<tag>`. But Argo CD's `oci://` scheme triggers the **native OCI** code path, where `repoURL` is the FULL artifact reference and `source.chart` is silently ignored. CI confirms it: HEAD /v2/aicr/manifests/0.0.0-<sha>-argocd-helm-oci (artifact actually lives at /v2/aicr/<recipe>/manifests/...) The Argo CD user guide splits the two shapes explicitly: - Helm OCI charts (no `oci://`, `chart:` set): https://argo-cd.readthedocs.io/en/stable/user-guide/helm/ - Native OCI artifacts (`oci://` repoURL, `path:` set): https://argo-cd.readthedocs.io/en/stable/user-guide/oci/ # Fix: dispatch parent App shape on repoURL scheme Conditional template: - `oci://...` repoURL → native OCI shape: append `.Chart.Name` to repoURL, set `path: "."`, drop `chart:`. Mirrors the path-based child template at injectValuesIntoSingleSource. - HTTPS / HTTP repoURL → Helm chart repository shape: keep repoURL as-is, emit `chart: .Chart.Name`, drop `path:`. Preserves the pure-Helm install path the README still advertises (ChartMuseum, GitHub Pages, etc.). # Tests - TestHelmTemplate_RewrittenSources / TestHelmTemplate_PathBasedChildRepoURL updated for the native-OCI shape (parent.repoURL == namespace + "/" + chart, chart == "", path == "."). - TestHelmTemplate_RendersWithHelmRepoRepoURL added: verifies the HTTPS-mode rendering produces repoURL + chart with no path field. - TestGenerate_CustomChartName now asserts chart name in repoURL (was: source.chart). - TestHelmTemplate_AppNameOverride heuristic switched from `source.chart \!= ""` to `source.path == "."`. # Goldens testdata/{helm_and_manifest_only,mixed_component}/templates/aicr-stack.yaml regenerated. # Doc comments Stale `source.chart` / `repoURL/chart:tag` references in parentAppTemplate, Generator.ChartName, DefaultChartName, and the "Publication backends and the path field" block updated to describe the dual-mode contract and cite the Argo CD docs split. # KWOK wrapper script The PR NVIDIA#1047 comment block in kwok/scripts/validate-scheduling.sh referenced the now-wrong source.chart contract; updated to cite the new parentAppTemplate design. The conditional itself (per-lane assignment from NVIDIA#1048) is unchanged. Closes the argocd-helm-oci CI breakage on main introduced by PR NVIDIA#1047.
1d856a7 to
89e4bfa
Compare
Summary
Fix the
argocd-helmparent Application template to use Argo CD's native-OCI source shape (full artifact path inrepoURL,path: ".", nochart:field) instead of the brokenrepoURL + chartcombination that PR #1047 was built on.Motivation / Context
PRs #1047 and #1048 tried to fix the
argocd-helm-ociKWOK matrix failures by adjusting how the wrapper script passes--set repoURL=.... Both PRs landed but the failures persisted — and main is now red on everyargocd-helm-ociTier-1 job. The root cause is in the bundler's parent App template, not the wrapper script.parentAppTemplate(pkg/bundler/deployer/argocdhelm/argocdhelm.go) rendered:The design assumed Argo CD would resolve this as
<repoURL>/<chart>:<tag>. But Argo CD'soci://scheme triggers the native OCI code path, whererepoURLis the full artifact reference andsource.chartis silently ignored. CI confirms this — everyargocd-helm-ocijob on main fails with:while the artifact actually lives at
/v2/aicr/<recipe>/manifests/.... The Argo CD user guide splits the two shapes explicitly:oci://,chart:set): https://argo-cd.readthedocs.io/en/stable/user-guide/helm/oci://repoURL,path:set): https://argo-cd.readthedocs.io/en/stable/user-guide/oci/The path-based child Applications already use the native-OCI shape via
injectValuesIntoSingleSource(argocdhelm.go:759-786). This PR aligns the parent with that same contract.Fixes the
argocd-helm-ociCI breakage currently failing on main (and on every open PR). Diagnosed via Codex review after #1048 merged.Fixes: N/A (no dedicated tracking issue)
Related: #1047, #1048, #1019, #1018, #1034
Type of Change
Component(s) Affected
pkg/bundler,pkg/component/*)Implementation Notes
pkg/bundler/deployer/argocdhelm/argocdhelm.go— switchparentAppTemplateto:The
printf "%s/%s" … | quoteform renders to a single double-quoted YAML scalar, matching Codex's "make the parent repoURL render as a quoted final value" recommendation.Test updates (
argocdhelm_test.go) — the live-render assertions are broader than just goldens:TestHelmTemplate_RewrittenSources: parentrepoURLnow expected assetRepoURL + "/" + chartName;chartempty;path == ".".TestGenerate_CustomChartName: switched from assertingsource.chart == customNameto asserting the chart name flows intosource.repoURL(sincechartis no longer rendered).TestHelmTemplate_AppNameOverride: parent-App detection heuristic switched fromsource.chart \!= ""tosource.path == "."(parent renders at root; path-based children usepath: NNN-<name>).TestHelmTemplate_PathBasedChildRepoURL: parentrepoURLupdated to the new shape.Goldens —
testdata/{helm_and_manifest_only,mixed_component}/templates/aicr-stack.yamlregenerated viago test … -args -update.Doc comments — stale references to
source.chart/repoURL/chart:tagupdated in:DefaultChartName(line 100-106)Generator.ChartName(line 136-146)parentAppTemplatedoc block (line 427+)injectValuesIntoSingleSourcedoc block (line 748+)KWOK wrapper script (
kwok/scripts/validate-scheduling.sh) — the comment block I introduced in #1047 referenced the now-wrongsource.chartcontract. Replaced with an accurate description that cites the newparentAppTemplatedesign. The conditional itself (per-lane assignment from #1048) is unchanged.Testing
All pass —
make qualifyreports 22 chainsaw tests green, no vulnerabilities, license-headers clean, codebase qualification completed.Coverage: Touches
pkg/bundler/deployer/argocdhelmonly; the existing live-render tests already exercise the parent App template and were updated in-PR. No new untested code added.The real validation is CI itself. After this lands, every
argocd-helm-ociTier-1 matrix job on main and on rebased open PRs should turn green. Local KWOK can't easily reproduce the issue without a published OCI artifact, but the unit tests' live-render path useshelm templatewith the exact same source-render code path Argo's repo-server would consume.Risk Assessment
oci://repoURLs.Rollout notes: Any operator who has an existing argocd-helm install will continue to work; their parent App's
sourceblock was already rendered. New installs after this lands produce a parent App withpath: "."and nochartfield. Argo CD treats this as a native-OCI Helm chart source. If a downstream pipeline somewhere has hardcoded the old shape, it'd need to update — but I'm not aware of any such consumer, and the shape change is the whole point of the fix.Checklist
make testwith-race)make lint)git commit -S)