Skip to content
Like what we’re building? Star on GitHub

The release line — hotfixes while main is held for a major ​

Once the first breaking change (a ! commit such as feat!:) lands on main, the major hold refuses every patch and minor cut from main until an operator dispatches the exact N+1.0.0. Fixes that cannot wait for the major ship from a release/vN maintenance line instead (#3551). The line is dormant until an operator creates it: no release/* branch exists, and nothing changes main's releases.

What the workflows do with a line ​

  • version.yml is ref-aware. Its dispatch takes a ref input — main by default, or release/vN (N a positive number of at most four digits, no leading zero). scripts/ci/release-line-ref.sh validates it from main's tree before any git command reads it, and refuses anything else (a feature branch, a tag, refs/heads/…, a second line). The workflow itself is dispatched from main (--ref main); the input picks the line. The automatic release (after a green heavy run) releases main only, whatever the input says. The tip step checks the line out under its own name, tracking origin, and release-it commits chore: release vN.x.y and its tag there — git describe and the changelog read the line's own history.
  • The guards are main's. The step that validates the ref input copies the major hold and the latest predicate out of main's tree before the run moves to the line; the hold and latest steps run those copies. The tag workflows that read the predicate again — release.yml's release edit and _build-image.yml's :latest — check out main for it, so a line's own edit to either script judges nothing, and a predicate fix on main reaches every line's next tag. Those two workflow files themselves run from the tag's tree: only the release/* ruleset below keeps a line from editing the call.
  • The line never cuts a major.scripts/ci/release-major-hold.sh on release/vN releases patch, minor, a blank input (the recommended bump) or an explicit N.x.y above the line's last release, and refuses major, any other major's version, a version at or below the last release, a prerelease or a number past eight digits (its tag, or the next bump of it, would be a last release no later run can judge), a line whose commits recommend a major (a breaking commit on the line), a line whose last tag is not a vN.x.y, and an automatic run. On main the same hold refuses an older major's version (7.44.1 once v8.0.0 is out) and names the line that ships it, when that line is one the ref input accepts (0.x has none): release-it tags any valid version it is handed, and a stray v7 tag on main becomes the base of every later bump there.
  • A maintenance release is not the latest.scripts/ci/release-line-latest.sh answers one question for three readers: is this version below a stable tag (a higher major, or a higher minor or patch of its own major), or a prerelease? Then release-it creates the GitHub release with --github.makeLatest=false, release.yml's softprops edit says make_latest: false and appends no generated notes (GitHub would diff against the newest major), and _build-image.yml publishes the images without moving :latest. Before the major exists, a line release is the newest release and is the latest as usual.
  • Renovate reads main only until the line exists: its config is added when the line is created (below), because declaring a line pattern switches Renovate to multi-base mode on main too.
  • The tap never walks back. brew-update.yml taps the newest tag at or above the formula's, so a v7 hotfix after v8.0.0 leaves the tap on v8.

Creating the line — an operator gesture, at hold time ​

First, once, the repository settings — before any release/* branch exists, so no line is ever open to direct pushes: a release/* ruleset mirroring main's (pull request, required checks, no force push, no deletion) plus restrict creations, with the token-bureau App and the admins on the bypass list, so release-it can push its release commit and tag to the line as it does on main, and only an admin creates a line.

Then, when the first breaking change lands, create the line from the last main commit before it — every non-breaking commit merged until then belongs to the old major. That commit must carry this machinery (the scripts above): any main commit after #3551. The line's last tag must be that major's newest release: a line cut from an older tag releases below it, and its releases are then not the latest.

bash
git fetch origin main --tags
# FIRST_BANG = the sha of the first breaking commit on main
git push origin "${FIRST_BANG}^:refs/heads/release/v7"

Last, Renovate, in a pull request to main: declare the lines and keep them to security fixes. With two baseBranchPatterns, Renovate runs in multi-base mode — main's update branches become renovate/main-* and its PR titles end in (main). Add to renovate.json:

json
"baseBranchPatterns": ["$default", "/^release\\/v[1-9][0-9]*$/"],

as the last package rule, so no later rule re-enables a dependency on the line:

json
{
  "description": "A release/vN maintenance line takes security fixes only: vulnerabilityAlerts (applied after every package rule) re-enables the one update that fixes a known vulnerability.",
  "matchBaseBranches": ["/^release\\/v[1-9][0-9]*$/"],
  "matchPackageNames": ["*"],
  "enabled": false
}

and "enabled": true in vulnerabilityAlerts — the alert rule forces that object onto the update, and without the key it does not re-enable it. A matchBaseBranches rule without baseBranchPatterns is a configuration error, so the three land together. Record every gesture on #3551.

Landing a hotfix — the double-landing rule ​

A fix that must ship before the major lands twice:

  1. on main, as usual — main keeps every fix, and the next major ships it;
  2. on release/vN, as a pull request targeting the line (a cherry-pick of the main commit, fix: subject, never a !), reviewed like any other.

Then release it:

bash
gh workflow run version.yml --repo SocialGouv/iterion --ref main \
  -f ref=release/v7 -f version=patch

A fix landed only on the line is lost at the next major; a fix landed only on main waits for the major. The ci:train tool lands on main only — a line pull request merges on its own checks.

Retiring the line ​

The line lives as long as the old major is supported. Delete the branch (and keep its tags) once no deployment runs vN; the ruleset stays for the next line.