Online Conflict Resolution

Updated 3 months ago by Copado Solutions

Copado's Online Conflict Resolution feature allows you to manually resolve file conflicts during the user story promotion process. While merging user story's feature branches into a promotion branch, Copado can encounter file conflicts and will auto-resolve them as explained in the article Conflict Resolution with Git Integration.

If the Online Conflict Resolution feature is active, and the metadata type of the conflicted files has been selected in the Exclude from Auto Resolve field (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 will appear 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 feature can be activated in two different ways: 

  1. In a pipeline:
    1. Edit the Pipeline record.
    2. Select the metadata types that will be manually resolved in the Exclude From Auto Resolve picklist field:
      1. The Promotion object also has a picklist field called Exclude From Auto Resolve.
      2. All the new promotions linked to this pipeline 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 pipeline linked to the promotion has different Exclude From Auto Resolve values. The values of this picklist field in the Promotion record have priority over the equivalent picklist field values in the related pipeline.
      2. If you would like to manually resolve conflicts for other metadata types, such as a Layout, you can add a new value to this picklist field.

Copado's backend performs the following actions when a conflict is found in files of the selected metadata types:

  1. The user story's 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 containing the list of conflicted files is sent to the user executing the promotion.
  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 on the Auto Resolve button or resolve the conflict manually by clicking on the Resolve button and then editing the text file:

To edit the text file, click on the file name or on Resolve:  

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 ======= is  the code in the promotion branch, and the text after ======= 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 =======. 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 the conflict markers are removed and the conflict has been manually resolved, click on Save. 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 on Create Deployment. 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 unable to deploy if the right license or permission has not been assigned to their user.

After clicking on Submit, the promotion deployment is created again and Copado will use the file version of the RESOLVED file(s) when merging the user story's 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's feature branch into the promotion branch.

How did we do?