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.
To understand the different actions that can be performed in the Pipeline Configuration page, let’s start with some key concepts:
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.
- 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:
- Navigate to the Connection Behavior tab and click on New:
- Give your connection behavior a name and add a description, if desired.
- Choose an option from the drop-down menu in the Deployment Behavior field. The available options are: Manual, Automated or Scheduled.
- Choose a back-promotion behavior. The available options are: Manual, Automated or Scheduled.
- 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.
- 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.
- 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.
Icons and Actions on the Pipeline Configuration Page
Let's take a look at the Pipeline Configuration page and see what the icons on this page mean:
- The right arrow indicates that there are user stories ready to be moved to the next environment.
- The left arrow indicates a back-promotion.
- 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.
- The shield indicates the presence of quality gates, such as Selenium tests or compliance scans.
- 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.
- 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
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:
- Navigate to the Quality Gates related list in the Connection Behavior record and click on New.
- Specify a name for the quality gate.
- Select the metadata group you want the quality gate to be applied to.
- Then, specify which type of quality gate this is. You can choose from the following types:
- 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.
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.
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.
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”: