This document describes the branching model and release process for this repository.
We follow an extended version of Git Flow workflow to suit our collaboration and review process in GitHub.
This document ensures consistent and reliable release management across all contributors.
Our repository uses the following primary branches:
| Branch | Purpose |
|---|---|
stable |
Reflects the state in production. Every tagged commit on stable represents a released version. |
main |
The main development branch containing the latest completed features and integration code. |
feat/* |
Feature development branches. Can be based on either main, release/* or feat/* branches. |
fix/* |
Development fix branches. Can be based on either main, release/* or feat/* branches. |
release/* |
Used to prepare a new stable release. Based on main. |
hotfix/* |
Used for urgent fixes to production. Based on stable. |
- The only option for merging GitHub PRs should be "Merge Pull Request"
- Create a new branch from either
main(if no release branch exists), the appropriaterelease/*or afeat/*branch:git checkout main # or release/vX.Y.Z git pull git checkout -b feat/<feature-name>
- Implement the feature and commit changes.
- Open a Pull Request (PR) on GitHub into the base branch.
- During development, the branch can have all commits to facilitate the review process.
- Before merging: To maintain a clean and understandable git history, interactively rebase your feature branch to squash or fix up any work-in-progress commits into a set of logical, self-contained commits.
- After review and approval, merge using "Merge Pull Request" and delete the feature branch.
Use fix/* branches for bug fixes discovered during the development cycle on the main, release/* or feat/* branches. For urgent fixes to production code, use the hotfix process instead.
The process is otherwise identical to feature development, but uses the fix/ prefix for branch names:
git checkout main # or release/vX.Y.Z
git pull
git checkout -b fix/<fix-name>-
Create a release branch from
main:git checkout main git pull git checkout -b release/<version>
Where
<version>follows semver format with a minor or major bump. -
Open a Pull Request on GitHub from the release branch into
stable. -
The release branch can have a dedicated deployment (UAT) once configuration is provided:
- Initially through manual preparation
- Eventually automated via CI
-
Tag commits with release candidates:
- Format:
<version>-rc.<num>(starting from rc.0) - Create initial rc.0 tag on branch creation
- Increment the rc number when a new release candidate is ready for testing
- Format:
-
For each release candidate:
- Publish packages (golang, npm, etc.)
- Redeploy the release branch
- Ideally automate these actions via CI
-
When the release is ready:
- Merge the PR into
stable - Tag HEAD of
stablewith the stable release version - Publish packages
- Update deployment
- Merge
stableback intomain(via PR or locally)
- Merge the PR into
Use hotfixes for urgent, production-impacting fixes that cannot wait for the next scheduled release; they patch stable directly to restore service or address critical defects.
Similar to release branches with key differences:
-
Create from
stablebranch:git checkout stable git pull git checkout -b hotfix/<version>
Where
<version>follows semver format with a patch bump. -
Open a Pull Request on GitHub from the hotfix branch into
stable. -
Important differences from release branches:
- No dedicated deployment
- No pre-release versions (no rc tags)
-
When the hotfix is ready:
- Merge the PR into
stable - Tag HEAD of
stablewith the stable version - Publish packages
- Update deployment
- Merge
stableback intomain(via PR or locally)
- Merge the PR into
After pushing the new tag and commits to the remote repository:
- Go to the GitHub Releases page.
- Click "Draft a new release".
- Select the new tag (
vX.Y.Z), set the release title, and paste the changelog section. - Publish the release.
We follow Semantic Versioning:
MAJOR.MINOR.PATCH
- MAJOR: incompatible API changes
- MINOR: backward-compatible features
- PATCH: backward-compatible bug fixes
Example: v1.3.2
Before finalizing a release:
- All features merged into release branch
- Tests passing
- Documentation updated
- Version bump committed
- CHANGELOG updated
- Release PR reviewed and approved
- All rc versions tested
- Git Flow: https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow
- Semantic Versioning: https://semver.org/