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
mainkeep building but don't deploy to staging, and no newer commit ofmaincan 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
- 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. - "ci: web app to staging" deploys it. Check the fix on
https://app.qubital-test.com. - Release a patch version, such as
6.0.3over6.0.2: Release the Web and Desktop Apps.
An emergency hotfix
-
Merge the fix to
mainfirst, through a pull request. Nothing checks this, but the next release frommainwould otherwise drop the fix. -
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.0over a live6.0.2, the hotfix takes6.1.1. That waiting draft can then never be published, because publish takes only the highest candidate: delete it, and build a new candidate frommainlater. -
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 onmain:git fetch origin --tagsgit switch -c hotfix/6.1.1 v6.0.2git cherry-pick 0123456789abcdef0123456789abcdef01234567git push -u origin hotfix/6.1.1The branch name must start with
hotfix/. The release refuses a hotfix commit that doesn't contain the highest release tag, or whose history meetsmain's anywhere outside that tag's history, as when the branch was cut frommainormainwas merged into it. -
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:
Field Value Use workflow from mainref ("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.
-
Check the fix on
https://app.qubital-test.com. -
Release it: Release the Web and Desktop Apps, from the candidate dry run on, with:
Field Value version ("candidate: the version, X.Y.Z…") 6.1.1commit ("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 candidateThe release script checks that the commit is on a
hotfix/*branch cut from the highest release tag, and that staging ran it. -
End the hold, once the hotfix is published or abandoned:
-
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 -
If the hotfix was abandoned, delete its draft release too.
-
Actions → "ci: web app to staging" → Run workflow:
Field Value Use workflow from mainref ("The branch to deploy to staging…") mainThis builds and deploys
main's newest commit and ends the hold. Reverting the hotfix's deploy inqubital-infradoesn't end it.
-
Verification
- The release
v6.1.1is 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.