Skip to main content

Hotfix the Web and Desktop Apps

Symptoms​

A bug in the prod web app or the desktop app must be fixed before the next planned release.

Impact​

  • A normal hotfix is an ordinary release: the same impact as Release the Web and Desktop Apps.
  • An emergency hotfix holds staging: from its staging deploy until the hold ends, merges to main keep building but don't deploy to staging, and no newer commit of main can be released.

Which one: a normal hotfix whenever main can be released now, because everything merged since the last release is ready or behind a release flag. An emergency hotfix only when main can be neither released nor quickly made releasable with a revert.

Steps​

A normal hotfix​

  1. Fix it on main: a pull request, reviewed and merged as usual. If the fix touches unfinished work, keep that work behind a release flag.
  2. "ci: web app to staging" deploys it. Check the fix on https://app.qubital-test.com.
  3. Release a patch version, such as 6.0.3 over 6.0.2: Release the Web and Desktop Apps.

An emergency hotfix​

  1. Merge the fix to main first, through a pull request. Nothing checks this, but the next release from main would otherwise drop the fix.

  2. Pick the version: the next free one, above every release tag, every GitHub release (drafts included) and both feeds. If a candidate is waiting, say 6.1.0 over a live 6.0.2, the hotfix takes 6.1.1. That waiting draft can then never be published, because publish takes only the highest candidate: delete it, and build a new candidate from main later.

  3. Cut the branch from the highest release tag, and cherry-pick the fix onto it. In a clone of qubital-apps, with the versions and the fix's commit on main:

    git fetch origin --tags
    git switch -c hotfix/6.1.1 v6.0.2
    git cherry-pick 0123456789abcdef0123456789abcdef01234567
    git push -u origin hotfix/6.1.1

    The branch name must start with hotfix/. The release refuses a hotfix commit that doesn't contain the highest release tag, or whose history meets main's anywhere outside that tag's history, as when the branch was cut from main or main was merged into it.

  4. Deploy it to staging. Actions → "ci: web app to staging" → Run workflow. GitHub shows each field by its description, not its name; the table gives the name, then the opening words of its label:

    FieldValue
    Use workflow frommain
    ref ("The branch to deploy to staging…")hotfix/6.1.1
    • Watch that the run isn't cancelled: a merge's run that queues behind it replaces it. If it was, start it again.
    • When it is green, the deploy job's step "Decide whether this run deploys" says the commit is the head of hotfix/6.1.1: it deploys.
    • Staging is now held: every merge's run says so in a warning and deploys nothing.
    • If you push another commit to the branch, run this step again: only the branch's head deploys, and the release needs the exact commit staging ran.
  5. Check the fix on https://app.qubital-test.com.

  6. Release it: Release the Web and Desktop Apps, from the candidate dry run on, with:

    FieldValue
    version ("candidate: the version, X.Y.Z…")6.1.1
    commit ("candidate only: the full 40-character SHA…")the full 40-character SHA of the head of hotfix/6.1.1, in the dry run and in the candidate

    The release script checks that the commit is on a hotfix/* branch cut from the highest release tag, and that staging ran it.

  7. End the hold, once the hotfix is published or abandoned:

    1. Delete the branch, so a re-run of its old staging run can never put it back. The release tag keeps the published commit.

      git push origin --delete hotfix/6.1.1
    2. If the hotfix was abandoned, delete its draft release too.

    3. Actions → "ci: web app to staging" → Run workflow:

      FieldValue
      Use workflow frommain
      ref ("The branch to deploy to staging…")main

      This builds and deploys main's newest commit and ends the hold. Reverting the hotfix's deploy in qubital-infra doesn't end it.

Verification​

  • The release v6.1.1 is published, and the checks of Release the Web and Desktop Apps pass.
  • After the hold: the hand-started run is green, and the next merge's run deploys without a "staging is held" warning.

Escalation​

The team owner.