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.ymlis ref-aware. Its dispatch takes arefinput —mainby default, orrelease/vN(Na positive number of at most four digits, no leading zero).scripts/ci/release-line-ref.shvalidates it frommain'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 frommain(--ref main); the input picks the line. The automatic release (after a green heavy run) releasesmainonly, whatever the input says. The tip step checks the line out under its own name, trackingorigin, and release-it commitschore: release vN.x.yand its tag there —git describeand the changelog read the line's own history.- The guards are
main's. The step that validates therefinput copies the major hold and the latest predicate out ofmain'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 outmainfor it, so a line's own edit to either script judges nothing, and a predicate fix onmainreaches every line's next tag. Those two workflow files themselves run from the tag's tree: only therelease/*ruleset below keeps a line from editing the call. - The line never cuts a major.
scripts/ci/release-major-hold.shonrelease/vNreleasespatch,minor, a blank input (the recommended bump) or an explicitN.x.yabove the line's last release, and refusesmajor, 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 avN.x.y, and an automatic run. Onmainthe same hold refuses an older major's version (7.44.1oncev8.0.0is out) and names the line that ships it, when that line is one the ref input accepts (0.xhas none): release-it tags any valid version it is handed, and a strayv7tag onmainbecomes the base of every later bump there. - A maintenance release is not the latest.
scripts/ci/release-line-latest.shanswers 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 saysmake_latest: falseand appends no generated notes (GitHub would diff against the newest major), and_build-image.ymlpublishes the images without moving:latest. Before the major exists, a line release is the newest release and is the latest as usual. - Renovate reads
mainonly 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 onmaintoo. - The tap never walks back.
brew-update.ymltaps the newest tag at or above the formula's, so av7hotfix afterv8.0.0leaves the tap onv8.
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.
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:
"baseBranchPatterns": ["$default", "/^release\\/v[1-9][0-9]*$/"],as the last package rule, so no later rule re-enables a dependency on the line:
{
"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:
- on
main, as usual —mainkeeps every fix, and the next major ships it; - on
release/vN, as a pull request targeting the line (a cherry-pick of themaincommit,fix:subject, never a!), reviewed like any other.
Then release it:
gh workflow run version.yml --repo SocialGouv/iterion --ref main \
-f ref=release/v7 -f version=patchA 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.
