Branching and Release Strategy [DRAFT]

Overview

The branching and release strategy is based off of the GitFlow branching strategy. The concept of the release branch has been omitted for favour of a more CI/CD (Continuous Integration/Delivery) approach.

There are 2 core branches that will always remain:

  • master - deployed to production

  • develop - deployed to staging

Any work going into these branches must be via a PR (Pull Request). The branch must be one of the following:

  • feature - branched off of develop

  • hotfix - branched off of master

The feature branch is intended for any ongoing work, whether it be new features, updating existing or maintenance. Realistically, all work should be done via a feature branch.

The hotfix branch is intended for urgent bugs that must be fixed and deployed immediately. They skip the staging server and are deployed directly to production. They should be very small changes that the developer feels very confident in pushing to production.

Feature Example

  1. Developer is given a task to work on called My New Feature

  2. Developer branches off of develop with a new branch called feature/my-new-feature

  3. Developer works on task, and once complete, creates a PR to merge feature/my-new-feature back into develop

  4. CI build is automatically triggered for the PR

  5. If the build passes, an admin must manually approve and merge the PR (using squash commits), then delete the feature/my-new-feature branch

  6. Once merged into develop another CI build is automatically triggered for the new commits on the develop branch

  7. If the build passes (which is should do at this point), the develop branch is automatically deployed onto the staging server

  8. QA can then be carried out on the staging server

  9. After passing QA, an admin must manually merge the develop branch into master

  10. This causes another CI build to automatically trigger

  11. If the build passes (which is should do at this point), the master branch is automatically deployed onto the production server

Hotfix Example

  1. Developer is given a hotfix to work on called Urgent Bug Name

  2. Developer branches off of master with a new branch called hotfix/urgent-bug-name

  3. Developer works on hotfix, and once complete, manually merges back into master

  4. Develop also manually merges the hotfix branch into develop

  5. CI builds are started on both master and develop which upon success, will deploy to staging and production

  6. Develop must then delete the hotfix branch.