Here are some key aspects we should consider when doing releases and deployments on a Salesforce project. Take a look at the pointers below:
- Release based Development:
The first question you need to ask yourself is how the release is organised and where should your development be pushed and how will it migrate to higher environments. Know the repositories and make an informed decision before pushing any changes to any of the repos. - Pull before Push:
If you are using a common repo/branch with your fellow developers, ensure you take a pull before you commit any new changes as this might override functionality that others have developed. The golden rule is to take a pull from the remote branch every morning you start working. - Commit only your changes:
If there’s a file you have modified and the same file is modified by someone else, make sure you don’t deploy the entire file, rather stage and deploy only your changes. - Keep the repo clean:
Regularly clean up the branches you created which are not in use anymore. The rule of thumb is to create a branch for one feature/functionality, use it for all the supported changes and close/delete it once the feature is developed and deployed. This helps you keep track of functionality and eases out the process of history tracking for files. - Code Review:
Ensure, your Pull Request is reviewed by a fellow developer/lead so that you are not deploying anything that might fail or is against the best practices. Also, its always better to get the commit reviewed as it eliminates bugs and issues later which are far more haunting than review comments. Take it with a pinch of salt and resolve the review comments. This will only help you to become a better developer. - VSCode Extensions:
Use extensions like GitLens, Git History to track, audit changes so you are aware of the previous modifications and what changes would be needed for new releases. History tracking helps as it tells you about how a functionality was developed and whether or not the new implementation is an enhancement, upgrade or just a conflict.