Skip to content

fix: helmDefaults.skipRefresh ignored in runHelmDepBuilds#2415

Merged
aditmeno merged 1 commit into
helmfile:mainfrom
aditmeno:fix/helm-defaults-skip-deps-refresh-2269
Feb 22, 2026
Merged

fix: helmDefaults.skipRefresh ignored in runHelmDepBuilds#2415
aditmeno merged 1 commit into
helmfile:mainfrom
aditmeno:fix/helm-defaults-skip-deps-refresh-2269

Conversation

@aditmeno

Copy link
Copy Markdown
Contributor

Summary

Fixes #2269 — residual bug where helmDefaults.skipRefresh: true was ignored in runHelmDepBuilds().

Context

Two earlier PRs addressed parts of issue #2269:

A residual bug remained in runHelmDepBuilds() (state.go:1864): the helm repo update call before dep builds only checked the CLI flag (opts.SkipRefresh), not st.HelmDefaults.SkipRefresh. This meant that with helmDefaults.skipRefresh: true and skipDeps: false (local charts needing dep builds), helm repo update would still run.

Note: helmDefaults.skipDeps does not need a check here because when it's true, no builds are generated upstream (buildDeps=false), so len(builds) > 0 is already false.

Changes

Bug fix (pkg/state/state.go):

- if len(builds) > 0 && !opts.SkipRefresh && len(st.Repositories) > 0 {
+ if len(builds) > 0 && !opts.SkipRefresh && !st.HelmDefaults.SkipRefresh && len(st.Repositories) > 0 {

Tests added:

File Test What it verifies
pkg/state/issue_2296_test.go TestRunHelmDepBuilds_HelmDefaultsSkipRefresh runHelmDepBuilds skips UpdateRepo when helmDefaults.skipRefresh=true (4 cases)
pkg/app/app_test.go TestTemplate_HelmDefaultsSkipDepsSkipRefresh End-to-end: app.Template() with helmDefaults produces no AddRepo calls
test/integration/test-cases/issue-2269.sh Integration test helmfile template with 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 -v
  • go test ./pkg/app/... -run TestTemplate_HelmDefaultsSkipDepsSkipRefresh -v
  • go test ./pkg/state/... -count=1 (full suite, no regressions)
  • go test ./pkg/app/... -count=1 (full suite, no regressions)
  • Manual verification: built helmfile from source, confirmed helmfile template with fake repo + helmDefaults skips succeeds; without helmDefaults it fails with "Adding repo" + DNS error

Copilot AI 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.

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 respect st.HelmDefaults.SkipRefresh before calling helm.UpdateRepo().
  • Add a focused unit test verifying UpdateRepo is skipped when helmDefaults.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.

Comment thread test/integration/test-cases/issue-2269.sh
)

`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]>
@aditmeno aditmeno force-pushed the fix/helm-defaults-skip-deps-refresh-2269 branch from 1935888 to e96e403 Compare February 22, 2026 06:20
@aditmeno aditmeno requested a review from Copilot February 22, 2026 06:20

Copilot AI 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.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.

@aditmeno aditmeno merged commit abfe73f into helmfile:main Feb 22, 2026
20 checks passed
@aditmeno aditmeno deleted the fix/helm-defaults-skip-deps-refresh-2269 branch February 22, 2026 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.helmDefaults.skipDeps and .helmDefaults.skipRefresh are ignored

3 participants