Online Conflict Resolution

Updated 1 week 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. Apex code and Layouts) 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 value "All except code" in the Auto Resolve Options picklist field. 
      1. The promotion object also has a picklist field called Auto Resolve Options.
      2. All new promotions linked to this Deployment Flow will have the "All except code" value selected by default in the Auto Resolve Options picklist field.
  2. In a specific Promotion:
    1. While creating or editing a promotion record, select the "All except code" value in the Auto Resolve Options picklist field.
      1. It does not matter if the Deployment Flow linked to the promotion has a different Auto Resolve Options value. The value 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:

  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" option or you can resolve the conflict manually by clicking the "Resolve" option and then editing the text file. 

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

The conflicts markers mark the area of the conflict 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.

If there is another conflict while merging a different user story into the promotion branch, Copado repeats the process outlined in this article. Then follow the same process of resolving the conflicts or marking them as AUTO RESOLVED and then recreating the promotion deployment.


How did we do?