charm-tools icon indicating copy to clipboard operation
charm-tools copied to clipboard

Ensure stable ordering of layer.yaml

Open johnsca opened this issue 7 years ago • 1 comments

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 avatar Jun 06 '18 16:06 johnsca

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.

johnsca avatar Feb 25 '19 22:02 johnsca