Repository navigation
feat: let release dependencies set their Chart.yaml condition - #2879
Merged
Merged
Conversation
An entry in a release's dependencies: list can now carry condition, which is written to the generated Chart.yaml. Left empty, chartify keeps the default <alias or chart name>.enabled, so helmfiles without the key render as before; before this, the strict loader rejected it. Signed-off-by: Cayan <[email protected]>
Cayan
requested review from
aditmeno,
itscaro,
mumoshu,
xiaomudk,
yxxhero and
zhaque44
as code owners
November 7, 2026 15:02
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the addition of configurable dependency conditions.
No open issues 🎉
What changed in this PR
Adds configurable conditions to ad-hoc release dependencies, addressing #1258 by allowing shared values paths such as global.envoy.enabled while preserving the existing default behavior.
Changes:
- Accepts
releases[].dependencies[].conditionand passes it to chartify. - Adds a regression test covering explicit and omitted conditions.
- Documents the new field and records it in the changelog.
| File | Description |
|---|---|
pkg/state/helmx.go |
Adds the dependency condition field and forwards it to chartify. |
pkg/state/helmx_test.go |
Tests YAML decoding and forwarding of explicit and omitted conditions. |
docs/advanced-features.md |
Explains the default condition and shows a custom values path. |
CHANGELOG.md |
Records support for configurable dependency conditions. |
Review effort: Balanced
yxxhero
approved these changes
Nov 8, 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.
An ad-hoc dependency in
releases[].dependenciesalways gets the condition<alias or chart name>.enabledin the generatedChart.yaml, and the entry has no field to change it. Settingcondition:fails to load, because the loader is strict:So a dependency cannot be switched by a shared values path such as
global.envoy.enabled.chartify v0.30.0 (helmfile/chartify#214, already in
go.mod) addedChartDependency.Condition, written to the dependency'sconditionand defaulting to<alias or chart name>.enabledwhen empty. This change addsconditionto the dependency entry and passes it to chartify. An entry withoutconditionproduces the sameChart.yamlas before. The dependencies section ofdocs/advanced-features.mddescribes the field.Test:
TestPrepareChartify_DependencyConditioninpkg/state/helmx_test.godecodes a release with two dependencies, one withcondition: global.bar.enabledand one without, runsPrepareChartifyand checks the chartify dependencies: the first carries the condition, the second an empty one (chartify's default). It fails onmainwithCondition: ""where"global.bar.enabled"is expected.helmfile templateon a local chartfoowith a local dependencybar, release valuesglobal.bar.enabled: false:condition: global.bar.enabled:mainfails with the error above; this branch renders onlyfoo.condition:mainand this branch both renderfooandbar.Resolves #1258 (part A was helmfile/chartify#214).