Salesforce Code Move Strategy
Why sometimes a few lines of code changes take several days of deployment. Find the answers and Code Move Strategy:-
Recently In one of my project I faced the following situation: We did a code change in trigger. Changed a string value from “Demo” to “Trial”. The code change hardy took 1 minutes. Client was aware of the changes and time it will take so we estimated the work as 2 hour including code changes, analysis of its impact and deployment. When the developer finished deploying the code changes it took him 2 days (16+ Man-hours). Yes it is a surprise. Now let me list out the problems he faced.
- Code coverage of the existing trigger was 12% (Our Company Best Practice is 85%)
- Code coverage of overall production org was less than 75%. Yes this is hard to believe but this do happen when we push things in production without code coverage.
- Existing test classes were failing in production.
- Trigger in production was different than in Sandbox. Yes this is also possible when we have multiple sandboxes and people do code overrides as they are competing against each others.
- Deployment had a narrow slot of 2 hours during which end client were not working.
- Batch Jobs working on the same object were preventing the Trigger to deploy.
We gave our best as a team and came up with the following strategy which changed our entire company's estimation and requirement analysis process.
Code Move Strategy:
Step 1: Check the existing production code coverage by “Run All Test”.
Step 2: Lookout for test class failures if any.
Vice-CEO w Craftware. | Highest Quality Salesforce Services | EO'er
8 年Point 4 - that's really bad coding practice. Code should be kept in code repository and there should be no ninja deployments on production. Not in projects that have a couple of people involved.