How to cut a patch onto the current production line (for example 1.7.0 → 1.7.1) without taking dev HEAD.
A hotfix uses the same merge, tag, and back-merge pipeline as a full release. Follow release.md for those shared steps. This document covers only what is different.
Production needs a fix that must not wait for the next dev cut, and must not ship unrelated work already on dev.
v1.7.0 (master) ── release-1.7.1 (cherry-picks) ── merge commit ──► master
▲ │
commits from `dev` ├── git tag v1.7.1
or a hotfix branch └── back-merge ──► `dev`
Do not rebase the hotfix onto dev. That would pull in dev HEAD, which is the situation a hotfix is avoiding.
Once the social v1 release has migrated its first user, this is the only path for a defect in it: there is no rollback
(v1 writes are invisible to a 0.x client and Nexus has flipped epochs), and a hotfix that skips, disables or weakens
the migration gate is never acceptable, since an un-migrated account must not run the 1.x app
(docs/migrations/social-v1.md, ADR-0026).
Substitute 1.7.1 / v1.7.1 with the patch being released.
Start from the production tag (or master, if that is still the previous release), not from dev:
git fetch origin
git checkout -b release-1.7.1 v1.7.0
git push -u origin release-1.7.1Same release-<semver> naming as a full release.
Pick one or more commits from dev, or from a hotfix branch:
git cherry-pick -x <commit>
git push origin release-1.7.1Repeat for each commit, or pass a range (<oldest>^..<newest>). -x records the original SHA.
If the fix is not on dev yet, develop it on a branch based on the previous release (this candidate can be that branch), then continue from here. If a cherry-pick from dev does not apply cleanly, the commit likely depends on unreleased dev work — take a version of the fix that was based on the previous release instead.
You can still cherry-pick further commits onto release-1.7.1 during the candidate window. Do not rebase onto dev. Freeze the branch before the version bump.
From here, follow release.md:
- Open a draft PR into
master(release-1.7.1→master). - Make the pipelines green. The latest
devVRT and e2e run is not enough: it includes unreleaseddevwork. Trigger VRT and e2e on this candidate, or confirm they pass for this set of commits. - Bump
package.jsonversionto the patch (for example1.7.1), then merge with a merge commit. Never squash, never rebase-and-merge. - Tag
masterasv1.7.1and push. That publishes the image as in What the tag publishes. Then publish the GitHub Release from the tag, as in that step. - Back-merge
masterintodev.
The back-merge diff depends on where the fix came from:
- Cherry-picks that already live on
dev: the only file change should be the version bump (same as a full release). - Commits that existed only on a hotfix branch: those changes and the version bump. That is how
devreceives the fix.
- Branched from the previous release tag (or
master), not fromdevHEAD - Fix cherry-picked from
devor a hotfix branch (-x) - Draft PR opened:
release-<patch>→master - PR checks green (tests, build, code quality)
- VRT and e2e green for this candidate (do not rely on the latest
devrun) -
package.json(andpackage-lock.json) bumped to the patch version and pushed - PR marked ready; merged with Create a merge commit (not squash, not rebase-and-merge)
- Annotated tag
v<patch>created onmasterand pushed - Docker Hub image build for the tag succeeded
- GitHub Release
v<patch>published from the tag with generated notes - PR
master→devopened and merged with a merge commit - Hotfix / release branch deleted