I think that the first reaction that anyone will have after reading my question will be 'Why do you want to move to DX without using ScratchOrgs and Unlocked Packages'? Well, we are planning to use ScratchOrgs and Unlocked Packages but our Salesforce Organization size does not allow us to migrate all our work overnight at this point of time. So, the problems that we are trying to solve are:
1) Add a source control - git
.
2) Start using DX
for deployment and other useful commands for development.
3) Use DX mdapi
for deployment.
Our current plan for git
:
1) Developers will always create a branch from master
.
2) Developers will test their changes on their sandbox from their feature/devBranch
.
3) Create a Pull Request
to merge code with deploymentReadyBranch
.
4) After the merge happens, a diff
will run between deploymentReadyBranch
and master
git diff --name-only HEAD^
All updated files will be archived and a package.xml
will be created using
sfdx force:source:convert --rootdir <dir> --outputdir <dir>
This will give us a directory with changed files and supporting package.xml
and then, the code will be deployed to an environment of choice.
5) After successful deployment deploymenrReadyBranch
will be merged
with master
.
Does this strategy look good? Suggestions on branching strategy will be very helpful.
Challenge:
1) As of now, SFDX does not provide any way to create a deployment package.xml
based on a diff
(in our case diff
between master
and deploymentReadyBranch
). The process that I mentioned in Step 4 above seems a little risky because there will be some manipulation involved with scripts.
With manipulation, I mean that if an apex class .cls
file is modified, diff
will only show me the .cls
file and not the supporting cls-meta.xml
file. So, I will have to take the name to modified .cls
and copy the respective cls-meta.xml
file and so on. For objects
in DX, I will have to copy the whole folder of the changed object.
2) A workaround can be to ask all the developers to copy the changed files to a common folder which will then be used to convert to package.xml
deployment package.
3) In this post-Development Life Cycle of using GIT in salesforce. sfdxfox mentioned not to have a strategy to create a feature branch
from master
.
Any suggestions on this will be useful. Also, a direction to properly use DX without ScrathOrgs with a vision to smooth transition to ScratchOrgs and Unlocked Packages will be really helpful.
Thanks.