Skip to content

fix(bundler): scope helmfile disableValidation to primary release#1125

Merged
mchmarny merged 1 commit into
mainfrom
fix/helmfile-disable-validation-929
May 30, 2026
Merged

fix(bundler): scope helmfile disableValidation to primary release#1125
mchmarny merged 1 commit into
mainfrom
fix/helmfile-disable-validation-929

Conversation

@mchmarny

Copy link
Copy Markdown
Member

Summary

Scope helmfile disableValidation: true to the primary release in a folder group; do not propagate it to the local-helm -pre/-post wrappers.

Motivation / Context

The HasSelfRefCRDs registry flag (added in #914 for charts whose templates reference CRDs the chart itself installs) was being applied to every release sharing a parent component. The wrappers are local-helm raw-manifest charts with no crds/ directory and no self-references, so inheriting the flag silently suppressed helm-diff's mapper sanity check on resources where it is still valuable.

Fixes: #929
Related: #914

Type of Change

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

Component(s) Affected

  • Bundlers (pkg/bundler, pkg/component/*)

Implementation Notes

  • In pkg/bundler/deployer/helmfile/releases.go, the gate is now if f.Name == f.Parent && flags[f.Parent].HasSelfRefCRDs — the f.Name == f.Parent predicate is the canonical "is this the primary release for this component" check in the localformat folder model. Wrappers append -pre/-post to Name while keeping Parent as the component name.
  • Comment on the DisableValidation field on Release was updated to record the scoping and reference both issues.

Testing

go test ./pkg/bundler/deployer/helmfile/
golangci-lint run -c .golangci.yaml ./pkg/bundler/deployer/helmfile/...
  • Added TestBuildHelmfile_DisableValidationPrimaryOnly with a pre + primary (KindUpstreamHelm) + post layout. Asserts DisableValidation is false on the wrappers and true only on the primary.
  • Regenerated the mixed_gpu_operator golden via go test ./pkg/bundler/deployer/helmfile/ -run TestGenerate_Scenarios -update. Diff: one line removed (disableValidation: true on gpu-operator-post).
  • Full package suite passes; lint reports 0 issues.

Risk Assessment

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

Rollout notes: Behavioral change is limited to bundles whose primary component has HasSelfRefCRDs: true AND ships wrappers — today this is gpu-operator only. Operators previously saw disableValidation: true on the post wrapper for gpu-operator; the new output removes it, restoring the mapper check on the wrapper's plain manifests. No registry / values / docs change.

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 (N/A — internal field comment only)
  • Changes follow existing patterns in the codebase
  • Commits are cryptographically signed (git commit -S)

The HasSelfRefCRDs flag was applied to every release in a folder group,
including the local-helm `-pre` and `-post` wrapper releases. Wrappers
hold only raw Kubernetes manifests with no `crds/` directory and no
self-references, so inheriting `disableValidation: true` silently
suppressed helm-diff's mapper sanity check on resources where it is
still valuable.

Gate the flag on `f.Name == f.Parent` so only the primary release
(matching folder name and parent component) gets `disableValidation`.

Regenerated the mixed_gpu_operator golden to drop the spurious flag on
the post wrapper. Added TestBuildHelmfile_DisableValidationPrimaryOnly
to cover the pre/primary/post split.
@mchmarny mchmarny requested a review from a team as a code owner May 30, 2026 12:19
@mchmarny mchmarny self-assigned this May 30, 2026
@mchmarny mchmarny merged commit e83728f into main May 30, 2026
30 of 31 checks passed
@mchmarny mchmarny deleted the fix/helmfile-disable-validation-929 branch May 30, 2026 12:21
@coderabbitai

coderabbitai Bot commented May 30, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 0f996d4b-d835-4ce9-8d2f-5537d0c4f1d1

📥 Commits

Reviewing files that changed from the base of the PR and between a1fc3ab and add6e5c.

📒 Files selected for processing (3)
  • pkg/bundler/deployer/helmfile/helmfile_test.go
  • pkg/bundler/deployer/helmfile/releases.go
  • pkg/bundler/deployer/helmfile/testdata/mixed_gpu_operator/helmfile.yaml
💤 Files with no reviewable changes (1)
  • pkg/bundler/deployer/helmfile/testdata/mixed_gpu_operator/helmfile.yaml

📝 Walkthrough

Walkthrough

This PR implements scoped application of the disableValidation flag in Helm file generation. The change restricts the flag to primary upstream Helm releases when HasSelfRefCRDs is enabled, preventing injected -pre and -post local-helm wrapper releases from inheriting the bypass. The core logic adds a primary-release guard condition, field documentation is clarified to reflect the new scoping, test coverage verifies the behavior, and test data is updated to align with the new expectations.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested labels

size/S, area/bundler

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title clearly and concisely summarizes the main change: scoping the helmfile disableValidation flag to the primary release only.
Description check ✅ Passed The pull request description is detailed and directly related to the changeset, explaining the motivation, implementation approach, testing, and risk assessment.
Linked Issues check ✅ Passed The code changes fully implement option 1 from issue #929: the gate now checks f.Name == f.Parent && flags[f.Parent].HasSelfRefCRDs to scope disableValidation to primary releases only, goldens are regenerated, and tests verify the behavior.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the objectives: updated releases.go logic, added test coverage, updated field documentation, and regenerated test data—no unrelated modifications present.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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/helmfile-disable-validation-929

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

@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report ✅

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

No Go source files changed in this PR.

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.

refine(bundler): scope disableValidation: true to primary release, not -pre/-post wrapper folders

1 participant