Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve comments in Helm Chart.yaml when updating version #1944

Closed
ben-foxmoore opened this issue May 5, 2023 · 0 comments · Fixed by #1968
Closed

Preserve comments in Helm Chart.yaml when updating version #1944

ben-foxmoore opened this issue May 5, 2023 · 0 comments · Fixed by #1968
Assignees
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.

Comments

@ben-foxmoore
Copy link
Contributor

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:

apiVersion: v2
name: hello
description: A Helm chart for Kubernetes
type: application
version: 0.5.0
# renovate: image=nginx
appVersion: 1.24.0

release-please will update this to:

apiVersion: v2
name: hello
description: A Helm chart for Kubernetes
type: application
version: 1.0.0
appVersion: 1.24.0
@ben-foxmoore ben-foxmoore added 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. labels May 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants