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 productiondevelop
- 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 ofdevelop
hotfix
- branched off ofmaster
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
Developer is given a task to work on called
My New Feature
Developer branches off of
develop
with a new branch calledfeature/my-new-feature
Developer works on task, and once complete, creates a PR to merge
feature/my-new-feature
back intodevelop
CI build is automatically triggered for the PR
If the build passes, an admin must manually approve and merge the PR (using squash commits), then delete the
feature/my-new-feature
branchOnce merged into
develop
another CI build is automatically triggered for the new commits on thedevelop
branchIf the build passes (which is should do at this point), the
develop
branch is automatically deployed onto the staging serverQA can then be carried out on the staging server
After passing QA, an admin must manually merge the
develop
branch intomaster
This causes another CI build to automatically trigger
If the build passes (which is should do at this point), the
master
branch is automatically deployed onto the production server
Hotfix Example
Developer is given a hotfix to work on called
Urgent Bug Name
Developer branches off of
master
with a new branch calledhotfix/urgent-bug-name
Developer works on hotfix, and once complete, manually merges back into
master
Develop also manually merges the hotfix branch into
develop
CI builds are started on both
master
anddevelop
which upon success, will deploy to staging and productionDevelop must then delete the hotfix branch.