Git Branching and Release Strategy
Branch | Purpose | Branch from | Naming |
---|---|---|---|
hotfix | Hotfix branches are for critical issues that need to get into Mainnet immediately. | release | hotfix/<bug #>- (e.g., "hotfix/BD-1888-set-fee-ratio") |
release | Release branches are stable branches that are currently released, or have been previously released to Mainnet. The tip of this branch should be always in the production-ready state for that particular release. I.e., you should always be able to hotfix to a release branch. Release branches are created for every major and minor release. | master | release/v1.1.x |
master | The master branch should always reflect what is on Mainnet. | release | |
develop | The develop branch serves as an integration branch for features/epics. | master | |
bug | Bug branches | develop, feature | bug/bug#-description (e.g., bug/BD-1841-wallet-requests ) |
feature/epic | A feature (or epic) branch is the main unit of work. Features are developed in separate branches, promoted to testing, and then promoted to master in a continuous cycle. | develop | feature/devname(optional)-epic#-fip#-epicname> (e.g., “feature/eric-BD-1580-fip6-lock-tokens”) |
Feature development
- Create feature branch off of develop (e.g., feature/1580-fip6-lock-tokens)
- Frequently rebase feature branch with latest from develop. This will grab the latest code and reattach the feature branch to the new root of develop.
- Complete development of feature, SDK updates (if applicable), and javascript tests.
- Run fio.test against local branch
- Create draft PR
- Send to QA
- QA will expand javascript tests and open bugs
- Fix bugs and update PR
- Once it passes QA, install on DEV server and send to UAT
- Once it passes UAT it will be sent to Ready to Deploy
- Once a release target for feature has been identified:
- Rebase feature branch from target and build locally
- Re-run javascript tests on local build
- Move PR from draft to review
- Merge:
- Feature branch into target branch
- Merge SDK updates (if applicable)
- Merge fio.test updates
- Build target branch on DEV server and re-run JS tests
Feature releases (major/minor releases)
- The develop branch is the release candidate branch and and is used for release testing
- Merge all features and bugs into develop
- Rebase develop from master
- Create draft PR to master
- Install develop on DEV server
- Run fio.test system tests
- Create pre-release RC tag off of the head commit from develop
- Tag: v1.1.0-rc1
- Title: Release Candidate - FIO v1.1.0-rc1
- Send release to Testnet
- If issues are found, fix bugs off of develop branch as necessary and repeat steps with rc2, rc3, etc.
- Complete Testnet testing
- Move PR from draft to review
- Merge develop into master
- Create release branch (e.g., release/v1.1.x)
- Install release branch on DEV server
- Run JS tests
- Create release from master
- Tag: v1.1.0
- Title: Release - FIO v1.1.0
- Send release to Mainnet
Hotfix/patch releases
- Hotfixes branches are used to patch Mainnet.
- Compare latest release branch (e.g., release/v1.1.x) with master. If there are differences, we have done something wrong.
- Create hotfix branch off of release branch
- Complete development and javascript tests for hotfix
- Create PR and merge into release branch
- Install release branch on DEV server and through QA/UAT cycle. Update release branch as necessary.
- Create pre-release RC tag off of the head commit from release branch
- Tag: v1.1.1-rc1
- Title: Release Candidate - FIO v1.1.1-rc1
- Send release to Testnet
- If issues are found, fix bugs off of release branch as necessary and repeat steps with rc2, rc3, etc.
- Complete Testnet testing
- Merge release branch into master
- Create release from master:
- Tag: v1.1.1
- Title: Release - FIO v1.1.1
- Send release to Mainnet.
Archiving branches
When you want to keep the commit history of a branch that is old or that has been deprioritized, archive the branch as a tag and then remove the branch. Git tags aren’t too different from branches. They are a point-in-time backup of a repository at a specific commit level or in the case of this workflow a specific branch.