Skip to main content

Releasing a hot fix

If a change needs to be applied in production, while the main branch has already received new commits that are not production ready, we need to 'hot fix' production:

  • Create a release branch from the current production tag, git checkout -b release-1.42 v1.42.1.

  • Apply changes to this branch by cherry-picking the commits you want to be included: git cherry-pick <commit-sha>

  • Push the branch to the repo, this will trigger a build in Cloud Build

warning

Important: the branch with the hotfix must be prefixed with release-, or the corresponding image will not be built

  • When the build is done, create a new release tag, in this example v1.42.2, on the release branch (this will trigger the release after approval)

info

You can reuse the same release branch for multiple hotfixes, hence the -major.minor naming.

  • Once the release has been approved by one of the approvers (see here), it will be deployed to production.