From 3dc7b27c6e2717f63e657079b75397289c92fa76 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 19 Aug 2025 01:17:09 +0000 Subject: [PATCH] Complete implementation: Fix helmfile list to reflect versions from helmfile.lock for both --skip-charts and normal modes Co-authored-by: yxxhero <11087727+yxxhero@users.noreply.github.com> --- pkg/app/app.go | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/pkg/app/app.go b/pkg/app/app.go index 06371275..dc6ef934 100644 --- a/pkg/app/app.go +++ b/pkg/app/app.go @@ -593,17 +593,29 @@ func (a *App) ListReleases(c ListConfigProvider) error { var err error if !c.SkipCharts() { - err = run.withPreparedCharts("list", state.ChartPrepareOptions{ - SkipRepos: true, - SkipDeps: true, - Concurrency: 2, - }, func() { - rel, err := a.list(run) - if err != nil { - panic(err) - } - stateReleases = rel - }) + // Even though we call withPreparedCharts, the list command is explicitly + // skipped in prepareChartsIfNeeded, so we need to resolve dependencies here + resolvedState, resolveErr := run.state.ResolveDeps() + if resolveErr != nil { + err = resolveErr + } else { + // Create a new run with the resolved state to get the correct versions + resolvedRun := *run + resolvedRun.state = resolvedState + + err = resolvedRun.withPreparedCharts("list", state.ChartPrepareOptions{ + SkipRepos: true, + SkipDeps: true, + SkipResolve: false, // Explicitly enable dependency resolution + Concurrency: 2, + }, func() { + rel, err := a.list(&resolvedRun) + if err != nil { + panic(err) + } + stateReleases = rel + }) + } } else { // Even when skipping charts, we should still resolve dependencies from the lock file // to show the locked versions instead of the version constraints from helmfile.yaml