Repository navigation
ci: Support maintenance branches per major with Changesets - #277
Conversation
Add maintenance/<major> branches as release lines of their own, so an older major can still receive patch and minor releases while main moves on (see VERSIONING.md). Each branch has its own changesets, "Version Packages" pull request, QA gate queue and releases. - create-maintenance-branch.yml (manual, input: major): creates maintenance/<major> from the newest release of that major, sets the Changesets base branch and drops pending changesets. It rejects existing branches, majors above main's, and releases made with the old release process. - qa-gate.yml, create-or-update-release-pr.yml and release-and-publish.yml also run for maintenance/*. They work on the pull request's base branch or the pushed branch instead of a hard-coded main, with one QA gate queue per branch. - Maintenance releases use the npm dist-tag maintenance-<major>, so latest stays on main. Their GitHub release is not marked as latest, and the documentation is only deployed from main. - snapshot.yml: snapshots of an older major than main use the dist-tag snapshot-maintenance-<major>. - pull-request.yml compares against the pull request's base branch; manual runs skip the changeset check. - checks action: on maintenance/<major>, reject major changesets and a package version of another major. On main, reject an unreleased version whose major already has a maintenance branch, so main and a maintenance branch never release the same major. This allows creating maintenance/<major> while main is still on that major, e.g. right before breaking changes. The legacy maintenance/23.0, 24.0 and 25.0 branches are unaffected: they only run their own workflow files. Document maintenance branches with an example in DEVELOPMENT.md. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The main release line check rejected every pull request into main while main held an unreleased version whose major already had a maintenance branch. Besides the "Version Packages" pull request, this also happens after a failed release. The pull request adding the required major changeset then failed the same check, so main could not be fixed without bypassing the ruleset. - checks action: on main, accept an unreleased version whose major has a maintenance branch if a major changeset is pending, because the next release is then major. - create-maintenance-branch.yml: when main is still on the requested major, require main's version to be released. Otherwise the branch would be cut from an older release, leaving the unreleased changes behind. - Move the detection of major changesets into .github/scripts/major-changesets.sh, used by both release line checks. It no longer pipes into "grep -q", so awk cannot fail on a closed pipe under pipefail. Document the precondition in DEVELOPMENT.md. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The release line checks found major changesets with a regular
expression on the frontmatter, which missed valid YAML such as a
trailing comment ("major # breaking"). Such a changeset passed the
maintenance check and only failed on the "Version Packages" pull
request.
- scripts/major-changesets.mjs reads the pending changesets with
@changesets/read, like "changeset version" does, and replaces
.github/scripts/major-changesets.sh. An unparsable changeset now
fails the check.
- snapshot.yml: correct the comment on dist-tags. "snapshot" is shared
by all snapshots of main's major, so it is not reserved for main.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- checks action: on a maintenance branch, a package version of another major now reports the version and its likely causes (a major bump or a change based on another major) instead of the branch naming scheme. - create-maintenance-branch.yml: no longer drops pending changesets. A release tag never has any, since releases only happen without them. - release-and-publish.yml: skip the release when the version is already tagged. Creating a maintenance branch no longer runs a full build and all checks just to publish nothing. - DEVELOPMENT.md: a maintenance branch can only be created from a release that contains the Create Maintenance Branch workflow. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Suggestions (most important first)
Behavior changes to confirm are intended
|
After maintenance/<major> was cut from main's current major, pull requests with patch or minor changesets still passed on main. The problem only showed on the "Version Packages" pull request or the release. Changes merged into main but not yet released were silently left out of the new branch. - checks action: on main, warn when maintenance/<major> exists, the version is released and no major changeset is pending. The step still passes, so the pull request adding the major changeset can be integrated. An unreleased version still fails. The major changeset check now also runs in CI on main. - create-maintenance-branch.yml: when main is still on the requested major, list main's unreleased changesets as a warning and in the summary, so they can be cherry-picked. Changesets without package bumps are ignored. - create-or-update-release-pr.yml: title and commit message name the release line, e.g. "Version Packages (maintenance/30)". - scripts/major-changesets.mjs: import @changesets/read as a direct dev dependency instead of resolving it through @changesets/cli. - DEVELOPMENT.md: workflow fixes on main do not reach maintenance branches, unreleased changes on main are not part of a new branch, and major 28 becomes maintainable with its first Changesets release.
No description provided.