Repository navigation
fix: resolve OCI version constraints before deriving the shared chart cache path - #2768
Conversation
… cache path When an OCI release uses a semver constraint (e.g. `~1`, `^2.0.0`, `*`), `getOCIChartPath` currently derives the on-disk cache directory from the raw constraint string via `safeVersionPath`, which substitutes constraint characters (`~`, `^`, `>`, `<`, `!`, `|`, `=`, ` `, `,`, `*`) with `_`. So `version: ~1` becomes `.../mychart/_1/` on disk. `acquireChartLock` then refuses to refresh anything under the shared cache dir to avoid race conditions between concurrent processes, so once the constraint is first resolved and written to `_1/`, every subsequent render on that machine (or that container replica) returns the pinned tarball regardless of newer matching tags being published. In multi-pod deployments like ArgoCD's argocd-repo-server this shows up as intermittent stale renders: different pods populate their caches at different moments and serve different snapshots of the same `~1` release forever. Fix: for OCI releases whose `version` looks like a constraint, run `helm show chart <ref> --version <constraint> [flags]` and use the returned metadata.Version as the effective version for all downstream cache-key and path derivation. Helm already resolves the constraint against the registry and returns the concrete matching Chart.yaml. Callers get a content-addressable cache path (`.../mychart/1.0.1/`) that naturally invalidates when the constraint resolves to a new version. Exact-version releases and non-OCI releases skip the extra call. Adds an opt-out `resolveOCIVersions` field on `helmDefaults` and `ReleaseSpec` (both default true). If the resolution call fails transiently, the resolver logs a warning and falls back to the pre-fix behavior so a network hiccup doesn't break rendering. Adds `ShowChartWithFlags` to helmexec.Interface so the existing `ShowChart` API stays backwards compatible. Resolves helmfile#2766 Signed-off-by: Samuel Archambault <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
Wildcard constraints remain vulnerable to stale caching, and the exported interface change breaks downstream implementations.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Resolves stale OCI chart caches by resolving semver constraints before deriving cache paths.
Changes:
- Adds configurable OCI version resolution with release-level overrides.
- Extends Helm execution and test mocks for flagged
helm show chartcalls. - Adds tests and documentation for the new behavior.
File summaries
| File | Description |
|---|---|
pkg/state/state.go |
Resolves OCI constraints before caching. |
pkg/state/util.go |
Detects constraint-like versions. |
pkg/state/state_test.go |
Tests constraint resolution behavior. |
pkg/state/temp_test.go |
Updates release hash expectations. |
pkg/helmexec/helmexec.go |
Extends the Helm executor interface. |
pkg/helmexec/exec.go |
Implements flagged chart metadata lookup. |
pkg/exectest/helm.go |
Adds resolver stubbing support. |
pkg/testutil/mocks.go |
Updates the no-call Helm mock. |
pkg/app/app_test.go |
Updates the application Helm mock. |
docs/configuration.md |
Documents OCI resolution settings. |
Review details
- Files reviewed: 10/10 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| // ShowChartWithFlags runs `helm show chart` with the given flags and returns the | ||
| // parsed Chart.yaml metadata. Unlike ShowChart, callers pass flags such as | ||
| // --version, --plain-http, or --registry-config so that constraint versions (e.g. | ||
| // "~1", "^2.0.0") can be resolved against an OCI registry to a concrete semver. | ||
| ShowChartWithFlags(chart string, flags ...string) (chart.Metadata, error) |
There was a problem hiding this comment.
Addressed in c1673e1: ShowChartWithFlags moved off helmexec.Interface onto a new helmexec.ChartInspector capability interface, following the same pattern as the existing DependencyUpdater capability. The resolver type-asserts and falls back to pre-fix behavior when the capability is absent, so third-party implementations of helmexec.Interface keep compiling. Added TestResolveOCIConstraintVersion_ChartInspectorFallback covering the type-assertion fallback path with a value that satisfies Interface but not ChartInspector.
| func isVersionConstraint(v string) bool { | ||
| return strings.ContainsAny(v, versionConstraintChars) |
There was a problem hiding this comment.
Addressed in adb95a2. Replaced the character scan with a semver-parser-based check as you suggested: a value is a constraint iff semver.NewVersion rejects it and semver.NewConstraint accepts it. This correctly detects wildcard-segment constraints (1.x, 1.X, 1.x.x, 1.2.x, v1.x) while preserving exact versions where x legitimately appears in prerelease or build metadata (1.0.0-alpha.x, 1.0.0+x, 1.0.0+build.x.1) — a naive "add x to the scanned charset" fix would have false-positived on those.
Expanded TestIsVersionConstraint with the 8 wildcard cases (lowercase and uppercase, at every segment position, with and without v prefix) plus 3 prerelease/build metadata cases containing x, and added a wildcard segment constraint resolves to concrete version subtest to TestResolveOCIConstraintVersion so the end-to-end pipeline is exercised for a version string with no operator characters.
…rface Address Copilot review feedback on PR helmfile#2768: adding a method to the exported helmexec.Interface is a source-breaking change for every third-party implementation and mock of that interface, even though ShowChart itself stayed backward-compatible. Move ShowChartWithFlags off Interface and onto a new capability interface, helmexec.ChartInspector, following the same pattern used by the existing DependencyUpdater capability interface. The concrete execer and the exectest.Helm test stub still satisfy it (they already have the method); the OCI resolver in state.HelmState now type-asserts and falls back to the pre-fix caching behavior when the capability is absent, so downstream callers with their own helmexec.Interface implementations keep compiling untouched. Adds TestResolveOCIConstraintVersion_ChartInspectorFallback that exercises the type-assertion path with a helm value that satisfies Interface but deliberately does not satisfy ChartInspector. Reverts ShowChartWithFlags additions from testutil.noCallHelmExec and app_test.mockHelmExec since Interface no longer requires them. Signed-off-by: Samuel Archambault <[email protected]>
…ints Address Copilot review feedback on PR helmfile#2768: the previous isVersionConstraint implementation scanned the input for operator characters (~, ^, >, <, !, |, =, space, comma, *). Masterminds/semver also accepts wildcard-segment constraints like "1.x", "1.X", "1.x.x", and "1.2.X" that contain no operator characters. Those would slip past the classifier, bypass OCI constraint resolution, and remain cached forever under the raw ".../mychart/1.x/" path — the same stale-cache bug the PR is meant to fix. Replace the character scan with a semver-parser-based check: a value is a constraint iff Masterminds/semver rejects it as a NewVersion but accepts it as a NewConstraint. This correctly: - Recognizes wildcard forms (1.x, 1.X, 1.x.x, 1.2.x, v1.x). - Preserves exact versions where "x" appears in prerelease metadata ("1.0.0-alpha.x") or build metadata ("1.0.0+x", "1.0.0+build.x.1") without misclassifying them, which a naive "add x to the scanned charset" fix would have gotten wrong. - Continues to classify values that are neither a version nor a constraint (empty string, "latest", junk) as non-constraints; helm handles those elsewhere. Removes the now-unused versionConstraintChars string constant. Expands TestIsVersionConstraint with 8 wildcard cases and 3 prerelease /build metadata cases containing "x", plus 2 non-parseable inputs. Adds a "wildcard segment constraint resolves to concrete version" subtest to TestResolveOCIConstraintVersion so the end-to-end pipeline is exercised for a version string that has no operator characters. Signed-off-by: Samuel Archambault <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
The core cache-path and pull-version propagation lacks regression coverage.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 8/8 changed files
- Comments generated: 1
- Review effort level: Balanced
| if resolved, changed, resolveErr := st.resolveOCIConstraintVersion(release, helm, qualifiedChartName, chartVersion); resolveErr != nil { | ||
| st.logger.Warnf("resolving OCI version constraint %q for release %q failed: %v; falling back to unresolved constraint for cache key (a stale cache may be served)", chartVersion, release.Name, resolveErr) | ||
| } else if changed { | ||
| st.logger.Debugf("resolved OCI version constraint %q for release %q to %q", chartVersion, release.Name, resolved) | ||
| // Rewrite the release copy so the downstream cache key, path template, | ||
| // and --version flag all agree on the resolved value. | ||
| releaseCopy := *release | ||
| releaseCopy.Version = resolved | ||
| release = &releaseCopy | ||
| chartVersion = resolved |
There was a problem hiding this comment.
Addressed in bd149a0. Added pkg/state/issue_2766_test.go with two integration tests that exercise getOCIChart directly:
TestGetOCIChart_ResolvesConstraintIntoCachePathAndPullFlag— asserts that withversion: ~1resolving to1.0.1,helm chart pullreceives--version 1.0.1(not~1), the destination path contains/1.0.1/(not/_1/), and the resulting on-diskChart.yamlunder the cache path holds the resolved version. Confirms path, flag, and disk state agree end to end.TestGetOCIChart_ResolvesToDifferentVersionsPicksSeparateCachePaths— runs the same~1release twice with different resolver outputs (1.0.1, then1.0.2, simulating a newly published matching tag) and asserts the two resolutions land in distinct cache directories. This proves the core promise of the fix: a new matching tag no longer silently reuses the previously-resolved cache entry.
Both tests use t.Setenv(envvar.CacheHome, t.TempDir()) to sandbox the shared cache and exercise the OutputDirTemplate == "" branch that writes into remote.CacheDir() without touching the user's real ~/.cache/helmfile.
Writing these integration tests also flushed out a real correctness gap in the initial fix: getOCIChart was updating release.Version and chartVersion after resolution but was not recomputing the qualified OCI ref that getOCIQualifiedChartName had built pre-resolution. helm chart pull was therefore receiving oci://<repo>/<chart>:<constraint> alongside a --version <resolved> flag — at best redundant, at worst rejected by future Helm versions. Fixed in the same commit by re-invoking getOCIQualifiedChartName on the mutated release copy so the embedded tag also carries the resolved value. The new integration test would have failed against the previous commit; it passes now.
…iring Address Copilot review feedback on PR helmfile#2768. The existing unit test exercised resolveOCIConstraintVersion in isolation but did not prove that its output was propagated into the downstream cache key, cache path, and `helm chart pull --version` flag. Add a targeted integration test that: 1. Calls getOCIChart with a constraint release (`~1`) and a helm mock whose ShowChartWithFlags returns Chart.yaml version 1.0.1. 2. Asserts helm chart pull receives `--version 1.0.1`, not `~1`. 3. Asserts the destination path passed to helm chart pull contains the resolved-version segment (`/1.0.1/`) and does NOT contain the raw-constraint segment (`/_1/`). 4. Reads back the on-disk Chart.yaml under the cache path to confirm resolved version, path, and flag agree end to end. Add a second test that runs the same release twice with different resolver outputs (1.0.1, then 1.0.2 — simulating a newly published matching tag) and asserts the two resolutions land in distinct cache directories. This is the promise of the fix: once the raw constraint is out of the path, a new matching tag stops silently reusing the previously-resolved cache entry. The integration test flushed out a real correctness gap in the initial fix: getOCIChart resolved release.Version and chartVersion but did NOT recompute the qualified OCI ref that getOCIQualifiedChartName built pre-resolution. Helm was therefore receiving `oci://<repo>/<chart>:<constraint>` alongside a `--version <resolved>` flag — at best redundant, at worst rejected by future Helm versions. Fixed by re-invoking getOCIQualifiedChartName on the mutated release copy so the embedded tag also carries the resolved value. Isolates the shared helmfile cache via `t.Setenv(HELMFILE_CACHE_HOME, t.TempDir())` so the OutputDirTemplate == "" code path (which writes into remote.CacheDir) does not touch the user's real `~/.cache/helmfile` during test runs. Signed-off-by: Samuel Archambault <[email protected]>
Address review feedback on PR helmfile#2768: - Extract the inline resolve/requalify block from getOCIChart into applyOCIConstraintResolution, keeping getOCIChart flat (guard-clause style) and making the resolution wiring independently testable. The helper returns the (possibly updated) release, qualified chart name, and chart version; every failure mode returns its inputs unchanged. - On a re-qualify failure after a successful resolution, fall back to the pre-fix behavior entirely (raw constraint in cache key, ref, AND --version flag) instead of the previous half-resolved mix (resolved version in the cache key, raw constraint in the path and flag), which could desynchronize the in-process cache key from the on-disk path. - Build the 'helm show chart' ref by reusing parseOCIChartRef instead of re-implementing its last-slash/last-colon tag-splitting inline. Same behavior for all realistic refs (registry ports preserved), and it also handles the digest suffix should one ever reach this point. - Drop --devel from the resolver flags: helm documents --devel as ignored whenever --version is set, and --version is always passed on this path. No behavior change intended beyond the requalify-failure fallback (which cannot realistically trigger) and the removal of the inert --devel flag. Signed-off-by: yxxhero <[email protected]>
Address review feedback on PR helmfile#2768: Masterminds' lenient parser accepts partial versions like "1" or "1.2" as versions, so the previous classifier (NewVersion fails && NewConstraint succeeds) treated them as exact pins. But helm's OCI resolution — registry.GetTagMatchingVersionOrConstraint — honors a version string as an exact pin ONLY when a registry tag literally equals it; otherwise it parses the string as a constraint, and "1"/"1.2" float across 1.x.y/1.2.y tags. Caching those under their raw spelling reproduces the stale-cache bug of issue helmfile#2766, just with a narrower trigger. Replace the NewVersion probe with isFullSemver, which additionally requires the whole major.minor.patch triple to be spelled out (optional v prefix, prerelease, and build metadata all still count as exact when the core is fully qualified). When a registry does carry a literal tag equal to the version string, the resolver's metadata.Version == chartVersion path reports no change, so literal-tag pins keep today's behavior. TestIsVersionConstraint: "1"/"1.0" flip to constraints, joined by new v1.2/0/v1 cases and a 1.2.3 exact case. TestResolveOCIConstraintVersion gains a "partial version resolves" subtest. Docs updated to describe the parser-based classification instead of "constraint characters". Signed-off-by: yxxhero <[email protected]>
Address review feedback on PR helmfile#2768: the resolver ran even under --skip-refresh, so offline and cache-only workflows gained a 'helm show chart' registry attempt per constraint-versioned OCI release. It degraded gracefully (warn + fallback), but added registry-timeout latency and warning noise per release. skipOCIConstraintResolution now suppresses resolution when any of the skipRefresh levels is set — CLI --skip-refresh (forced), per-release skipRefresh, or helmDefaults.skipRefresh — with the same precedence the other skipRefresh consumers in prepareChartForRelease use. Skipped runs fall back to the constraint-keyed cache path, i.e. they reuse whatever a previous non-skipped run resolved, which is what 'skip checking for updates to cached charts' means for constraint versions. The existing issue helmfile#2766 integration tests flip their opts to SkipRefresh: false since they assert resolution happens. New coverage: TestSkipOCIConstraintResolution (tri-state precedence table) and TestGetOCIChart_SkipRefreshSkipsConstraintResolution (no inspector call, raw constraint in --version and cache path). Signed-off-by: yxxhero <[email protected]>
Address review feedback on PR helmfile#2768: resolution ran before the in-process chart-cache fast path and was not memoized, so every constraint-versioned OCI release paid its own 'helm show chart' registry round-trip on every render — including N releases sharing the same chart+constraint, whose parallel workers could even resolve to different versions if the registry changed between their lookups. Memoize successful resolutions in resolvedOCIConstraints keyed by (chart ref, constraint), mirroring the downloadedCharts pattern: - Releases sharing a chart+constraint cost one round-trip per process and consistently use one resolved version per run. - Only successful resolutions are memoized; failures may be transient. - Flags are not part of the key: they govern TLS/verification/registry credentials, not which tag a constraint matches (--devel is already omitted as it is ignored whenever --version is set). - Concurrent misses may both hit the registry; last write wins, harmlessly. resetResolvedOCIConstraintsForTest is added alongside the existing resetChartCacheForTest and wired into the issue helmfile#2766 tests — notably ResolvesToDifferentVersionsPicksSeparateCachePaths, which reuses the same chart+constraint across its two runs and would otherwise be served the first resolution from the memo (which is exactly the intended per-process semantics). New coverage: TestResolveOCIConstraintVersion_Memoized (memo hit skips the registry, different constraint is a different key) and TestGetOCIChart_SharedConstraintResolvedOncePerProcess (two releases, one inspector call, one pull, same path). Signed-off-by: yxxhero <[email protected]>
Address review feedback on PR helmfile#2768: the existing integration tests only exercised the repo-aliased spelling (chart: myrepo/mychart, version: '~1') and the version-field spelling. The chart-URL spelling (chart: oci://<registry>/<chart>:~1) takes a different branch in getOCIQualifiedChartName — the URL version is deliberately NOT embedded into the qualified ref and flows through --version only — so its re-qualification after constraint resolution (release.Version mutated to the resolved value, versionInURL still the constraint) was untested. TestGetOCIChart_URLEmbeddedConstraintResolves asserts the resolver receives the URL-embedded constraint, helm chart pull receives the resolved version via --version with a tag-less ref, and the cache path carries the resolved version segment instead of the raw constraint. Also gofmt-aligns the test tables added in earlier commits and drops a redundant 1.2.3 test case that tripped goconst. Signed-off-by: yxxhero <[email protected]>
…sions Releases with no version: at all keep their pre-existing semantics: helm picks the latest tag at pull time and helmfile caches it under a version-less shared-cache path. Document the limitation alongside the other resolveOCIVersions scope notes. Signed-off-by: yxxhero <[email protected]>
Resolve conflict in pkg/helmexec/exec.go: keep upstream's new ShowChartWithFlags API from #2768, adapted to the 2-arg helm.exec signature introduced by this branch. Signed-off-by: yxxhero <[email protected]>
…601) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [aqua:helmfile/helmfile](https://github.com/helmfile/helmfile) | tools | minor | `1.7.4` → `1.8.0` | --- ### Release Notes <details> <summary>helmfile/helmfile (aqua:helmfile/helmfile)</summary> ### [`v1.8.0`](https://github.com/helmfile/helmfile/releases/tag/v1.8.0) [Compare Source](helmfile/helmfile@v1.7.4...v1.8.0) #### What's Changed - build(deps): bump github.com/stretchr/testify from 1.11.1 to 1.12.0 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2749](helmfile/helmfile#2749) - build(deps): bump github.com/aws/aws-sdk-go-v2/config from 1.32.36 to 1.32.37 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2750](helmfile/helmfile#2750) - build(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 from 1.107.1 to 1.107.2 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2751](helmfile/helmfile#2751) - build(deps): bump github.com/stretchr/testify from 1.12.0 to 1.12.1 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2752](helmfile/helmfile#2752) - docs: fix broken star history chart by [@​Dessalines39394](https://github.com/Dessalines39394) in [#​2742](helmfile/helmfile#2742) - build(deps): bump github.com/mattn/go-runewidth from 0.0.27 to 0.0.28 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2753](helmfile/helmfile#2753) - build(deps): bump github.com/aws/aws-sdk-go-v2/config from 1.32.37 to 1.32.38 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2755](helmfile/helmfile#2755) - build(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 from 1.107.2 to 1.107.3 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2756](helmfile/helmfile#2756) - build(deps): bump helm-diff to v3.15.12 by [@​yxxhero](https://github.com/yxxhero) in [#​2759](helmfile/helmfile#2759) - build(deps): bump github.com/aws/aws-sdk-go-v2/config from 1.32.38 to 1.33.1 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2762](helmfile/helmfile#2762) - build(deps): bump github.com/gofrs/flock from 0.13.0 to 0.13.1 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2761](helmfile/helmfile#2761) - build(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 from 1.107.3 to 1.109.1 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2760](helmfile/helmfile#2760) - build(deps): bump google.golang.org/grpc from 1.82.1 to 1.83.1 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2763](helmfile/helmfile#2763) - feat: allow helmfile to continue on failed releases by [@​ceriath](https://github.com/ceriath) in [#​2616](helmfile/helmfile#2616) - build(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 from 1.109.1 to 1.110.0 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2764](helmfile/helmfile#2764) - build(deps): bump github.com/aws/aws-sdk-go-v2/config from 1.33.1 to 1.33.2 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2765](helmfile/helmfile#2765) - fix: resolve OCI version constraints before deriving the shared chart cache path by [@​samifruit514](https://github.com/samifruit514) in [#​2768](helmfile/helmfile#2768) - feat: opt-in OpenTelemetry tracing and metrics (experimental) by [@​yxxhero](https://github.com/yxxhero) in [#​2769](helmfile/helmfile#2769) - build(deps): bump go.opentelemetry.io/otel from 1.44.0 to 1.46.0 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2778](helmfile/helmfile#2778) - build(deps): bump github.com/mattn/go-runewidth from 0.0.28 to 0.0.29 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2776](helmfile/helmfile#2776) - build(deps): bump go.opentelemetry.io/otel/sdk/metric from 1.44.0 to 1.46.0 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2777](helmfile/helmfile#2777) - build(deps): bump go.opentelemetry.io/proto/otlp from 1.10.0 to 1.11.0 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2774](helmfile/helmfile#2774) - build(deps): bump go.opentelemetry.io/otel/sdk from 1.44.0 to 1.46.0 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2775](helmfile/helmfile#2775) - build(deps): bump gitpython from 3.1.58 to 3.1.59 in /docs by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2785](helmfile/helmfile#2785) - build(deps): bump google.golang.org/grpc from 1.83.1 to 1.83.2 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2784](helmfile/helmfile#2784) - build(deps): bump google.golang.org/protobuf from 1.36.12-0.20260120151049-f2248ac996af to 1.36.12 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2783](helmfile/helmfile#2783) - build(deps): bump golang.org/x/sync from 0.22.0 to 0.23.0 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2782](helmfile/helmfile#2782) - build(deps): bump github.com/aws/aws-sdk-go-v2/config from 1.33.2 to 1.33.3 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2781](helmfile/helmfile#2781) - build(deps): bump go.opentelemetry.io/contrib/exporters/autoexport from 0.67.0 to 0.71.0 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2780](helmfile/helmfile#2780) - build(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 from 1.110.0 to 1.111.0 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2779](helmfile/helmfile#2779) - fix(list): avoid deadlock in `helmfile list` with more than 100 states by [@​max06](https://github.com/max06) in [#​2773](helmfile/helmfile#2773) - chore: bump Helm to v3.22.0 and v4.3.0 by [@​yxxhero](https://github.com/yxxhero) in [#​2786](helmfile/helmfile#2786) - build(deps): bump helm-diff to v3.15.13 by [@​yxxhero](https://github.com/yxxhero) in [#​2788](helmfile/helmfile#2788) - feat(remote): support wildcards in remote values/secrets file selectors by [@​hoppla20](https://github.com/hoppla20) in [#​2787](helmfile/helmfile#2787) - build(deps): bump helmfile/vals from v0.46.0 to v0.46.1 by [@​yxxhero](https://github.com/yxxhero) in [#​2789](helmfile/helmfile#2789) #### New Contributors - [@​Dessalines39394](https://github.com/Dessalines39394) made their first contribution in [#​2742](helmfile/helmfile#2742) - [@​samifruit514](https://github.com/samifruit514) made their first contribution in [#​2768](helmfile/helmfile#2768) - [@​max06](https://github.com/max06) made their first contribution in [#​2773](helmfile/helmfile#2773) - [@​hoppla20](https://github.com/hoppla20) made their first contribution in [#​2787](helmfile/helmfile#2787) **Full Changelog**: <helmfile/helmfile@v1.7.4...v1.8.0> </details> --- ### Configuration 📅 **Schedule**: (in timezone Europe/London) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC43OS42IiwidXBkYXRlZEluVmVyIjoiNDQuODMuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsidHlwZS9taW5vciJdfQ==--> Reviewed-on: https://git.hayden.moe/hayden/phoebe/pulls/601
helmfile 1.8.0 Created-by: HarmonybrewBot Commit-by: HarmonybrewBot Merged-by: HarmonybrewBot Description: Created by `brew bump` --- Created with `brew bump-formula-pr`.<details> <summary>release notes</summary> <pre>## What's Changed * build(deps): bump github.com/stretchr/testify from 1.11.1 to 1.12.0 by @dependabot[bot] in helmfile/helmfile#2749 * build(deps): bump github.com/aws/aws-sdk-go-v2/config from 1.32.36 to 1.32.37 by @dependabot[bot] in helmfile/helmfile#2750 * build(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 from 1.107.1 to 1.107.2 by @dependabot[bot] in helmfile/helmfile#2751 * build(deps): bump github.com/stretchr/testify from 1.12.0 to 1.12.1 by @dependabot[bot] in helmfile/helmfile#2752 * docs: fix broken star history chart by @Dessalines39394 in helmfile/helmfile#2742 * build(deps): bump github.com/mattn/go-runewidth from 0.0.27 to 0.0.28 by @dependabot[bot] in helmfile/helmfile#2753 * build(deps): bump github.com/aws/aws-sdk-go-v2/config from 1.32.37 to 1.32.38 by @dependabot[bot] in helmfile/helmfile#2755 * build(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 from 1.107.2 to 1.107.3 by @dependabot[bot] in helmfile/helmfile#2756 * build(deps): bump helm-diff to v3.15.12 by @yxxhero in helmfile/helmfile#2759 * build(deps): bump github.com/aws/aws-sdk-go-v2/config from 1.32.38 to 1.33.1 by @dependabot[bot] in helmfile/helmfile#2762 * build(deps): bump github.com/gofrs/flock from 0.13.0 to 0.13.1 by @dependabot[bot] in helmfile/helmfile#2761 * build(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 from 1.107.3 to 1.109.1 by @dependabot[bot] in helmfile/helmfile#2760 * build(deps): bump google.golang.org/grpc from 1.82.1 to 1.83.1 by @dependabot[bot] in helmfile/helmfile#2763 * feat: allow helmfile to continue on failed releases by @ceriath in helmfile/helmfile#2616 * build(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 from 1.109.1 to 1.110.0 by @dependabot[bot] in helmfile/helmfile#2764 * build(deps): bump github.com/aws/aws-sdk-go-v2/config from 1.33.1 to 1.33.2 by @dependabot[bot] in helmfile/helmfile#2765 * fix: resolve OCI version constraints before deriving the shared chart cache path by @samifruit514 in helmfile/helmfile#2768 * feat: opt-in OpenTelemetry tracing and metrics (experimental) by @yxxhero in helmfile/helmfile#2769 * build(deps): bump go.opentelemetry.io/otel from 1.44.0 to 1.46.0 by @dependabot[bot] in helmfile/helmfile#2778 * build(deps): bump github.com/mattn/go-runewidth from 0.0.28 to 0.0.29 by @dependabot[bot] in helmfile/helmfile#2776 * build(deps): bump go.opentelemetry.io/otel/sdk/metric from 1.44.0 to 1.46.0 by @dependabot[bot] in helmfile/helmfile#2777 * build(deps): bump go.opentelemetry.io/proto/otlp from 1.10.0 to 1.11.0 by @dependabot[bot] in helmfile/helmfile#2774 * build(deps): bump go.opentelemetry.io/otel/sdk from 1.44.0 to 1.46.0 by @dependabot[bot] in helmfile/helmfile#2775 * build(deps): bump gitpython from 3.1.58 to 3.1.59 in /docs by @dependabot[bot] in helmfile/helmfile#2785 * build(deps): bump google.golang.org/grpc from 1.83.1 to 1.83.2 by @dependabot[bot] in helmfile/helmfile#2784 * build(deps): bump google.golang.org/protobuf from 1.36.12-0.20260120151049-f2248ac996af to 1.36.12 by @dependabot[bot] in helmfile/helmfile#2783 * build(deps): bump golang.org/x/sync from 0.22.0 to 0.23.0 by @dependabot[bot] in helmfile/helmfile#2782 * build(deps): bump github.com/aws/aws-sdk-go-v2/config from 1.33.2 to 1.33.3 by @dependabot[bot] in helmfile/helmfile#2781 * build(deps): bump go.opentelemetry.io/contrib/exporters/autoexport from 0.67.0 to 0.71.0 by @dependabot[bot] in helmfile/helmfile#2780 * build(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 from 1.110.0 to 1.111.0 by @dependabot[bot] in helmfile/helmfile#2779 * fix(list): avoid deadlock in `helmfile list` with more than 100 states by @max06 in helmfile/helmfile#2773 * chore: bump Helm to v3.22.0 and v4.3.0 by @yxxhero in helmfile/helmfile#2786 * build(deps): bump helm-diff to v3.15.13 by @yxxhero in helmfile/helmfile#2788 * feat(remote): support wildcards in remote values/secrets file selectors by @hoppla20 in helmfile/helmfile#2787 * build(deps): bump helmfile/vals from v0.46.0 to v0.46.1 by @yxxhero in helmfile/helmfile#2789 ## New Contributors * @Dessalines39394 made their first contribution in helmfile/helmfile#2742 * @samifruit514 made their first contribution in helmfile/helmfile#2768 * @max06 made their first contribution in helmfile/helmfile#2773 * @hoppla20 made their first contribution in helmfile/helmfile#2787 **Full Changelog**: https://github.com/helmfile/helmfile/compare/v1.7.4...v1.8.0</pre> <p>View the full release notes at <a href="https://github.com/helmfile/helmfile/releases/tag/v1.8.0">https://github.com/helmfile/helmfile/releases/tag/v1.8.0</a>.</p> </details> <hr> See merge request: Harmonybrew/homebrew-core!20121
Resolves #2766.
Summary
For OCI releases with a semver constraint version (
~1,^2.0.0,>=1.0.0,*, etc.), helmfile currently caches the downloaded chart under a directory named after the raw constraint string viasafeVersionPath(e.g.version: ~1→.../mychart/_1/). Combined withacquireChartLockrefusing to refresh anything under the shared cache directory, this means the first version helmfile resolves for a given constraint is pinned to that path forever. Subsequent renders keep returning the stale tarball even after newer matching tags are published to the registry.In multi-pod deployments like ArgoCD's
argocd-repo-serverthis produces intermittent stale renders — different pods populate their caches at different times, so different pods return different chart versions for the same release definition. Argo load-balances template requests across pods, so applications flip between "in sync" and "out of sync" for no visible reason.Fix
For OCI releases whose
versionlooks like a semver constraint, resolve the constraint against the registry before deriving the cache path, and use the resolved version everywhere downstream. Implementation:ShowChartWithFlagsmethod onhelmexec.Interface—ShowChartunchanged for backward compatibility.resolveOCIConstraintVersionhelper inpkg/state/state.gothat shells out tohelm show chart <ref> --version <constraint> [flags](helm already returns the resolvedChart.yaml; we just readmetadata.Version). Reuses the existingchartOCIFlags/appendVerifyFlags/appendKeyringFlags/appendChartDownloadFlagshelpers so auth, TLS, and registry-config are passed identically to howhelm pullgets them today.getOCIChartcalls the resolver up front, rewritesrelease.Versionon the local copy, then proceeds normally. The cache key andgetOCIChartPathnow see a concrete version like1.0.1and produce.../mychart/1.0.1/mychart/— content-addressable, self-invalidating.Resolution errors are downgraded to a warning: rendering falls back to the pre-fix behavior (raw constraint) so a network hiccup doesn't break users mid-rollout. The bug still exists on the fallback path, but the same as before this PR.
Behavior changes
helmDefaults.resolveOCIVersions: false(global) orresolveOCIVersions: falseper-release. Per-release wins over global.chart@sha256:...) are skipped — digest is already the authoritative content identifier and helm ignores--versionin that case.Cost
One
helm show chart --version <constraint>per constraint-versioned OCI release per render. Comparable to thehelm repo updatecost that classic HTTP repos already pay. Pinned releases and non-OCI releases pay nothing.Tests
TestIsVersionConstraint— table-driven check that pinned semvers (with and withoutvprefix, with pre-release/build metadata) are correctly classified as non-constraints, and every constraint operator character triggerstrue.TestResolveOCIConstraintVersion— 8 subtests using a stubbedShowChartWithFlagsFunconexectest.Helm: constraint resolves, exact version bypasses, empty version bypasses, digest bypasses, global opt-out, per-release opt-out beats global, empty response is an error, no-change reports correctly.TestGenerateIDexpected-hash values updated becauseReleaseSpecgained a new field (the ID is aHashObjectof the whole struct).All existing
pkg/state,pkg/helmexec,pkg/exectest,pkg/testutil, andpkg/apptests still pass locally. Two pre-existing failures onmain(TestAdhocDependencyGoGetterFetchtriggered by a local pre-commit hook, andTestHelmfileTemplateWithBuildCommandwhich requires a pre-built./helmfilebinary) reproduce onorigin/mainbefore this PR and are unrelated.make check,make fmt, andgolangci-lint run --new-from-rev mainall pass with no new issues.Docs
Added
resolveOCIVersionsto both the annotatedhelmDefaults:example and the reference tables indocs/configuration.md.Compatibility
ShowChartuntouched.HelmSpec/ReleaseSpecgain one optional pointer field. YAML omitting it behaves as before with the fix enabled.Masterminds/semver/v3which is already a direct dep.Happy to iterate on the shape — an alternative I considered was making resolution opt-in rather than default-on. Went with default-on because the current behavior is silently wrong; users would have to hit the bug, root-cause it, and find the flag to fix it. Opt-out is a shorter path for anyone who has a legitimate reason to avoid the extra network call.