In the event that a hotfix needs to be pushed to production ahead of the work currently in develop, these are the steps to follow:
- Notify the rest of the team that a hotfix is needed
- Create a hotfix branch directly off of
main
- Apply the fix and create a PR with
main
as the target branch - Merge the fix to the
main
branch - Deploy the latest
main
to thetest
environment - Test the fix in the
test
environment. Make sure to create any data needed to ensure the issue will be fixed inprod
- Deploy the hotfix to
prod
- Notify the client that the fix has been applied and ask for confirmation that the issue is resolved in
prod
- Disable the
Require pull request before merging
protection on thedevelop
branch in github - Take a screenshot of all the status checks that run on the develop branch then disable the
Require status checks
protection on thedevelop
branch in github. Since we will not be merging a PR, there will be no status checks. - Enable
Allow Force Pushes
in the branch protections for thedevelop
branch in github as the rebase is going to require a force push to the origin. - Ensure your local
develop
is up to date and then rebasedevelop
onmain
without a PR (git rebase main
when on thedevelop
branch) & push - Re-enable the
Require pull request before merging
&Require status checks
protections on thedevelop
branch in github. You will have to manually add all the status checks back. Refer to your screenshot to ensure all the required checks are set. - Disable
Allow Force Pushes
in the branch protections. - Notify the rest of the dev team that the hotfix is finished & remind them that their in-progress PRs will need rebasing on
develop
- Write a postmortem on the issue if deemed necessary (ie: the problem caused downtime, data loss / leak or other significant issues worth documenting)