Preserve comments in Helm Chart.yaml when updating version #1944
Labels
priority: p3
Desirable enhancement or fix. May not be included in next release.
type: feature request
‘Nice-to-have’ improvement, new feature or different behavior or design.
We currently use comments in our Chart.yaml so that Renovate can automatically update the
appVersion
field when new Docker images are available. With the current Helm updater, all comments are stripped out of the Chart.yaml, which rather breaks that workflow.Cause
This is caused by the use of js-yaml which does not support preserving comments. A similar issue was seen in the Rust Cargo.toml updater, and a fix for this was implemented in #705. This was also clearly of concern when the KRM updater was developed - this updater uses Regex rather than using the js-yaml library.
Alternatives
eemeli/yaml seems to be a reliable library which supports maintaining comments when parsing/dumping Yaml files. I've prototyped switching to this library in my fork, specifically for the Helm updater at this point. I'm happy to adapt this to a PR if the change is acceptable.
Reproduction
This can be reproduced easily with the following Chart.yaml:
release-please will update this to:
The text was updated successfully, but these errors were encountered: