fix: helmDefaults.skipRefresh ignored in runHelmDepBuilds#2415
Merged
aditmeno merged 1 commit intoFeb 22, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a remaining gap in Helmfile’s “skip refresh” behavior so helmDefaults.skipRefresh: true is honored during runHelmDepBuilds() (preventing an unexpected helm repo update before dependency builds), and adds regression coverage across unit, app-level, and integration tests.
Changes:
- Update
runHelmDepBuilds()to also respectst.HelmDefaults.SkipRefreshbefore callinghelm.UpdateRepo(). - Add a focused unit test verifying
UpdateRepois skipped whenhelmDefaults.skipRefresh=true. - Add app-level and integration regression tests ensuring repo operations are not performed when helmDefaults skip flags are set.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
pkg/state/state.go |
Ensures pre-build helm repo update is skipped when helmDefaults.skipRefresh is enabled. |
pkg/state/issue_2296_test.go |
Adds regression coverage for runHelmDepBuilds() skipping UpdateRepo based on helmDefaults. |
pkg/app/app_test.go |
Adds an end-to-end-ish test asserting Template() makes no AddRepo calls when helmDefaults skip flags are set. |
test/integration/test-cases/issue-2269.sh |
Adds an integration regression script that templates successfully with a fake repo URL when helmDefaults skip flags are set. |
test/integration/test-cases/issue-2269/input/helmfile.yaml |
Minimal helmfile input defining a fake repo + helmDefaults skip flags + local chart release. |
test/integration/test-cases/issue-2269/input/chart/Chart.yaml |
Minimal chart metadata for the integration test. |
test/integration/test-cases/issue-2269/input/chart/templates/configmap.yaml |
Minimal rendered manifest used as a sanity check in the integration test output. |
) `runHelmDepBuilds()` only checked the CLI flag (`opts.SkipRefresh`) when deciding whether to run `helm repo update` before building dependencies. This meant that setting `helmDefaults.skipRefresh: true` in helmfile.yaml had no effect on the repo update call inside dep builds. Add `!st.HelmDefaults.SkipRefresh` to the guard condition so that `helmDefaults.skipRefresh: true` is respected alongside the CLI flag. Signed-off-by: Aditya Menon <[email protected]>
1935888 to
e96e403
Compare
yxxhero
approved these changes
Feb 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #2269 — residual bug where
helmDefaults.skipRefresh: truewas ignored inrunHelmDepBuilds().Context
Two earlier PRs addressed parts of issue #2269:
prepareChartForRelease()forskipDeps/skipRefreshwithPreparedCharts()to checkhelmDefaults.SkipDeps || helmDefaults.SkipRefreshwhen deciding whether to skipSyncReposOnceA residual bug remained in
runHelmDepBuilds()(state.go:1864): thehelm repo updatecall before dep builds only checked the CLI flag (opts.SkipRefresh), notst.HelmDefaults.SkipRefresh. This meant that withhelmDefaults.skipRefresh: trueandskipDeps: false(local charts needing dep builds),helm repo updatewould still run.Note:
helmDefaults.skipDepsdoes not need a check here because when it's true, no builds are generated upstream (buildDeps=false), solen(builds) > 0is already false.Changes
Bug fix (
pkg/state/state.go):Tests added:
pkg/state/issue_2296_test.goTestRunHelmDepBuilds_HelmDefaultsSkipRefreshrunHelmDepBuildsskipsUpdateRepowhenhelmDefaults.skipRefresh=true(4 cases)pkg/app/app_test.goTestTemplate_HelmDefaultsSkipDepsSkipRefreshapp.Template()with helmDefaults produces noAddRepocallstest/integration/test-cases/issue-2269.shhelmfile templatewith a fake repo URL succeeds when helmDefaults skip flags are set (would fail if repos were contacted)Test plan
go test ./pkg/state/... -run TestRunHelmDepBuilds_HelmDefaultsSkipRefresh -vgo test ./pkg/app/... -run TestTemplate_HelmDefaultsSkipDepsSkipRefresh -vgo test ./pkg/state/... -count=1(full suite, no regressions)go test ./pkg/app/... -count=1(full suite, no regressions)helmfile templatewith fake repo + helmDefaults skips succeeds; without helmDefaults it fails with "Adding repo" + DNS error