Giter Club home page Giter Club logo

devops-center-demo's Introduction

Salesforce DevOps Center Demo Project

What is this?

This Demo Project has 3 dimensions:

  1. It is a sample project to demonstrate how Salesforce DevOps Center can be used together with re-usable GitHub Actions and additional Salesforce tools to build a loosely coupled CI pipeline with automated Quality Gates.
  2. It acknowledges projects contain legacy (read: older, bad quality) metadata which should be scanned and reported but not block or confuse new development
  3. It shows that App Builders don't need to use VS Code, or any IDE, or the Command Line to get the same benefits as Developers do.

Loosely coupled how?

Imagine for a moment, you have created - over time - a dozen Salesforce projects, each with their own CI yml files, ignore files, and so on. Now imagine you want to make a change to all of them. You could go through each repository and make the change, but that's a lot of work. Instead, you could make a change in one place, and have all of your projects automatically use the updated version.

What are common moving parts that need loose coupling?

A Salesforce Project is tooling-wise a web development/JavaScript project with very few extra bells and whistles. The default DX Project setup relies on a node package.json for tooling like ESLint, Jest, or Prettier. Each tools comes with its own config and rule files as well as ignore file options.

Then you have your actual CI worfklow configuration file(s) which have dependencies to the SF CLI, Orgs and Authentication, Caching, and additional tools like PMD or the SFDX Scanner plugin.

These tools come with config and rulesets of their own.

What will it do?

All checks run on Pull Request against integration branch for changes in the force-app folder.

An integration sandbox is supposed to be the target org.

Three workflows are configured:

  • validate-metadata

    • SFDX Scanner with PMD engine and custom rules for
      • sObjects
      • Flows
      • Misc Metadata
    • only new/modified files will be prettified (3rd Party Action)
  • validate-code

    • Jest Tests
    • SFDX Scanner
      • all modified files will be checked whether they have a match in .ci/legacy-metadata-files.txt
      • for modified legacy files
        • only code will be scanned
        • the build will never fail if issues are found
        • Issues are reported in markdown table as step summary as well as
        • CSV upload to a target org (get a notification in the org optionally)
        • CSV upload is only triggered if new issues are detected upon re-rerun of a scan per PR
      • for all other files (new and modified)
        • strict code scans are performed
  • validate-deployment

    • runs a test deployment against integration sandbox and runs all local tests

How does it work?

There are several repositories involved:

How can I use it?

  • Create a fork of the template repository and use it as starting point in DevOps Center
  • Make sure to activate Actions, those aren't enabled by default when forking
  • Configure the Actions to use your own Orgs and Secrets
    • ${{ secrets.PROD_DEVOPS_CENTER_HOME_SFDX_URL }} will be used to query DevOps Center records and create a package.xml file to do deployment validation with exactly the same metadata as DevOps Center would use. Note: Deleted components are not validated.
    • ${{ secrets.INTEGRATION_SANDBOX_SFDX_URL }} will be used to do test deployments and CSV Scan Report File Upload
  • GitHub Action workflows are configured to run when a PR against integration branch is opened
    • Please make sure the integration branch exists

Todos

  • figure out how to cache yarn plugins (SFDX Scanner) or wait for Scanner GH Action to be released

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.