From cd216c6ee9a370b9d39d69ed0276fc04e37ff24b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 26 Mar 2026 09:55:54 +0000 Subject: [PATCH] fix: remove nameToID normalization from GroupReleasesByDependency After ApplyOverrides/reformat(), need IDs are already fully-qualified (matching ReleaseToID format). The nameToID map was doing redundant name-based lookups that could theoretically select the wrong dependency when multiple releases share the same name across namespaces (same issue fixed in collectDirectNeedsOnly in 02a5de3). Reverted to the original behavior of passing need IDs as-is. Co-authored-by: yxxhero <11087727+yxxhero@users.noreply.github.com> Agent-Logs-Url: https://github.com/helmfile/helmfile/sessions/7b896c61-ba38-4471-942a-784e79fab298 --- pkg/state/state_run.go | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/pkg/state/state_run.go b/pkg/state/state_run.go index 82e5464f..70e0d4a3 100644 --- a/pkg/state/state_run.go +++ b/pkg/state/state_run.go @@ -132,12 +132,6 @@ func SortedReleaseGroups(releases []Release, opts PlanOptions) ([][]Release, err func GroupReleasesByDependency(releases []Release, opts PlanOptions) ([][]Release, error) { idToReleases := map[string][]Release{} idToIndex := map[string]int{} - nameToID := map[string]string{} - - for _, r := range releases { - id := ReleaseToID(&r.ReleaseSpec) - nameToID[r.Name] = id - } d := dag.New() for i, r := range releases { @@ -146,14 +140,11 @@ func GroupReleasesByDependency(releases []Release, opts PlanOptions) ([][]Releas idToReleases[id] = append(idToReleases[id], r) idToIndex[id] = i + // After ApplyOverrides/reformat(), need IDs are already fully-qualified + // (matching ReleaseToID format), so we pass them as-is. var needs []string for i := 0; i < len(r.Needs); i++ { - n := r.Needs[i] - if fullID, ok := nameToID[n]; ok { - needs = append(needs, fullID) - } else { - needs = append(needs, n) - } + needs = append(needs, r.Needs[i]) } d.Add(id, dag.Dependencies(needs)) }