Copado auto resolve is overriding classes
If there is a conflict when merging classes and Copado auto resolve, the file in the target will be overridden with the file in the source. File A wins over file B. If Copado auto resolve, there is no merge in the target file, the target file is overwritten with the file in source. Check Conflict Resolution with Git Integration.
With Copado v11, the Copado Online Conflict Resolution allows you to manually resolve file conflicts during the user story promotion process. If you are not using this feature, you might run into the scenario below:
Suppose you have the following:
User1 introduced changes to apex trigger 'AccountTrigger'.
User2 introduced different set of changes to the same apex trigger 'AccountTrigger'.
a) User1 deployed user story from Dev1.
b) Changes from Dev1 are present.
c) User2 deployed user story from Dev2.
d) Changes from Dev1 were overrun and not available, changes from Dev2 are present.
There are multiple touch points where the developer and the release manager is notified about merge conflicts.
- User Story Metadata related list will show that AccountTrigger is also being referenced on another user story an will set the status to "Potential Conflict".
- The Pull request for the user story seated in Dev2 will confirm that Git is unable to merge the feature branch into the UAT branch.
- Promotion record, when promoting from Dev2 to UAT will display a related list of Metadata and its merge status.
- Copado sends an Email to the salesforce running user email address when there are merge conflicts during a promotion. The email body indicate which files, which branches and which commit ids are being affected.
- Copado generates a merge commit in the repository, with the text "All conflicts resoled by Copado" with a list of affected files. Nothing get lost, both versions of the files can be reviewed in Git.
What could have been done to prevent this, from a Developer process perspective.
- If your user story has potential conflicts on the User Story Metadata related list, make sure you create a pull request to check the merge status for the branches, using the "create pull request" button available on the User Story.
- Once confirmed that Git cannot merge the branches, incorporate the changes from UAT into Dev2 by doing a back promotion of the clashing user story. The developer will update the AccountTrigger so that it contains everybody's modifications and commit again. This will update the feature branch with all modifications.
- Update the User Story Metadata status for the AccountTrigger to "Conflict resolved".
What could have been done to prevent this, from a Release Manager process perspective.
- Before you promote
- Check if your promotion has User Story metadata marked as Potential Conflict, then check with Developers before promoting.
- After you promote
- Check the resulting promotion branch in Git
- Check the related list "Promotion User Story Metadata" if any item is marked as "auto-resolved".
- Check your email if there are any Copado notifications.