Interview Prep/DevOps Fundamentals/Branching, versioning & releases

What is a hotfix, and how do you release one safely?

BeginnerConceptBranching, versioning & releases
Answer

In one line: A hotfix is an urgent fix for a serious production problem that can't wait for the normal release; you release it quickly but still through the pipeline, with tests and review, not by editing production by hand.

A safe hotfix process:

  1. Stabilise first — if possible, roll back or turn off the feature flag to stop the impact immediately. Then fix calmly.
  2. Branch from what's in production:
    • Trunk-based / GitHub Flow: fix on a short branch from main (if main is deployable).
    • Release branches / GitFlow: branch hotfix/1.4.1 from the production tag v1.4.0.
  3. Make the smallest possible change — only the fix, no extra features or refactors.
  4. Add a test that reproduces the bug, so it can't come back.
  5. Fast-track review — still get at least one reviewer, even at 2 a.m.
  6. Run the pipeline — build, tests and scans. Maybe a shortened path, but never skip it entirely.
  7. Deploy carefully — canary or staged rollout if possible; watch dashboards closely.
  8. Merge the fix back into main/develop so the next release doesn't bring the bug back.
  9. Tag and version — for example v1.4.1.
  10. Post-mortem — why did the bug reach production, and what will catch it next time?

Why not just fix it directly on the server?

  • The next deployment would overwrite the fix.
  • No review or test — you might make things worse.
  • No record of what changed, which breaks audits and confuses the next person.

Example: checkout fails for customers with a coupon. The team disables the coupon feature flag (impact stops in 1 minute), writes a fix with a test, gets a quick review, deploys v3.2.1 via the pipeline with a canary, and confirms the error rate is normal.

Tip for interviews: stress "mitigate first, fix through the pipeline, merge back, learn".

All DevOps Fundamentals questions

More on Branching, versioning & releases