Goals of this plan:
- Eliminate interruptions to an in-progress release
- Move towards a trunk based continuous delivery model (https://trunkbaseddevelopment.com/)
- Avoid disruption to engineers
prod
branch - the branch that is used for production releasesrelease
branch - Branches forked frommain
that are used for releases
- Checkout latest
main
- Create a new
release branch
in the formatrelease-v0.1.0
- Publish release branch with
git push -u origin release-v0.1.0
- Confirm with all contributors to the release that the release branch is ready
- Contributors can be found with
git rev-list v0.0.0..HEAD
wherev0.0.0
is the previous release - Fixes can be cherry picked from
main
into the release branch during this time
- Contributors can be found with
- Open a PR in GitHub from
release-v0.1.0
toprod
- Once merged, create a release in Github targeting
prod
with a new tag in the formatv0.1.0
. - Delete the release branch
- Create a hotfix branch in the format
hotfix-v0.1.1
from the tip ofprod
- Cherry-pick the fix commit from
main
into thehotfix-v0.1.1
branch - Open a PR in GitHub from
hotfix-v0.1.1
toprod
- Once merged, create a release in Github targeting
prod
with a new tag in the formatv0.1.1
.
main
is the source of truth for the codebase- Release branches and hotfix branches are never merged into main
- Any changes to a
release
orhotfix
branch must be done by cherry-picking commits frommain
.- This means you can not push changes to
release
orhotfix
branches directly.
- This means you can not push changes to
main
should be considered to as stable. Do not push changes tomain
that are not ready to be inprod
.- If a feature isn't ready for release, consider putting it behind a feature flag.
- Task branches should be small and committed frequently.
- Merges into
prod
should not be squash merges. This ensures we can determine contributors since the last release. Merges intomain
can still be squashed.