charm-tools
charm-tools copied to clipboard
Ensure stable ordering of layer.yaml
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.
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.