Provide ordering for metadata elements when committing to version control
When metadata is retrieved from Salesforce the order of child nodes is not guaranteed and results in false-positive changes when committing to version control. Usually this will be something simple like workflow actions/criteria appearing out-of-order which can be compared manually. However, recently we've noticed entire profiles being committed with *every* permissions element out-of-order, resulting in a change set with ~20k lines where the *actual* change is impossible to visualize.
Gearset should provide a feature to 'order' child XML elements alphabetically by name in order to provide consistent commits to version control and eliminate false-positives.
Kris Goncalves commented
It'd be nice to also just hear back if this is feasible as it would be nice to be able to trust the diff to make sure we know what is actually changing when deploying layouts/profiles.
Even the simplest of change control scenarios (e.g. like those outlined in Gearset post https://docs.gearset.com/en/articles/2934192-a-sample-source-driven-development-workflow) seem to result in pull requests with thousands of false positive changes for the out-of-order permission nodes.
To provide more consistency we built an XSLT file to reorder profiles alphabetically. We could share the file with you if gearset want to use it as a pre commit hook to ensure that profiles are always sorted the same way.
I agree! Profiles and objects can be difficult to work with during merges