Skip to content

fix(engine): gitlab subchart coalesce — global propagation + disabled-subchart pruning (A/B/C) (#21)#508

Merged
alexmond merged 2 commits into
mainfrom
fix/gitlab-global-coalesce
Jun 26, 2026
Merged

fix(engine): gitlab subchart coalesce — global propagation + disabled-subchart pruning (A/B/C) (#21)#508
alexmond merged 2 commits into
mainfrom
fix/gitlab-global-coalesce

Conversation

@alexmond

@alexmond alexmond commented Jun 26, 2026

Copy link
Copy Markdown
Owner

Concrete progress on the long-standing gitlab subchart-coalesce parity (#21), each step gated on the 346-chart parity staying green.

Three coalesce fixes

The parent-visible .Values tree (which feeds toYaml(.Values) and the gitlab.jobNameSuffix / checksum/config hashes) diverged from Helm — jhelm patched these only at render-dispatch, so manifests rendered but the hashes didn't.

  • A — global propagation: bake the full top-level .Values.global into every subchart in the coalesced tree.
  • B — disabled-subchart pruning (direct): skip coalescing a subchart's defaults when its dependency condition is false. Disabled subcharts now match Helm's stub exactly (traefik 6=6, openbao 42=42, …).
  • C — disabled-subchart pruning (nested): thread parent overrides into the recursion so a nested dependency's condition sees them (e.g. the umbrella's prometheus.kube-state-metrics.enabled=false prunes that grandchild).

Result: jhelm's coalesced gitlab .Values 5850 → 12395 lines (Helm 13031) — 91% of the gap closed; prometheus 3655→915; disabled subcharts exact.

Diagnosis: every remaining diff is one root cause

Full manifest diff (jhelm vs helm): identical 146-resource set, all 21 ConfigMaps byte-identical. The only diffs are content hashes — 4 Job names + 5 checksum/config annotations — plus one ignorable random test-Pod name. Verified jhelm's sha256sum and include framing are byte-identical to the CLI/Go, so both hash families trace to the same residual: jhelm's coalesced .Values.global (webservice sees 522 lines vs Helm's 531).

Not yet closed (D, documented in failed.csv)

The last ~9 lines/subchart is null/empty handling — jhelm prunes propagated-global nulls that Helm keeps (when/dsn/environment: null) and collapses authToken {key,secret:""}{}. Closing D makes toYaml(.Values.global) exact, fixing both hash families → gitlab passes. It touches the #491 selective-null logic, so it needs its own careful, parity-gated pass.

Part of #21.

🤖 Generated with Claude Code

…rt pruning (#21)

Two coalesce bugs in the parent-visible .Values tree that block gitlab parity
(jhelm previously patched both only at render-dispatch, so manifests rendered
but toYaml(.Values) — and the gitlab.jobNameSuffix sha256 — diverged):

  A. Bake the full top-level .Values.global into every subchart in the coalesced
     tree (coalesceChartValues threads topGlobal; parent global wins), matching
     Helm. .Values.<sub>.global 30 -> 528 (Helm 533).
  B. Skip coalescing a subchart's defaults when its dependency `condition` is
     false (isSubchartEnabledForCoalesce, reusing the existing condition
     evaluator). Disabled subcharts now match Helm's parent-stub exactly
     (traefik 6=6, openbao 42=42, haproxy 12=12, gitlab-zoekt 7=7).

gitlab's coalesced .Values goes 5850 -> 15135 lines (Helm 13031). gitlab is not
yet closed — a remaining global over-propagation into an enabled subchart's own
subcharts (prometheus.*) leaves ~+2100 lines; documented in failed.csv as the
next step (C).

Verified: 346/346 chart byte-parity green; 153 jhelm-core coalesce unit tests
green (EngineTest, SubchartValuePropagationTest, NestedSubchartValuesTest, …);
gitlab renders without error.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U5yvjG89AqMHPAGJawSmg9
@github-actions

Copy link
Copy Markdown
Contributor
Overall Project 81.25% -0.02% 🍏
Files changed 97.09% 🍏

Module Coverage
jhelm-core 83.08% -0.02% 🍏
Files
Module File Coverage
jhelm-core Engine.java 88.62% -0.11% 🍏

@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 64.00000% with 9 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...n/java/org/alexmond/jhelm/core/service/Engine.java 64.00% 1 Missing and 8 partials ⚠️

📢 Thoughts on this report? Let us know!

…onditions (#21)

Fix C of the gitlab subchart-coalesce work. coalesceChartValues now threads the
parent's overrides into the recursion and evaluates each nested dependency's
condition against the effective (base + override) values, so an umbrella that
disables a grandchild — e.g. prometheus.kube-state-metrics.enabled=false — prunes
that grandchild's defaults from .Values, matching Helm's ProcessDependencies.

Combined with A (global propagation) and B (direct disabled-subchart pruning),
jhelm's coalesced gitlab .Values goes 5850 -> 12395 lines (Helm 13031) — 91% of
the gap closed, prometheus 3655 -> 915, disabled subcharts exact.

Diagnosis recorded in failed.csv: every remaining gitlab manifest diff is a
content hash (jobNameSuffix + checksum/config), both tracing to the SAME residual
.Values.global gap (jhelm 522 vs Helm 531 lines for webservice). jhelm's
sha256sum and include framing were verified byte-identical to the CLI/Go, so it
is purely the coalesced global. The last ~9 lines/subchart (D) is null/empty
handling: jhelm prunes propagated-global nulls that Helm keeps.

Verified: 346/346 chart byte-parity green; jhelm-core coalesce unit tests green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U5yvjG89AqMHPAGJawSmg9
@alexmond alexmond changed the title fix(engine): subchart coalesce — global propagation + disabled-subchart pruning (#21) fix(engine): gitlab subchart coalesce — global propagation + disabled-subchart pruning (A/B/C) (#21) Jun 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor
Overall Project 81.25% -0.06% 🍏
Files changed 92.81% 🍏

Module Coverage
jhelm-core 83.08% -0.08% 🍏
Files
Module File Coverage
jhelm-core Engine.java 88.55% -0.4% 🍏

@alexmond alexmond merged commit 40dad7b into main Jun 26, 2026
1 of 2 checks passed
@alexmond alexmond deleted the fix/gitlab-global-coalesce branch June 26, 2026 02:54
@github-actions

Copy link
Copy Markdown
Contributor
Overall Project 81.25% -0.06% 🍏
Files changed 92.81% 🍏

Module Coverage
jhelm-core 83.08% -0.08% 🍏
Files
Module File Coverage
jhelm-core Engine.java 88.55% -0.4% 🍏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant