Online Conflict Resolution

Updated 3 months ago by David Venegas

The Copado Online Conflict Resolution allows you to manually resolve file conflicts during the user story promotion process. 

While merging user story feature branches into a promotion branch, Copado can encounter file conflicts and auto resolves them as explained in this article. If the Online Conflict Resolution feature is active and the conflicted files are of a supported type (e.g. ApexClass, ApexComponent, ApexPage, ApexTrigger and Layout) Copado stops the merging process and uploads the conflicted files as attachments in the Promotion record. A "Resolve Merge Conflict" button appears in the Promotion layout. This button opens a page with the list of conflicted files to be manually resolved using a file editor included in the page.

The Online Conflict Resolution can be activated in two different ways: 

  1. In a Deployment Flow:
    1. Edit the Deployment Flow record
    2. Select the metadata types to manually resolve in the Exclude From Auto Resolve picklist field.
      1. The promotion object also has a picklist field called Exclude From Auto Resolve.
      2. All new promotions linked to this Deployment Flow will have the same selected metadata types by default in the Exclude From Auto Resolve picklist field.
  2. In a specific Promotion:
    1. While creating or editing a promotion record, select the metadata types in the Exclude From Auto Resolve picklist field.
      1. It does not matter if the Deployment Flow linked to the promotion has a different Exclude From Auto Resolve values. The values of this picklist field in the Promotion record has priority over the equivalent picklist field in the related Deployment Flow.

The Copado backend takes the following actions when a conflict is found in files of the selected metadata types:

  1. The user story feature branch merge into the promotion branch is stopped
  2. The conflicted files are attached to the promotion record 
  3. The promotion status field changes to "Merge Conflicts"
  4. An email is sent to the user executing the promotion containing the list of the conflicted files.
  5. The "Review Merge Conflicts" button appears in the promotion layout

The Resolve Conflicts page lists the conflicted files. You can choose to let Copado auto resolve a specific file by clicking the "Auto Resolve" button or you can resolve the conflict manually by clicking the "Resolve" button and then editing the text file. 

To edit the text file, click on the file name or on the "Resolve" button. 

The conflicts markers enclose the conflicted area with the following characters <<<<<<<, =======, >>>>>>>:

          Some code of the promotion branch...
          Some code of the feature branch causing the conflict...

The text before the ======= is  the code in the promotion branch, and the text after the ======= is the code of the feature branch that is causing a conflict while merged into the promotion branch. To resolve the conflict remove the conflict markers and merge the text before and after the =======. You can use the "Previous" and "Next" buttons located above the text to jump to the previous or next conflict found in the file. 

When all conflict markers are removed and the conflict is resolved manually, click the Save button. Once saved, the name of the attachment is updated with the word "RESOLVED". 

Once the files have been marked as RESOLVED or AUTO RESOLVED, click the "Create Deployment" button. The page is then redirected to the promotion page to create a new promotion deployment that triggers the feature branch merge process. 

If the user is not allowed to perform the deployment, the deployment cannot be created and a warning message is displayed. In-house or external developers can resolve the conflicts but are not able to deploy if the right license or permission has not been assigned to their user.

After clicking the "Submit" button, the promotion deployment is created again and Copado will use the file version of the RESOLVED file(s) when merging the user story feature branch into the promotion branch. If files are marked as AUTO RESOLVED, Copado will automatically auto resolve these files when merging the user story feature branch into the promotion branch.

Smart Conflict Resolution

Conflict resolution is smarter now in Copado thanks to this new feature. As from now, when manually resolving conflicts on-line, Copado will learn about those conflicts and how to resolve them without prompting the user again. The conflict will be marked as AUTO RESOLVED and it will document this smart auto resolve on the merge commit message as follows: "Smart online merged". This means that Copado has re-used a previous on-line conflict resolution automatically.

How did we do?