How does a change flow from commit to production in CI/CD? - Part 3
How a change flows from commit to production: the release branch workflow, CI and CD steps, quality gates and how we handle build failures.
How does a change flow from commit to production in CI/CD? - Part 3
Knowing the phases, roles and environments is one thing, but a team needs to know exactly what happens to a change after a developer pushes it: which checks run, who approves what, and what happens when something fails. Without this clarity, the process becomes a set of tribal rules and every team ends up doing it differently. In the previous article, we discussed the roles and responsibilities and the environments. In this article, we are going to see the end-to-end workflow from a code check-in to the production deployment, the CI and CD steps in detail, and how build failures are handled.
CI/CD Process series:
- What is CI/CD and why do we need it?
- Who does what in CI/CD? Roles and environments
- How does a change flow from commit to production in CI/CD? (this article)
- How to implement CI/CD with Azure DevOps?
TL;DR Summary
- A change starts in a user story/bug branch, goes through a pull request and code review, and is merged into the sprint release branch.
- CI sets the version, compiles with code style checks, runs unit tests, compares code coverage, scans for vulnerabilities and publishes a versioned build artefact.
- CD deploys the same build artefact to Dev automatically, and then to QA, UAT and production after the approvals at each gate.
- After production deployment, the source code is tagged and merged to master, and a smoke test is executed.
- A build fails for compilation errors, code style errors, test failures, vulnerabilities or a reduction in code coverage, and the failure goes back to the developer.
Workflow
The following diagram details the primary workflow (release branch) in the various phases described in the first article. Workflows for other branches, like user story and hotfix branches, follow the same idea with suitable modifications.

The flow highlighted in purple is the happy path of a change from a user story branch to production; the grey lines are the loops back to development. Let us walk through the diagram phase by phase.
Code Phase (sprint development)
- The developer creates a user story or bug branch.
- The developer develops the feature or fix and builds it with Visual Studio along with the ReSharper CLI.
- The developer raises a pull request.
- The code is reviewed. When there is any code issue, the review is rejected and the change goes back to development. When it is approved, the change is merged to the sprint release branch.
Build Phase
- The merge triggers the continuous integration build on the sprint release branch. We will see the CI steps in detail below.
- When the build fails, it goes back to the developer. When it succeeds, the binaries are published.
Test Phase
- The build is deployed to the Dev environment and the developer does the integration test.
- The Tech Lead approves the build number.
- The QA Lead gives the pre-deployment approval and the build is deployed to the QA environment.
- QA does the functional test along with the automated smoke test. When bugs are found, the work goes back to the Code phase.
- The QA Lead gives the post-deployment approval for QA and the pre-deployment approval for UAT, and the build is deployed to the UAT environment.
- In UAT, the automated smoke, regression, security and performance tests are executed, QA does the functional regression test and the BA does the UAT.
Release & Deploy Phase
- The SDM gives the pre-deployment approval for the build number.
- CAB approval is obtained.
- The Release Champion deploys the build to the live environment.
- The source code is merged to master and tagged.
- The QA team does the smoke test on the live environment and signs off.
- Once the live environment is stable, the build is deployed to the DR (Disaster Recovery) environment, and the QA team does the smoke test and signs off there as well.
Notice that the build number travels with every approval. This is the “build once, deploy many” goal in action: the same versioned build artefact which passed CI is the one that reaches production.
High Level Workflow
CI
- The version number is set in the AssemblyInfo.cs file for .NET Framework projects and in the project files for .NET Core projects.
- The source code is compiled. As part of the compilation, ReSharper is triggered to check the code style.
- The unit tests are executed.
- The unit test code coverage is analysed, published and compared with the previous build.
- Checkmarx does a vulnerability assessment.
- A standalone version file is created (optional for .NET projects).
- The build artefact is generated and published.
CD
- The build is pushed to the Dev (integration) environment automatically.
- Deployment to the QA environment is triggered.
- The test cases are executed in QA.
- Deployment to the UAT environment is triggered.
- The regression, automated and performance test cases, etc. are executed.
- BA/SDM testing is done as required.
- CAB approval is obtained.
- Deployment to the production environment is triggered.
- A tag is generated and the code is merged to the master branch.
- A smoke test is executed in the production environment.
Quality gates at a glance
The following table summarizes the automated checks and the manual approvals in the workflow,
| Stage | Automated checks | Manual approvals |
|---|---|---|
| Code | ReSharper code style (local) | Code review on the pull request |
| Build (CI) | Compilation, ReSharper code style, unit tests, code coverage comparison, Checkmarx vulnerability scan | - |
| Dev | Build Verification Tests (when available) | Developer integration test, Tech Lead approval |
| QA | Automated smoke tests | QA Lead pre- and post-deployment approval, QA functional test |
| UAT | Automated smoke, regression, security and performance tests | QA Lead pre-deployment approval, QA regression test, BA UAT |
| Production | Smoke test | SDM pre-deployment approval, CAB approval, QA sign-off |
The more of the right-hand column we can move to the middle column, the closer we get to true Continuous Delivery.
Build Failures
A build can fail in the CI process for the following reasons,
- Code compilation errors
- Compilation errors triggered by ReSharper
- Unit test (or other test) failures
- Vulnerabilities in code found by Checkmarx
- Reduction in code coverage between successive builds
A build failure triggers an email with an appropriate description. For more details, the logs of the build can be viewed in the Logs section of the failed build, as seen in the following screenshot.

Must Do: Fix a broken build before you push any new change. A build that stays red stops everybody else from integrating, and that defeats the purpose of CI.
Wrap up
In this article, we have looked at the end-to-end release branch workflow, the CI and CD steps, the quality gates at each stage and how build failures are handled. I really appreciate that you took the time to read this article. In the next article, I will walk you through how to implement this workflow with Azure DevOps, the tools and pipeline tasks we use, the challenges we faced and our recommendations.
Related Posts
How to implement CI/CD with Azure DevOps? - Part 4
Implement the CI/CD workflow with Azure DevOps: pipeline building blocks, recommended tools and tasks, a CI pipeline skeleton and lessons learned.
What is CI/CD and why do we need it? - Part 1
What CI, Continuous Delivery and Continuous Deployment mean, why we need CI/CD, the goals of our process and its six phases.
Who does what in CI/CD? Roles and environments - Part 2
The roles and responsibilities in the CI/CD process, which role owns which phase and the environments a build goes through, with their gates.