A critical production bug was fixed on the branch hotfix/critical-payment-gateway, which was created from the v2.3.0 release tag. The fix has just been deployed to production from that branch. The branch tip is the commit now running in production.
Requirements:
- The fix must be included in
mainso that the next release frommaincontains it. - Branch policies on
mainblock direct pushes, and all changes must reachmainthrough a reviewed pull request. - The hotfix branch will be deleted when its work is complete, but the team must be able to check out the exact deployed hotfix code later by its release version.
What should you do next?
Once the hotfix is live, two things must happen. First, record the deployed code with a release tag. Second, bring the fix back into main through a pull request. The tag lets the team reach the exact hotfix history after the branch is removed, and the pull request gets the fix into main while honouring the branch policies. Skipping the tag loses the named reference, skipping the merge leaves main without the fix, and a direct push breaks the pull-request-only rule.
- Not correct: Open a pull request from the hotfix branch to
main, and delete the branch without tagging it. Without a release tag, nothing names the deployed hotfix version once the branch is deleted. The source relies on the tag to keep referencing that history. - Correct: Tag the hotfix branch tip as
v2.3.1, then open a pull request from the hotfix branch tomain. The source tags the hotfix branch right after the production rollout and then raises a pull request to merge it back into main. The tag keeps the deployed history reachable after the branch is deleted, and the pull request respects the branch policies. - Not correct: Tag the hotfix branch tip as
v2.3.1, then delete the hotfix branch without merging it. The tag preserves the deployed code, but the fix never reaches main. The bug can recur in the next release frommainif that branch still lacks the fix. - Not correct: Tag the hotfix branch tip as
v2.3.1, then push the hotfix commit directly tomain. The branch policies onmainblock direct pushes and require a reviewed pull request.