Second, though Acme’s developers understood the concept of branching, the admin and BA team found it confusing. This left big holes in what Git could even warn them about when it did catch conflicts. A nightly CI job picks up the changes from the branch and deploys it to the target environment that evening - a fairly typical CI setup.īut this setup isn’t catching merge conflicts and “code clobbering” in the way that they expected.įirst, the team had to drop a lot of metadata from their Git repo because they couldn’t get declarative metadata to play nicely with Git. They use pull requests to merge into upstream branches dedicated to UAT, staging or production. The team uses a traditional Git flow to commit changes that they make in Salesforce into branches in a GitHub repo. So they created a Circle CI implementation with Ant scripts. got excited about a project to bring CI/CD to the Salesforce team. Here’s an example from a sales call this week (anonymized of course):Ī javascript developer at Acme Inc. Why Git’s traditional merge conflict algorithm doesn’t work for SalesforceĮven the most sophisticated Salesforce development shops struggle with merge conflicts, even when they are using Git. And even if you are, you’ll find that merge conflicts are an extra special pain. Git should help, but it’s notoriously difficult to use Git with Salesforce. Unfortunately, many Salesforce admins and developers do not get this type of merge conflict warning because change sets and Ant scripts provide no merging mechanism - they blindly overwrite the target with whatever is in the source org. This prevents bugs and the need to rollback. Importantly, he’d be blocked from pushing his changes in a way that would overwrite Susie’s hard work. Rather than letting Joe blindly overwrite Susie’s changes, Git would notify Joe that his changes were in conflict and suggest how he might be able to fix the conflict gracefully. What is a merge conflict in Salesforce?Ī merge conflict is what should happen in the above scenario if Joe and Susie were using Git in the traditional manner. Susie’s changes would be lost and there would cascading effects. Establishing an Integration environment where every developer is responsible for merging their changes is another effective approach to manage merge conflicts and code clobbering in Salesforce.Ĭode clobbering is what would happen if Joe pushed his changes to Integration via a change set or Ant script.Cherry-picking specific lines of code based on the diff has emerged as an effective solution for avoiding code clobbering and merge conflicts in Salesforce.Git’s traditional merge conflict algorithm has difficulty handling Salesforce, leading to problems with merge conflict detection and resolution.Source-driven development solutions, like Salesforce DX, aim to help manage merge conflicts, but they often fall short due to inherent issues with Salesforce's structure.
0 Comments
Leave a Reply. |