Skip to content

fix(helm): use yaml.stringify for Values viewer + cluster fix#750

Merged
nadaverell merged 1 commit into
mainfrom
fix/helm-values-yaml-rendering
May 20, 2026
Merged

fix(helm): use yaml.stringify for Values viewer + cluster fix#750
nadaverell merged 1 commit into
mainfrom
fix/helm-values-yaml-rendering

Conversation

@nadaverell
Copy link
Copy Markdown
Contributor

@nadaverell nadaverell commented May 20, 2026

Summary

The Helm release Values viewer used a hand-rolled JSON→YAML converter that emitted - on its own line for array-of-object items, then indented the object body by 2 extra levels. The result was broken rendering for any nested list-of-objects, e.g. Istio VirtualService:

http:
  -
    route:
      -
        destination:
          host: 

instead of the canonical:

http:
  - route:
      - destination:
          host: 

Replaces the custom serializer with yaml.stringify from the yaml v2 package — the same library Radar already uses for parsing, and the same approach Headlamp's Flux plugin takes. The only non-default option is lineWidth: 0, which disables line folding so long image tags / repo URLs / paths don't wrap mid-token.

While in the neighborhood, applied the same { lineWidth: 0 } option to the other five yaml.stringify call sites in InstallWizard.tsx and the GitOps detail page's safeStringifyYaml helper, which all silently inherited the 80-col default and had the same latent wrap bug.

Net change: −38 / +4 lines (ValuesViewer.tsx) plus one option added at six other sites. No new imports.

Test plan

  • make tsc passes
  • Helm > Values renders nested arrays correctly in prometheus chart (scrape_configs, relabel_configs)
  • Sanity-checked yaml.stringify output against the Istio VirtualService case from the bug report
  • Spot-check Install Wizard initial state for a chart with long image tags (no mid-tag wrapping)
  • Spot-check GitOps detail page for an Argo Application with Helm values (no line wrap)

Note

Low Risk
Low risk UI-only change that affects how Helm/GitOps values are serialized for display/defaults; main risk is minor formatting differences in rendered YAML.

Overview
Fixes Helm values YAML rendering by replacing the hand-rolled JSON→YAML serializer in ValuesViewer.tsx with yaml.stringify, eliminating incorrect list-of-object formatting.

Also standardizes YAML output across the Helm install wizard and GitOps Helm-values display by passing lineWidth: 0 to yaml.stringify (via safeStringifyYaml and related call sites) to prevent mid-token line folding/wrapping.

Reviewed by Cursor Bugbot for commit 649b0c1. Bugbot is set up for automated code reviews on this repo. Configure here.

The Helm Values viewer used a hand-rolled JSON->YAML converter that
emitted `-` on its own line for array-of-object items, then indented
the body by 2 levels — breaking standard list rendering for values
like Istio VirtualService `http: - route: - destination:`.

Replace the custom serializer with `yaml.stringify` from the `yaml`
v2 package (already imported for parsing). Same library and call
shape that Headlamp's Flux plugin uses, with the addition of
`lineWidth: 0` so long image tags / URLs / repo paths don't wrap
mid-token.

Pass the same `{ lineWidth: 0 }` option at all five InstallWizard
sites and the GitOps detail page's `safeStringifyYaml`, which had
the same latent line-wrap bug.
@nadaverell nadaverell requested a review from hisco as a code owner May 20, 2026 10:27
@nadaverell nadaverell merged commit 70fcb1e into main May 20, 2026
8 checks passed
@nadaverell nadaverell deleted the fix/helm-values-yaml-rendering branch May 20, 2026 10:58
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