When refreshing Sandboxes I would prefer if all metadata is exactly copied from the source org, but rather we often see files being randomly reshuffled without their content changing when we do a full pull via CICD. This is all fine till multiple people try to merge their change to develop branch, because then we have unnecessary merge conflicts.
The current process is that No-Coders (Admins) base their sandbox by full pushing via Pipeline to their Sandbox, do their changes and retrieve them via a full pull. The pull results in the shuffeled metadata like page layouts being retrieved.
If I do this by hand and break it down for this issue, I'd do the following:
- Repo LayoutA has items in order: 1,2,3
- Org after cloning has: 1,3,2
- Repo->Org:
sfdx force:source:deploy force-app/main/default/layouts
- Org->Repo:
sfdx force:source:retrieve force-app/main/default/layouts
- The Org still has the file with order: 1,3,2
Resulting in the following reshuffled file:
We are also currently working with delta deployments resulting in the page layouts being deployed a lot.
Is there any way to mitigate/solve that problem or is it only something Salesforce can fix?
*Full Push/Pull: source:force:push/pull in a CICD context is similar to doing sfdx force:source:deploy/retrieve -p force-app
. For pushing it is identical to sfdx force:source:deploy -p force-app --tracksource
. For pulling it pulls all components listed in SourceMember, which for our purpose is similar to retrieving everything in force-app.