Salesforce DX is here for a while and enough has already been said and written about it. Even I spoke at Dreamforce how cool it is for admin. Finally I had an opportunity to use it on real project, with several consultants and developers and really see how it works and what are the challenges you might expect.
There were plenty of them, some of them probably because of our processes, the others most likely due to DX/Git philosophy.
DX is not linked with the need of source code versioning, but it makes sense, especially when linked with CI/CD.
For us, as consultants who are used to the idea „your org is yours source of truth“, it was something completely different. You should create a new branch for each story (what should be story, is creating two fields on the same object one story or two, what about field and list view?), then push it to scratch org, do changes, pull, push to git and merge at the end. Doing it for adding one new field is like a lot of extra work.
I have a feeling that during our first sprint I lost more that 50 % of my work because some other change rewrote it in repository, which was something I didn’t really expect. And we still fight the whole git process, merging changes again and again as more branches are merge into the main one. It isn’t enough to merge changes when you do the pull request as there might come other pull request before yours and create a conflict again.
I spent about 5 % of my time on requested changes and 95 % fighting the Git.(unnamed colleague)
It is better sprint to sprint, but still sounds like a lot of extra work considering the fact that we hardly roll-back. And I still don’t care
(read don’t know anything) about all those cherry-picking, revert of commits and so on.
At the beginning we didn’t care much about the project file from which new scratch orgs are created. But at the back of my head was that strange scratching – everyone said they spent a long time doing this right, why it was so easy to us?
And it hit us later on, as you might imagine. I still hate the fact that you cannot enable all features in this file (looking at you News and Logos), as you need to think about it, so when you push changes to scratch org and pull back you don’t loose something.
At the same time it was great – for a few hours. We needed to add platform licences and related profiles. Thanks to scratch org it was done in a few minutes, pushed to git repo and our build has been broken immediately for later changes as well. Of course it solved itself later when we got the licences, but you need to think about it.
I still hate to touch profile, as we get the EditReports permission from scratch org, but in our production org it is named CreateCustomizeReports. Seriously Salesforce?
Something similar is with ProfilePasswordPolicy and ProfileSessionSettings files, which you get when creating new profile, you can push it to production for the first time but get errors later on. Time to delete them from repo, which probably isn’t the right way.
holly molly kurwa drátme, when I found out that because some feature isn’t activated in my scratch org the related elements will be deleted from the component when I’ll push to git
AllowUniversalSearch, enableAccountOwnerReport and a few others are still bitting us.
How should we tackle case-to-emails and similar functionality, which refer to existing users, which doesn’t exist in QA or production org?
We also experience the errors that you loose field level security, luckily it has been solved with the Spring ’19 release.
Non metadata changes
Of course not everything can be transferred via metadata. What I like, as I feel I can „decrypt“ the DX file format, is that you have an idea what won’t be transferred and can do changes manually, while with change sets I never was sure what will and won’t be transferred. I’m pretty sure somewhere is a list of all the things which aren’t transferred via metadata, but who should remember where. (not sure this is the right list)
For example the mobile app branding isn’t transferred via metadata, but the logo (as a file) is. But I cannot chose it when doing the branding again in production, so … should I push it to repo or not, when I have to choose it from local drive anyway?
Is it worth it?
That’s the crucial question.
I like that we are able to find out when something has been changed or deleted, that we can „pack“ (commit) the whole pack of related changed and put description why it has been done. I feel this adds some kind of quality to the whole process.
I like that I can do a lot of changes quickly in text files rather than clicking it slowly in the Salesforce interface. That I can see right in the code who changed it, when and why (thanks to the right extension for Visual Code).
I hate that I don’t know about changes other people do at the same time. For example we had one story to change home page and another to add some design element to home page (they weren’t part of the same story as the second was related to other story where it makes more sense). As we worked on it at the same time I wasn’t aware that my colleague did a change to home page and he didn’t know I wanted to be safe and created a new version of it. And the end my story passed tests (because it had all elements which should be there) and his failed (because the element did’t show up on my homepage which was active by then), while would we know about each other’s work my story would fail (because it had extra element not part of the story) and his would pass. The testing is still strange world to me.
I hate that DX is so slow on our machines, which is something we try to solve with our IT department. But every command I run takes 20+ seconds, so it is really annoying and I try to minimize them as much as possible.
It works greatly with Scratch orgs, with normal instances it still feels like a lot of work to get the metadata (you have to have package.xml file or create a package or name elements you want to get, those names are case sensitive and not related to directory they are saved, so it might be hard to find the proper word). Besides all that I have a great feeling and consider it as a great step towards better implementation.