Pipeline Configuration

Updated 1 month ago by Copado Solutions

Introduction

As part of Copado Continuous Delivery, we have enhanced the pipeline feature with a redesigned Pipeline Configuration page where you can view and manage the environments and their connections, and manage connection behaviors to automate deployments and quality gates. 

If you are in Summer ‘19 or under, check out the Pipeline Manager article.

To understand the different actions that can be performed in the Pipeline Configuration page, let’s start with some key concepts:

Connection Behaviors

A connection behavior is a template that is used to define the deployment, back-promotion and quality gate behaviors that will be applied throughout your release management process. A connection behavior allows you to define three things:

  • The deployment behavior. You can specify whether you want to schedule or automate a deployment, or execute a manual deployment.
Copado Continuous Delivery makes use of Salesforce’s new Change Data Capture (CDC) capability to enable automated and scheduled deployments. If you specify a scheduled or automated deployment behavior, please make sure you have enabled Change Data Capture in the Setup UI for two particular Copado objects: User Story and Promotion.
  • The back-promotion behavior. As with a deployment, you can specify whether you want to schedule or automate a back-promotion, or execute a manual back-promotion.
  • The quality gates that will be applied. Quality gates allow you to automatically or manually verify that your deployment meets requirements. See the Quality Gates section below for a list of all the quality gates you can specify.

Each connection can have a connection behavior. The connection behavior that is used can either be defined by the environment it is connecting into or by the environment it is connecting out of. In the pipeline, each environment can have multiple incoming connections, but can only have one outgoing connection. By editing the incoming connection behavior for an environment, you are setting the default behavior for all connections coming into that environment. This is useful in cases where there are many incoming connections to a single environment, since you only have to define the connection behavior one time for all of them.

There may be cases, however, when you want to have a special behavior for one particular connection that is different from the behavior that is applied to other connections going into the same environment. In that case, you can define an outgoing connection behavior from the source environment. Outgoing connection behaviors will override the incoming connection behavior:

How to Create a Connection Behavior

A connection behavior can be defined once and reused in many different places. To create a connection behavior, follow the steps below:

  1. Navigate to the Connection Behavior tab and click on New:

  1. Give your connection behavior a name and add a description, if desired.
  2. Choose an option from the drop-down menu in the Deployment Behavior field. The available options are: Manual, Automated or Scheduled
  3. Choose a back-promotion behavior. The available options are: Manual, Automated or Scheduled
  4. If you have chosen the Scheduled Deployment or Scheduled Back-Promotion option, click on the Schedule Deployment or Schedule Back-Promotion link to specify the schedule. 
  5. You can also customize the batch size for scheduled deployments or back-promotions. A batch size of 1 means that each user story will be deployed individually. This takes a longer time in total, but means that any deployment errors will be clearly associated with a particular story. Choosing a larger batch size allows you to group many user stories to make the deployment happen more quickly.
  6. Add quality gates. Quality gates are only applied to deployments. Back-promotions do not run quality gates:

You can add as many quality gates as needed to your connection behavior. Continue reading for more information about how to do this.

Copado performs deployments using the user credentials of the user who triggered the action. This can cause Automated or Scheduled deployments or back-promotions to fail if the user who submitted the story does not have credentials in the destination environment. To address this, you can set a default org credential for each org that will receive automated or scheduled deployments.

Icons and Actions on the Pipeline Configuration Page

Icons

Let's take a look at the Pipeline Configuration page and see what the icons on this page mean:

  1. The right arrow indicates that there are user stories ready to be moved to the next environment.
  2.  The left arrow indicates a back-promotion.
  3. The infinity icon over the right arrow indicates that there is an automated deployment. If no automations have been set up, a hand will be displayed.
  4. The shield indicates the presence of quality gates, such as Selenium tests or compliance scans.
  5. The clock over the left arrow indicates that there is a scheduled back-promotion. If there are no scheduled back-promotions, a hand will be displayed instead.
  6. A hand icon indicates that a connection behavior is applied, but the deployment or back-promotion is manual.

If the icons are greyed out, this means that there is no connection behavior applied. In this case, both deployments and back-promotions must be performed manually.

From the header of the Pipeline Configuration page, you can perform three actions:

  • Return to Pipeline.
  • Click on Variables to set Environment Variables. These allow you to replace values in metadata as part of a deployment.
  • View Pipeline Details: This opens the Salesforce record detail page for the pipeline.

In the drop-down menu of each environment, you can choose from the following options:

  • Edit Environment: This option will take you to the Environment details page, where you can edit the environment.
  • Clone Behavior of Incoming Connection
  • Clone Behavior of Outgoing Connection
Quality Gates

A quality gate defines a set of tests that will run as part of a continuous delivery process to ensure quality by identifying failures prior to deploying. The quality gate allows you to check a particular group of changes to decide whether it should be allowed to be deployed or not. There are different types of quality gates that can be applied to a connection behavior:

To create a quality gate, follow the steps below:

  1. Navigate to the Quality Gates related list in the Connection Behavior record and click on New.
  2. Specify a name for the quality gate.
  3. Select the metadata group you want the quality gate to be applied to.
  4. Then, specify which type of quality gate this is. You can choose from the following types: 
    1. Apex Tests with Validation
    2. Compliance Check
    3. Manual Approval
    4. Manual Test  
    5. Pull Request
    6. Selenium Test 
    7. Static Code Analysis
    8. Validation
    9. URL Callout
  5. Different types of quality gates have different relevant options. For example, in the case of Apex tests you can specify a test level such as Run Local Tests.

Additional Considerations

Running Selenium tests or compliance scans as part of Continuous Delivery provides you more flexibility since you can enable scans based on the type of metadata being deployed. If you have configured your environment records to trigger Selenium testing and compliance scans on any deployment to that environment, we recommend that you use Continuous Delivery feature instead.

Metadata Groups

A metadata group is basically a container for multiple metadata items.

When you create a quality gate, you need to specify what metadata will trigger that quality gate to run. This allows you to run different tests depending on what types of metadata are included in the deployment. Specifying metadata groups is a powerful option that allows you to run tests only when necessary. For example, it’s rarely necessary to run Apex tests if your metadata only includes the Report metadata type. 

When you create a metadata group, you give it a title and a description. You can then add individual metadata group items, each of which represents a particular type of metadata. 

Your list of quality gates will show the name of the metadata group that triggers them. We recommend that you name your metadata groups to summarize the types of metadata they contain, like “Critical Business Logic” or “French Team Customizations”.

To create a metadata group, navigate to the Metadata Group object and create a new record. Metadata groups and metadata group items can be saved so that you can reuse them across different pipelines and connection behaviors.

Metadata Items

A metadata item is a representation of a Salesforce metadata type. A metadata group is simply a collection of metadata items. You can specify whether this includes all metadata of that type, or only metadata that matches a particular pattern. You can specify patterns such as Starts With and Contains to match the API name (aka the developer name) of the metadata item. For example, you can have a metadata Item that matches metadata with type “ApexClass” and a name that starts with “Sales”:


How did we do?