2

Development and Deployment Process

In this post we will cover Development/deployment guide for Salesforce related Projects. We will cover standard project development lifecycle, environments management and the criteria that is to be met before moving to a higher/production environment including Salesforce Branching Strategy. We should ensure that all development, testing, remediation, and propagation of code fall in line with the deployment process and ensure a stable development life cycle.

The process outlined will serve as a standard for changes made in any of the current Salesforce instances, Sales Cloud, Service Cloud, and Community Cloud.

Development process


Let start with deployment process. Developing applications on the Salesforce platform is fast and easy.

Development Process

It is recommended that if possible the whole release management process is complete automatic and this document outlines the process to deliver this. Below image describe the process of project management which include how we can manage the environment management, Agile methodology and release management.

Development Process flow in Salesforce
  • Backlog : This is the gathering of ideas, requirement and prioritization of requirement.
  • Development Process : This is the process of implementing the defined requirement as defined within the backlog.
  • Release Management : This is the process of managing the completed application/enhancement into production.

Development Process Flow in Details.

One of the most important parts of the software development lifecycle is the testing of the migration of the code and configuration from sandbox to sandbox and to production after UAT. Below document show how we can follow the end to end development process during plan, code, build, test and release process.

Development Process Flow in Details.

SALESFORCE DX IN PRACTICE

Salesforce DX is a set of tools and features that improve the efficiency of development during the application lifecycle. It addresses common challenges faced by developers, allowing them to manage the source of truth and lifecycle for the org. With its accessible and useful tools, development teams can easily work with command line interfaces (CLIs) or integrated development environments (IDEs). Below are the core features.

  1. Source Driven Development
  2. Salesforce CLI
  3. Modular Metadata and code

The included tools for Salesforce DX are designed to improve the Application Lifecycle Management (ALM) process at every stage.

Branching Strategy

A branching strategy is a set of rules, that describes when branches are created, naming guidelines for branches, what use branches should have, and so on. This is a the toughest part for any DevOps implementation. We would like to light a few advantages of a good branching strategy. Below is the branching Strategy for Salesforce Development we can follow.

branching Strategy for Salesforce Development

A Feature-based branching strategy we can have following branches:

  1. Master – Production Branch
  2. Hotfix – Branch to handle production issues that needs immediate attention
  3. Release – Represents the candidate for production (Branch of UAT)
  4. Develop – Integration Branch where multiple projects merge
  5. Feature – Project features (Branch for each project.)

Branch Naming Convention

All branches should have a clearly defined names with release number. This naming conventions should follow the company standard. For Examples

  • <Org_Name>.Release.<versionNumber> for release.
  • <Org_Name>.Integration.<VersionNumber> branch for testing and UAT.
  • <Org_Name>.Team.<VersionNumber> for team base branch
  • <Org_Name>.BreakFix.<Version Number> branch for the scrum team working on break-Fix release.

Developer Workflow – One Time Setup

  1. INTEGRATED DEVELOPMENT ENVIRONMENT (IDE) : As recommended by Salesforce Visual Studio Code is the IDE for all Salesforce Development activities.
  2. SETUP VISUAL STUDIO CODE : Download the latest version of Visual Studio Code from https://code.visualstudio.com/ and install it.
  3. SETUP SALESFORCE DX CLI : Go to:- https://developer.salesforce.com/tools/sfdxcli to install Salesforce DX CLI.
  4. INSTALL SALESFORCE EXTENSION PACK : Install the Salesforce Extensions Pack: this extension can be downloaded in VSC by going to the extension icon on the left side. Search for the Salesforce Extension Pack and click on the first result.
  5. INSTALL GIT : download the latest version of Git from https://git-scm.com/download
  6. CLONE REPOSITORY FROM VCS : Click on Clone button to get the code local.

Developer Workflow

1) CONNECTING WITH YOUR SALESFORCE ORG

Now, as you’ve installed Salesforce DX CLI, VS Code and all the required extensions, have the local git code Repo you’re good to connect your IDE with your Salesforce Org. To do so, use command:- Ctrl + Shift + P and type Authorize an Org. Here, we’re going to connect with our dev org or a sandbox. You’ll see the first option as:- Authorize an Org and press enter.

CONNECTING WITH YOUR SALESFORCE ORG

Want to learn about how to setup vs code with Salesforce check this post.

2) DEVELOPMENT – SALESFORCE METADATA MODIFICATION

Based on the user story assigned to you identify the components and create/modify the components in the Salesforce environment ( Or by Vs Code). Specify the metadata component details in the package.xml file under manifest folder. Once the development and unit testing is completed commit the code into your project branch.

3) COMMIT CODE TO REPOSITORY

The next step is to get all your classes, triggers and other required files in our IDE. To do so, open package.xml from the manifest subfolder present in the left pane. Right click anywhere in package.xml and click the option:- SFDX: Retrieve Source in Manifest from Org . Make sure you are connected to the correct branch in your VSCode. Stage and Commit your changes fro VsCode. Learn about GIT Command here.

Deployment process


Release management provides a framework to control when and where changes are promoted from one Salesforce organization to another. You can setup the CI/CD process to move a change from one organization to another. Whether from a developer sandbox to integration testing or from user acceptance testing (UAT) to production, release management is the framework to enable effective organizational control, and should be implemented alongside your deployment management process.

There are a number of tools currently used to manage the deployment of these applications, including change sets and the Force.com migration tool.

  1. Change Set
  2. Force.com migration tool (ANT)
  3. SalesforceDX.
  4. 3rd Party tool.

Check this session recording to learn about how to setup CI/CD pipeline using Jenkins.

Release Strategy Best Practices


We should follow the below key release management best practices.

  1. No changes are made into production directly.
  2. Sandboxes are all refreshed as soon as possible after a release has been pushed to production.
  3. No use of CHANGE SET.
  4. All migration are automated.
  5. All migration scripts are tested.
  6. Complete regression test is carried out before code is pushed to production.
  7. Developers need to create a unit test for all code and configuration they develop.
  8. Try to target the 95% code coverage for Apex Code.
  9. Have a well-documented release roadmap. A comprehensive communication plan is place for release.
  10. The release process is managed by a Release Manager who is independent of any scrum team.

Further learning

  1. Salesforce Org Strategy
  2. Governance model required in SF projects

Check out the our YouTube, and don’t forget to subscribe to our channel, so that you’re notified right away when a new video is available

Comments(2)

  1. Reply
    Satyabrat says:

    What’s your experience with tools used for DevOps arena for Salesforce. Say for example, Copado?

    • Reply
      Amit Chaudhary says:

      All tool have there advantage and dis-advantage. I used both AutoRabit and Copado.

Post a comment