Branching Strategy with Release Branches - Enterprise-CMCS/macpro-mako GitHub Wiki

MACPRO-Single-Branch-Strategy drawio

Developing a Feature

MACPRO-Single-Branch-Strategy-Feature drawio

  1. Create a feature branch off of the main branch and push the branch to GitHub. This will trigger the creation of a feature environment. Development is done locally using the feature environment as the backend. Backend changes require pushing to the origin branch, which triggers a redeployment.
  2. Create a PR from the feature branch to the main branch.
  3. When everything in the feature branch has been peer reviewed, tested, and approved; squash and merge the feature branch into the main branch. This will trigger a deployment to the DEV environment. It will also delete the feature branch and trigger scripts to delete the feature environment.
  4. QA confirms that the feature is working as expected in the DEV environment.

Creating a Release

MACPRO-Single-Branch-Strategy-Release drawio

  1. Confirm that all the work needed for the release is in the main branch.
  2. Create a release branch off of the main branch.
  3. Create a pre-release tag that follows the semvar standard minor release and matches the format vX.X.X-rc.1. Update “Target” to point to the new release branch. Use the “Generate release notes” button to create release notes for the tag. Check the box “Set as a pre-release”. Click the “Publish release” button which will trigger a deployment to the VAL environment.
  4. QA confirms that the features are working as expected in the VAL environment.
  5. CMS performs acceptance tests in the VAL environment.
  6. If there are any issues with the features in the VAL environment.
    1. Create a hotfix branch off of the release branch.
    2. Create a PR from the hotfix branch to the release branch.
    3. Create a PR from the hotfix branch to the main branch.
    4. When everything in the hotfix branch has been reviewed, tested, and approved; squash and merge the hotfix branch into the release branch.
    5. Squash and merge the hotfix branch into the main branch.
    6. Create another pre-release tag like above and increment the number after rc, e.g. vX.X.X-rc.2.
    7. Repeat this process until the release branch passes all functional and acceptance testing.
  7. Once the release is accepted in the VAL environment, create a release tag using the same semvar version as the pre-release tag, but without the -rc.X at the end, e.g. vX.X.X. Update “Target” to point to the release branch. Use the “Generate release notes” button to create release notes for the tag. Click the “Publish release” button which will trigger a deployment to the PROD environment.
  8. Delete the release branch.

Performing a Hotfix

MACPRO-Single-Branch-Strategy-Hotfix drawio

  1. Find the commit ID of the latest release using the command below, where <vX.X.X> is replaced with the latest release tag. This will return the commit ID of that tag. git rev-list -n 1 <vX.X.X>
  2. Create a tag branch from that commit ID using the command below, where <vX.X.X> is replaced with the release tag and <commit-ID> is replaced with the commit ID from above. git branch release-<vX.X.X> <commit-ID>
  3. Repeat the following steps until the issues are resolved.
    1. Create a hotfix branch from the tag branch.
    2. Create a PR from the hotfix branch to the tag branch.
    3. Create a PR from the hotfix branch to the main branch.
    4. When everything in the hotfix branch has been reviewed, tested and approved; squash and merged the hotfix branch into the tag branch.
    5. Squash merge the hotfix branch into the main branch.
    6. Create a pre-release tag that follows the semvar standard patch release and matches the format vX.X.X-rc.1. Update “Target” to point to the tag branch. Use the “Generate release notes” button to create release notes for the tag. Check the box “Set as a pre-release”. Click the “Publish release” button which will trigger a deployment to the VAL environment.
    7. QA confirms that the hotfixes are working as expected in the VAL environment.
    8. CMS performs acceptance tests in the VAL environment.
  4. Once all of the issues have been fixed in the VAL environment, create a release tag using the same semvar version as the pre-release tag, but without the -rc.X at the end, e.g. vX.X.X. Update “Target” to point to the tag branch. Use the “Generate release notes” button to create release notes for the tag. Click the “Publish release” button which will trigger a deployment to the PROD environment.
  5. Delete the tag branch.
⚠️ **GitHub.com Fallback** ⚠️