Copado Branch Management: How Does It Work?

Updated 11 months ago by Copado Solutions

This functionality is no longer required if your deployment flow is based on user stories (as of v12).

The deployment flow (with Git repository and branch information) is set up within Copado. A Copado webhook is also added to your Git repository. Every time a commit is received by the Git repository, the commit information is sent to Copado where the following will occur:

  1. The Git repository is retrieved and the branch divergence will be calculated (commits ahead and behind).
  2. A local merge (ahead) or pull (behind) of the diverged commits will be attempted between a branch (e.g. Dev2) and its parent branch (in this case Staging).
  3. If the merge succeeds, a validation-only deployment of the merged content is created (e.g. validation deployment into the Dev1 org).If it fails, the error information will be displayed in the Deployment Errors tab.
  4. You will be able to see if the validation deployment succeeded or failed as well as the errors if it failed.
  5. The differences between the branches of the files affected will be available for comparison in the File Differences tab.
  6. If the validation deployment was successful, you can choose to perform a sync (e.g. Staging content into Dev1). If you click on the Sync button, the deployment is executed (Staging content into the Dev1 org), and only if it is successful, the Staging commit is merged into the destination branch (e.g. Dev1) and the changes are pushed to your Git repository.
Copado Branch Management will continuously check for changes and perform a validation deployment of the merged changes.

Best Practices Tip

Always sync back to lower environments before pushing to production, or once the deployment has been done to production. No new user story feature branch can be created until its environment has been synced. This is to prevent the feature branch from inheriting the latest changes to production into the feature and orgs branch without having actually synced them.

Reviewing File Differences

If Copado Branch Management application detects that there are file differences between two branches, the application performs a local (backend) Git merge between the two branches. Once merged, a validation deployment containing the modified files in the Git merge will be executed automatically. The merged files used in the validation deployment can be found in a zipped attachment in the Deployment Flow Steps record. 

When clicking on any of the the promote or back promote icons, you can navigate through the different tabs. By clicking on the File Differences tab you can review the files that are going to be modified in the merge.

For more information about file differences in v8 & under, click here.

Best Practices Validations in CBM Flows

Copado has enabled the following validations:

  • All flow steps must have a branch.
  • All flow steps must have a source and a destination.
  • There are no duplicated branches in the steps.
  • There are no duplicated source environments.
  • If Enforce branch/env naming convention is set to true, the branch and the source environment must be equal. (case sensitive), e.g. environment name 'UAT'  vs. branch name 'UAT'.
The flow’s UI has changed and now it's read only, so all management in your flow has to be done in the Deployment Flow Steps related list to help enforce these best practices.
How to Use It

If you want to enforce the naming convention between environments and branches, you have to set the Enforce branch/env naming convention checkbox to true.

Validations will apply when you try to activate a CBM flow, when you try to edit an active CBM flow, or when you create or edit a deployment flow step in an active CBM flow.

If you want to disable these best practices enforcement, you can turn off the validations by setting the Disable Validations checkbox to true.

How did we do?