rancher / charts-build-scripts

Apache License 2.0
10 stars 32 forks source link

"Managed" YAML files should store JSON patches, not Unix diffs #75

Open aiyengar2 opened 2 years ago

aiyengar2 commented 2 years ago

Since the Chart.yaml and values.yaml files are prone to conflicts on rebases but are guaranteed to be real YAML files (e.g. they won't have any weird go templating stuff in them, unlike other Helm files), the diff we store for these two root files should be a JSON patch instead of a Unix diff.

Since it's far more unlikely for a JSON patch applied on the base chart to encounter a conflict than a Unix diff, this should make the process of applying rebases far simpler and remove the caveat the scripts have with working with these "Managed Files"

aiyengar2 commented 2 years ago

Will require a charts-build-scripts minor release since it will involve migrating existing Chart.yaml.patch files to a new format that is incompatible with previous versions of the script. Also will require non-trivial updates to introduce special diff logic.

aiyengar2 commented 2 years ago

To support apiVersion: v1 Helm charts, we should also support requirements.yaml using JSON patches

aiyengar2 commented 2 years ago

https://github.com/rancher/charts-build-scripts/issues/9 might be a good issue to prioritize with this; we could make the default such that certain files automatically use yaml_diff while others default to unified_diff, but by exposing it as a possible override in the Chart.yaml, we could make it easier to opt-in to this.