helmfile/pkg/state
yxxhero 781d28a47a
feat: add defaultInherit for automatic release template inheritance (#2600)
* feat: add defaultInherit for automatic release template inheritance

Add a top-level defaultInherit field to helmfile.yaml that automatically
applies template inheritance to all releases without requiring explicit
inherit on each release.

The field accepts a single template name as a string or a list of
template names. Releases that already explicitly inherit from the same
template are not duplicated.

Fixes #2599

Signed-off-by: yxxhero <aiopsclub@163.com>

* style: fix gci formatting in app_template_test.go

Signed-off-by: yxxhero <aiopsclub@163.com>

* fix: correct relative chart path in integration test

Signed-off-by: yxxhero <aiopsclub@163.com>

* fix: use absolute chart path in bad-helmfile test

Signed-off-by: yxxhero <aiopsclub@163.com>

* fix: use clean chart path in bad-helmfile test

Signed-off-by: yxxhero <aiopsclub@163.com>

* fix: use dir variable for chart path

Signed-off-by: yxxhero <aiopsclub@163.com>

* test: fix flaky defaultInherit integration assertions

Agent-Logs-Url: https://github.com/helmfile/helmfile/sessions/d0884e8e-8b1b-456d-8250-dec1566b8a37

Co-authored-by: yxxhero <11087727+yxxhero@users.noreply.github.com>

* test: tighten defaultInherit integration assertions

Agent-Logs-Url: https://github.com/helmfile/helmfile/sessions/d0884e8e-8b1b-456d-8250-dec1566b8a37

Co-authored-by: yxxhero <11087727+yxxhero@users.noreply.github.com>

* test: harden release block parsing in issue-2599 case

Agent-Logs-Url: https://github.com/helmfile/helmfile/sessions/d0884e8e-8b1b-456d-8250-dec1566b8a37

Co-authored-by: yxxhero <11087727+yxxhero@users.noreply.github.com>

* test: make issue-2599 assertions format-tolerant

Agent-Logs-Url: https://github.com/helmfile/helmfile/sessions/d0884e8e-8b1b-456d-8250-dec1566b8a37

Co-authored-by: yxxhero <11087727+yxxhero@users.noreply.github.com>

* test: fix section extraction and regex matching in issue-2599 case

Agent-Logs-Url: https://github.com/helmfile/helmfile/sessions/d0884e8e-8b1b-456d-8250-dec1566b8a37

Co-authored-by: yxxhero <11087727+yxxhero@users.noreply.github.com>

* fix: sanitize defaultInherit values and dedupe applied templates

Agent-Logs-Url: https://github.com/helmfile/helmfile/sessions/85a8e815-3701-4b48-a28d-6bb2d50a3b40

Co-authored-by: yxxhero <11087727+yxxhero@users.noreply.github.com>

* chore: address validation feedback on defaultInherit fixes

Agent-Logs-Url: https://github.com/helmfile/helmfile/sessions/85a8e815-3701-4b48-a28d-6bb2d50a3b40

Co-authored-by: yxxhero <11087727+yxxhero@users.noreply.github.com>

* fix: sanitize releaseInherit entries in applyDefaultInherit; add cleanup trap and quote vars in integration test

Agent-Logs-Url: https://github.com/helmfile/helmfile/sessions/1fbf62d5-7ce2-42e5-898b-30151c0c1ef9

Co-authored-by: yxxhero <11087727+yxxhero@users.noreply.github.com>

* refactor: combine releaseInherit loops in applyDefaultInherit to avoid double TrimSpace; clarify test comment

Agent-Logs-Url: https://github.com/helmfile/helmfile/sessions/1fbf62d5-7ce2-42e5-898b-30151c0c1ef9

Co-authored-by: yxxhero <11087727+yxxhero@users.noreply.github.com>

* test: align default inherit tests with yaml wrapper and assertions

Agent-Logs-Url: https://github.com/helmfile/helmfile/sessions/3ea9b8e4-633f-43c4-899f-e063ec576486

Co-authored-by: yxxhero <11087727+yxxhero@users.noreply.github.com>

* test: address review feedback on defaultInherit tests

Agent-Logs-Url: https://github.com/helmfile/helmfile/sessions/3ea9b8e4-633f-43c4-899f-e063ec576486

Co-authored-by: yxxhero <11087727+yxxhero@users.noreply.github.com>

* test: fix issue-2599 integration script helmfile invocation

Agent-Logs-Url: https://github.com/helmfile/helmfile/sessions/9452bb65-7086-459f-b5ae-0b00c1e021eb

Co-authored-by: yxxhero <11087727+yxxhero@users.noreply.github.com>

---------

Signed-off-by: yxxhero <aiopsclub@163.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-05-20 18:21:03 +08:00
..
testdata feat(state): add mergeStrategy: fallback for first-file-wins env values (#2578) 2026-05-07 21:50:05 +08:00
chart_dependencies_rewrite_test.go fix: refresh Chart.lock after rewriting file:// dependencies (#2587) 2026-05-19 05:41:41 +08:00
chart_dependency.go
chart_dependency_test.go
create.go feat(state): add mergeStrategy: fallback for first-file-wins env values (#2578) 2026-05-07 21:50:05 +08:00
create_test.go feat(state): add mergeStrategy: fallback for first-file-wins env values (#2578) 2026-05-07 21:50:05 +08:00
diff_error_propagation_test.go
environment.go feat(state): add mergeStrategy: fallback for first-file-wins env values (#2578) 2026-05-07 21:50:05 +08:00
envvals_loader.go feat(state): add mergeStrategy: fallback for first-file-wins env values (#2578) 2026-05-07 21:50:05 +08:00
envvals_loader_test.go feat(state): add mergeStrategy: fallback for first-file-wins env values (#2578) 2026-05-07 21:50:05 +08:00
helmx.go fix: normalize dependency chart path before DirectoryExistsAt check (#2598) 2026-05-20 08:44:14 +08:00
helmx_test.go
issue_2297_test.go
issue_2355_test.go
issue_2444_test.go
issue_2549_test.go
issue_2596_test.go fix: normalize dependency chart path before DirectoryExistsAt check (#2598) 2026-05-20 08:44:14 +08:00
oci_chart_lock_test.go
oci_chart_version_test.go
oci_parse_test.go
release.go
release_error.go
release_filters.go
release_filters_test.go
release_test.go
run_helm_dep_builds_skip_refresh_test.go
selector_test.go
skip_test.go
state.go feat: add defaultInherit for automatic release template inheritance (#2600) 2026-05-20 18:21:03 +08:00
state_exec_tmpl.go feat: add defaultInherit for automatic release template inheritance (#2600) 2026-05-20 18:21:03 +08:00
state_exec_tmpl_test.go feat: add defaultInherit for automatic release template inheritance (#2600) 2026-05-20 18:21:03 +08:00
state_gogetter_test.go
state_kubeversion_test.go
state_run.go
state_test.go fix: template helmDefaults.postRendererArgs with release data (#2583) 2026-05-11 09:05:06 +08:00
storage.go
storage_test.go
temp.go
temp_test.go
types.go
types_test.go
util.go
util_test.go