# Hotfix Process

Use a hotfix only for urgent production defects discovered after a release is deployed.
Non‑critical issues follow the standard feature → release promotion process.


# Overview

Hotfixes are for critical production issues that cannot wait for the next release.

  • Infra

    • Create a hotfix release branch.
    • Work alongside developer to test fix and update production.
    • Backfill the next release branch.
  • Developer

    • Create a hotfix branch from the latest release branch.
    • Resolve prod bug.
    • Validate fix locally.
    • Create a PR to the hotfix release branch that infra provides.

# Hotfix Workflow

# 1. (Dev) Checkout the latest release branch

Check your project release folder for any previous hotfixes. They are designated with a. (eg: release/2512.1). Replace the branch name below with your latest release.

# Checkout the latest release
git checkout release/2512
git pull

# 2. (Infra) Create a Hotfix release branch

Check your project release folder for any previous hotfixes. They are designated with a. (eg: release/2512.1). Replace the branch name below with your latest release. The example below means this is the first hotfix for this release.

# Checkout the latest release
git checkout release/2512
git pull

# Create a hotfix release branch and push it to ADO
git checkout -b release/2512.1
git push -u origin release/2512.1

# 3. (Dev) Create hotfix branch

Create a new branch using a descriptive name or ticket number.

git checkout -b fix/51160

# 4. (Dev) Make Changes, Commit, and Push

Implement the fix and commit your changes with a clear message.

git commit -m "fix: critical issue X resolved."
git push -u origin fix/51160

# 5. (Dev) Create a PR to Hotfix release branch

Create a pull request from your hotfix branch to release/2512.1.

  • This PR will ensure that the hotfix is associated with the appropriate release
  • It will also help the git history stay accurate
  • Include details about the critical issue and the fix applied

# 6. (Infra) Deploy to Target Environment for Testing

Create a PR from the hotfix release branch to the environment where you want to test this change:

  • preprod1 and pent should closely resemble prod1 for accurate testing
  • Test and verify the fix works as expected
  • Ensure no regressions are introduced

# 7. (Infra) Create a PR from hotfix release branch to prod1

Create a PR to prod1:

  • This PR will be subject to the policies set on the prod1 branch
  • Special approval may be required for hotfixes
  • Include justification for the emergency deployment

Once deployed, validate the fix thoroughly before proceeding.

# 8. (Infra) Backfill the next release branch

Ensure the hotfix is also applied to the next release branch. That will ensure the fix gets applied to the each environment naturally.

  • Update the current release branch
  • Document the hotfix in release notes

# Visual Workflow

flowchart TD
    Start([Critical Production Issue]) --> DevCheckout[Dev: Checkout latest release branch<br/>release/2512]
    Start --> InfraCheckout[Infra: Checkout latest release branch<br/>release/2512]
    
    DevCheckout --> DevCreate[Dev: Create hotfix branch<br/>fix/51160]
    InfraCheckout --> InfraCreate[Infra: Create hotfix release branch<br/>release/2512.1]
    
    DevCreate --> DevWork[Dev: Implement fix<br/>Commit & Push]
    DevWork --> DevPR[Dev: Create PR<br/>fix/51160 → release/2512.1]
    
    InfraCreate --> InfraWait[Infra: Wait for Dev PR]
    DevPR --> Merge[Merge PR to release/2512.1]
    InfraWait --> Merge
    
    Merge --> TestPR[Infra: Create PR to test environment<br/>release/2512.1 → preprod1/pent]
    TestPR --> Test[Test & Validate Fix]
    Test --> ProdPR[Infra: Create PR to prod1<br/>release/2512.1 → prod1]
    ProdPR --> Deploy[Deploy to Production]
    Deploy --> Validate[Validate Fix in Production]
    Validate --> Backfill[Backfill next release branch<br/>release/2512.1 → release/2601]
    Backfill --> Complete([Hotfix Complete])
    
    style Start fill:#ff6b6b
    style Complete fill:#51cf66
    style DevCheckout fill:#74c0fc
    style DevCreate fill:#74c0fc
    style DevWork fill:#74c0fc
    style DevPR fill:#74c0fc
    style InfraCheckout fill:#ffd43b
    style InfraCreate fill:#ffd43b
    style InfraWait fill:#ffd43b
    style TestPR fill:#ffd43b
    style ProdPR fill:#ffd43b
    style Backfill fill:#ffd43b
    style Merge fill:#845ef7
    style Test fill:#20c997
    style Deploy fill:#ff6b6b
    style Validate fill:#20c997

# Hotfix Best Practices

# Documentation

  • Document the critical issue and resolution
  • Update release notes with hotfix details
  • Include rollback procedures if needed

# Testing

  • Test thoroughly in preprod1 before production deployment
  • Verify the fix doesn't introduce new issues
  • Test rollback procedures if applicable

# Communication

  • Notify relevant teams about the hotfix
  • Update stakeholders on the resolution
  • Schedule follow-up review if needed

# Prevention

  • Conduct post-mortem analysis
  • Identify root causes
  • Implement preventive measures for future releases

# Emergency Procedures

In extreme cases where immediate production fixes are required:

  1. Direct Environment Branch Fixes: Critical bug fixes may be committed directly to environment branches (preprod1, pent, or prod1) as appropriate
  2. Backfill Requirement: These fixes must also be committed to the next active release branch to ensure future releases include all necessary patches
  3. Documentation: All emergency fixes must be properly documented and reviewed

# Hotfix vs Regular Fix

Type When to Use Process
Hotfix Critical production issues that cannot wait Emergency process with direct deployment
Regular Fix Non-critical issues or issues found during development Normal feature branch → release branch process