
I built a VS Code extension that prevents accidental code overwrites during Salesforce deployments
I'm a Salesforce developer, and the problem of code overwriting is happening quite often in my team. Mainly when multiple developers are working on the same Apex/LWC components in a sprint, this kind of situations are very common. Because traditional deployment option "SFDX: Deploy Source to Org" (from Salesforce Extension Pack) doesn't check if the update is happening on the latest file. So, developers often by mistake deploy their code without retrieving the latest version. To prevent this, I created a VSCode Extension named SF Guard.
[VSCode Marketplace] [GitHub]
- Before deploying, it compares your local version against the org to ensure you're deploying on top of the latest code.
- If there's a conflict, it stops the deployment and shows you exactly what changed using a visual diff viewer
- You can take backups of files before and after deployment, so you never lose your code, even if it is overwritten by someone else.
The main motivation of writing this post is to get some valuable feedback, as it's still in early phase and tbh I don't even sure most of the developers are even facing this same issue or not. We mainly use Flosum (a deployment tool) to deploy our code across different orgs. So, I'm not even sure if using Git will already resolve the issue.
If you're facing the similar issue, I would advise you to try this at least once. Your feedback is highly appreciated. Really wanna know, if this idea is worth exploring. And of course, it's completely free & open source.
Thank you.