Copado Auto Resolve Is Overriding Classes
With Copado v11, 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:
User1 introduced changes to the Apex trigger 'AccountTrigger'.
User2 introduced a different set of changes to the same Apex trigger 'AccountTrigger'.
- User1 deployed user story from Dev1.
- Changes from Dev1 are included.
- User2 deployed user story from Dev2.
- Changes from Dev1 were overridden and are not available, changes from Dev2 are included.
- The User Story Metadata related list will show that the AccountTrigger is also being referenced in another user story and will set the status to Potential Conflict.
- The Pull request for the user story sitting in Dev2 will confirm that Git is unable to merge the feature branch into the UAT branch.
- The 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 indicates the files, the branches and the commit Ids that are being impacted.
- Copado generates a merge commit in the repository, with the text “All conflicts resolved by Copado" which includes a list of all the affected files. Nothing gets 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 in the User Story Metadata related list, make sure you create a pull request to check the merge status of the branches, using the Open Pull Request button available in the user story.
- Once it is 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 will commit again. This will update the feature branch with all the modifications.
- Update the status of the User Story Metadata for the AccountTrigger to Conflict Resolved.
What could have been done to prevent this from a release manager process perspective?
- Before promoting
- Check if your promotion has user story metadata marked as Potential Conflict, then check with the developers before promoting.
- After promoting
- Check the resulting promotion branch in Git
- Check in the Promotion User Story Metadata related list if any item is marked as auto-resolved.
- Check your email if there are any notifications from Copado.