Copado integration

Build in quality in your continuous integration by integrating Quality Clouds features with Copado. All the commits for all your user stories can then be checked for adherence to coding standards and best practices. 

What is Copado?

Copado is a Salesforce-native DevOps, deployment and release management solution for Salesforce which enables continous integration. 

Integrating Quality Clouds with Copado

Prerequisites

You need to have both the Copado app and the QC for Salesforce app installed in the instance where you want to integrate, and you need a Quality Clouds user who is a "Scan Launcher".

Additionally, make sure you have defined all the Git repositories you want to work with from within the stories in the Quality Clouds admin portal. See Setting up Salesforce Git repositories.

Quality Clouds is being distributed in a form of an unmanaged package.

 What's an unmanaged package?

Unmanaged packages are typically used to distribute open-source projects or application templates to provide developers with the basic building blocks for an application. Once the components are installed from an unmanaged package, the components can be edited in the organization they are installed in. The developer who created and uploaded the unmanaged package has no control over the installed components, and can't change or upgrade them. Unmanaged packages should not be used to migrate components from a sandbox to production organization. Instead, use Change Sets.

As a best practice, install an unmanaged package only if the org used to upload the package still exists. If that org is deleted, you may not be able to install the unmanaged package.

See more about unmanaged packages in the Salesforce documentation article: Salesforce: Understanding Packages.

The unmanaged package can be found in the following repository: 

https://bitbucket.org/qcrepo/qualitycloudscopadointegration/src/master/ 

→ To integrate Quality Clouds with Copado

  1. Go to the code repository for Quality Clouds Copado Integration, and click Clone. This downloads the package.
  2. Use your preferred way to install the package in your Salesforce org. You can use the following command: 

    sfdx force:mdapi:deploy -d <repository_folder/> -u <org_alias> -w 100

Setting up

All you need to do to set up the Quality Clouds features is to give your users permissions to see the fields added in the unmanaged package, and adapt the page layout for your user stories. 

1. Give permissions

Set the fields delivered in the unmanaged package to visible for your users. The fields delivered are added for the following objects:

ObjectCustom field
QCIssue
  • Link to Issue
  • User Story
Scan
  • Link to Scan
  • User Story
Copado User Story
  • QCIssue Count


→ To give permission

  1. Once in Salesforce, go to Setup > Object Manager.
  2. Search for QCIssue object, click to open it, and go to Fields and Relationships. This opens a table with all the fields. 
    1. Scroll down to Link to Issue custom field, open it, and do the following steps:
      1. Click Field Level Security
      2. Select the visible check box for each role that needs to see the integration fields. 
      3. Click Save.
    2. In Fields and Relationships, scroll down, and edit User Story, and perform the steps i - iii.
  3. Back in the Object Manager, search for Scan, click to open it, go to Fields and Relationships, and perform steps i - iii for the following elements:
    • Link to Scan
    • User Story
  4. Finally, in Object Manager, search for Copado User story, click to open it, go to Fields and Relationships, and perform steps i - iii for the following element:
    • QC Issue Count

You have now made the integration visible to your selected users.

2. Adapt user story layout

Add the custom button and fields to access the Quality Clouds functionality from within your user stories. 

→ To adapt page layout for user stories

  1. Once in Salesforce, go to Setup > Object Manager
  2. Search for and select User story
  3. Select Page Layouts, and open the layout you want to modify, e.g. Copado__Page_Story__c.
  4. From Buttons section, select the Run Quality Clouds scan button, and drag and drop it to the User Story Details > Custom Buttons.
  5. From Mobile and Lightning Actions section, select the Run Quality Clouds scan button, and drag and drop it to the User Story Details > Custom Buttons.
  6. From Related Lists section, select the Scans and QCIssues lists and drag and drop these into the Related Lists space. 
    1. Optionally, you can customize the display of the list by adding fields to display. Click the wrench to open properties.  For example, for Scans, add the Link to Scan
  7. Optionally, from Fields section, select the QC Issue Count field, and drag and drop it to the Information section. This is useful when you want to set validation rules for your user stories. 

You have now set up the Quality Clouds actions from your Copado user story.