Skip to content

fix(gotemplate-helm): toToml emits Go BurntSushi-style tables (#490 bucket 3)#497

Merged
alexmond merged 1 commit into
mainfrom
feat/helm-toml-tables
Jun 24, 2026
Merged

fix(gotemplate-helm): toToml emits Go BurntSushi-style tables (#490 bucket 3)#497
alexmond merged 1 commit into
mainfrom
feat/helm-toml-tables

Conversation

@alexmond

Copy link
Copy Markdown
Owner

Closes bucket 3 of #490. HelmConformanceTest backlog now 37 → 1.

toToml serialised via Jackson's TomlMapper, which writes nested maps as dotted keys (mast.sail = "white"), whereas Helm's Go BurntSushi encoder emits [table] headers. New TomlWriter reproduces BurntSushi's output, reverse-engineered from the helm binary:

  • keys sorted alphabetically; scalar / inline-array fields before sub-tables
  • table key/values indented depth*2, [header] indented (depth-1)*2
  • a blank line before every top-level table and every array-of-tables element (never before the first output line)
  • basic (double-quoted) strings; floats always carry a decimal point
{mast: {sail: white}}              ->  [mast]
                                         sail = "white"

{a: {xx: v, bb: {cc: deepval}}}    ->  [a]
                                         xx = "v"
                                         [a.bb]
                                           cc = "deepval"

Replaces the Jackson serialisation and the now-dead tomlToGoStyle single→double-quote post-process for both toToml and mustToToml; fromToml still parses via TomlMapper. Adds nested-table + array-of-tables unit tests asserting the exact helm output.

Remaining (1 divergence)

Only fromToml "one" stays pinned — a true TOML syntax error whose exact BurntSushi wording (toml: line 1: unexpected EOF; expected key separator '=') a Jackson parser can't reproduce without overfitting.

Verification

  • jhelm-gotemplate-helm verify green — 131 tests, spring-javaformat / PMD / Checkstyle
  • 346/346 chart byte-parity unchanged (no chart uses toToml)

🤖 Generated with Claude Code

…ucket 3)

toToml went through Jackson's TomlMapper, which serialises nested maps as
dotted keys (mast.sail = "white") whereas Helm's Go BurntSushi encoder emits
[table] headers. New TomlWriter reproduces BurntSushi's output, verified
against the helm binary:
- keys sorted alphabetically, scalar/inline-array fields before sub-tables
- table key/values indented depth*2, [header] indented (depth-1)*2
- a blank line before every top-level table and every array-of-tables element
  (never before the first output line)
- basic (double-quoted) strings, floats always carry a decimal point

Replaces the Jackson serialisation + the tomlToGoStyle single->double-quote
post-process (now dead) for both toToml and mustToToml; fromToml still parses
via TomlMapper. Adds nested-table + array-of-tables unit tests with the exact
helm output.

Unpins the toToml conformance case. HelmConformanceTest backlog 2 -> 1 (only
the fromToml "one" syntax-error string remains, an inherent Jackson-vs-
BurntSushi wording difference).

Verified: jhelm-gotemplate-helm verify green (131 tests, format/PMD/Checkstyle);
346/346 chart byte-parity unchanged.

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.38% 🍏

There is no coverage information present for the Files changed

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

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

Files with missing lines Patch % Lines
...nd/jhelm/gotemplate/helm/functions/TomlWriter.java 61.70% 27 Missing and 9 partials ⚠️

📢 Thoughts on this report? Let us know!

@alexmond alexmond merged commit 3cc27c5 into main Jun 24, 2026
1 check passed
@alexmond alexmond deleted the feat/helm-toml-tables branch June 24, 2026 07:27
@github-actions

Copy link
Copy Markdown
Contributor
Overall Project 81.38% 🍏

There is no coverage information present for the Files changed

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.

2 participants