fix(helm): use yaml.stringify for Values viewer + cluster fix#750
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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. IstioVirtualService:instead of the canonical:
Replaces the custom serializer with
yaml.stringifyfrom theyamlv2 package — the same library Radar already uses for parsing, and the same approach Headlamp's Flux plugin takes. The only non-default option islineWidth: 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 fiveyaml.stringifycall sites inInstallWizard.tsxand the GitOps detail page'ssafeStringifyYamlhelper, 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 tscpassesprometheuschart (scrape_configs,relabel_configs)yaml.stringifyoutput against the Istio VirtualService case from the bug reportApplicationwith 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.tsxwithyaml.stringify, eliminating incorrect list-of-object formatting.Also standardizes YAML output across the Helm install wizard and GitOps Helm-values display by passing
lineWidth: 0toyaml.stringify(viasafeStringifyYamland 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.