Problem: We need to fix a production bug, but the development branch...
Problem: We need to fix a production bug, but the development branch contains work that isn’t ready for prod.
Solution: Only merge code to that can be immediately deployed. Use feature flags to hide incomplete work.
Keep the development branch production worthy.
“Why not just hot fix main?”
That can work, but ad-hoc fixes add risk and complexity.
🚩 Where do we test the hot fix?
🚩 What if we forget to merge the fix into our non-prod branches?
🚩 What about testing the fix against other code that’s about to be deployed?
Etc.
Oh, and my initial tweet assumes we're deploying often (multiple times/day).
If we rarely deploy, then unfortunately a hotfix approach is our only option.
If we deploy multiple times a day, I don't need a "hotfix" to resolve a prod issue. I just deploy.