juju / charm-tools

Tools for charm authors and maintainers
Other
42 stars 64 forks source link

Ensure stable ordering of layer.yaml #409

Open johnsca opened 6 years ago

johnsca commented 6 years ago

When a charm is build, layer.yaml pretty much always shows up in the build change report because the order of the keys in the re-written yaml changes. We should perform some sort of sorting on it to ensure a stable ordering.

johnsca commented 5 years ago

The LayerYAML tactic already uses (by way of YAMLTactic) RoundTripLoader to try to preserve the ordering, but it seems that at least some of the fields (at least options) still have the order changed. It might just be that the default value for options needs to be an OrderedDict, or it may be that utils.deepmerge is breaking the ordering in some way.