Recommendations for continuous integration

Applies to this Power Platform Well-Architected Operational Excellence checklist recommendation:

OE:04 Optimize software development and quality assurance processes by following industry-proven practices for development and testing. For clear role designation, standardize practices across components such as tooling, source control, application design patterns, documentation, and style guides.

Adoption of Continuous Integration/Continuous Delivery (CI/CD) can increase development complexity for Citizen Developers. However, a scalable and automated development process that can quickly incorporate new features and bug correction is critical for a reliable, sustainable fusion development process.

As a developer, you can make small code changes, push these changes to a code repository, and get almost instantaneous feedback on the quality, test coverage, and introduced bugs. This process lets you work faster and with more confidence and less risk.

Continuous integration (CI) is a practice where source control systems and deployment pipelines are integrated to provide automated build, test, and feedback mechanisms for software development teams.

Key design strategies

Continuous integration is a software development practice that developers use to integrate software updates into a source control system at a regular cadence.

The continuous integration process starts when an engineer creates a GitHub pull request to signal to the CI system that code changes are ready to be integrated. Ideally, the integration process validates the code against several baselines and tests. It then provides feedback to the requesting engineer on the status of these tests.

If baseline checks and testing go well, the integration process produces and stages assets that deploy the updated software. These assets include compiled code and container images.

Continuous integration can help you deliver high-quality software more quickly by performing the following actions:

  • Run automated tests against the code to provide early detection of breaking changes.
  • Run code analysis to ensure code standards, quality, and configuration.
  • Run compliance and security checks to ensure that the software includes no known vulnerabilities.
  • Run acceptance or functional tests to ensure that the software operates as expected.
  • Provide quick feedback on detected problems.
  • Where applicable, produce deployable assets or packages that include the updated code.

Environments

Environment setup and configuration are critical to sustainable and reliable CI/CD. Power Platform environments can be set up to isolate different stages of solution development, testing, and deployment. The CI/CD process moves changes through those stages. Establish an environment strategy with guiding principles for developer environments.

Continuous integration pipelines

To achieve continuous integration, use tools to manage, integrate, and automate the process.

A continuous integration pipeline provides:

  • A platform for running automated tests.
  • Compliance scans.
  • Reporting.
  • All other components that make up the continuous integration process.

In most cases, the pipeline software is attached to source control such that when pull requests are created or software is merged into a specific branch, the continuous integration pipeline is run. Source control integration also provides the opportunity to give CI feedback directly on pull requests.

Many solutions, like Azure Pipelines or GitHub Actions, provide the capabilities of continuous integration pipelines.

For more information, see Build CI/CD with Azure for Microsoft Power Platform.

Source control integration

The integration of your continuous integration pipeline with your source control system is key to enabling fast, self-service code contributions.

The CI pipeline runs on a newly created pull request. The pipeline includes all tests, security assessments, and other checks. CI test results appear directly in the pull request to allow for almost real-time feedback on quality.

Another popular practice is building small reports or badges that can be presented in source control to make the current build states visible.

The following image shows the integration between GitHub and an Azure DevOps pipeline. In this example, the creation of a pull request triggers an Azure DevOps pipeline. The pipeline status appears in the pull request.

Screenshot of an Azure DevOps status badge in a GitHub repository.

Test integration

A key element of continuous integration is the continual building and testing of code as developers make code contributions. Testing pull requests as they're created gives immediate feedback that the commit introduced no breaking changes. The advantage is that the tests in the continuous integration pipeline can be the same tests that run during test-driven development.

Example diagram of continuous integration

Quality checks for custom code

When including custom code in your solutions, add code quality checks to a validation pipeline to ensure clean custom code is being committed to source control. Regardless of the coding language and syntax patterns you're using, there are multiple options for maintaining code quality and increasing security and governance.

Failed tests

Failed tests should temporarily block a deployment and lead to a deeper analysis of what happened. Failed tests should also lead to either a refinement of the tests or an improvement in the change that caused the tests to fail.

Power Platform facilitation

Pipelines in Power Platform aim to democratize application lifecycle management (ALM) for Power Platform and Dynamics 365 customers by bringing ALM automation and continuous integration and continuous delivery (CI/CD) capabilities into the service.

Microsoft Power Platform Build Tools for Azure DevOps can be used to automate common build and deployment tasks related to apps built on Power Platform.

GitHub Actions for Power Platform enable developers to build automated software development lifecycle workflows. With GitHub Actions for Microsoft Power Platform, you can create workflows in your repository to build, test, package, release, and deploy apps; perform automation; and manage bots and other components built on Microsoft Power Platform.

ALM Accelerator is an open-source tool that consists of a set of applications, scripts, and pipelines designed to automate the continuous integration/continuous delivery process.

Automate tests with Azure Pipelines.

Power Apps checker Web API provides a mechanism to run static analysis checks against customizations and extensions to the Microsoft Dataverse platform.

Microsoft Power Platform CLI (PAC CLI) is a command-line tool that supports, among other things, the import and export of Power Platform Solutions, and packing to and unpacking from Power Platform Solutions source files. PAC CLI is available as a standalone command line tool or as an extension for Visual Studio Code.

See also

Operational Excellence checklist

Refer to the complete set of recommendations.