Skip to content

ci: Support maintenance branches per major with Changesets - #277

Merged
coremedia-ci merged 6 commits into
mainfrom
venus/align-workflows-maintenance
Nov 16, 2026
Merged

coremedia-ci merged 6 commits into
mainfrom
venus/align-workflows-maintenance

Conversation

@jens-meisner

Copy link
Copy Markdown
Contributor

No description provided.

jens-meisner and others added 5 commits November 13, 2026 10:38
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>
@pkliesch

Copy link
Copy Markdown
Contributor

Suggestions (most important first)

  • Nothing can be maintained until a Changesets release ships. The newest tag is 28.1.1, from the old release process. The workflow requires the tag to contain create-maintenance-branch.yml. If main's next release is already 29.0.0, major 28 can never be maintained through the workflow.

    • Plan for at least one 28.x release after this PR merges.

    • Or document the manual procedure the error message points to ("cut the branch manually"). DEVELOPMENT.md doesn't describe it: which workflow files to bring over, setting baseBranch, and the .changeset setup.

  • Pending changesets on main are quietly left out. Cutting maintenance/30 while main is on 30.x is blocked only when main's version is unreleased. Changes merged with patch/minor changesets but not yet versioned aren't in the tag. They end up only in the next major.

    • Suggestion: when MAIN_MAJOR == MAJOR and main has pending changesets, list them in the Summary (warning or error).
  • main finds out too late. After the branch is cut, patch/minor PRs still pass and merge into main. The failure only shows up on the "Version Packages" PR or the release.

    • Suggestion: when maintenance/$MAJOR exists and the pending changesets include no major, emit a ::warning:: in the PR check.
    • Don't make it an error: the PR that adds the major changeset has to pass.
  • The new script isn't tested by CI yet. major-changesets.mjs only runs when a maintenance branch exists or the check runs on one. On main today, the version is tagged and the check exits before calling it.

    • It depends on resolving a transitive dependency, @changesets/read, through @changesets/cli. This works with cli ^3.0.3 (read v1 has the named export readChangesets, and exports is a plain string), but it's fragile across upgrades.
    • Suggestion: run it once locally with a dummy major changeset before merging. Optionally switch to changeset status --output (public JSON).
  • Every release line gets an identical "Version Packages" PR title. Pass title (and commit) to changesets/action, e.g. "Version Packages (maintenance/30)", so the PRs are easy to tell apart.

  • Workflow fixes don't reach maintenance branches. Each branch keeps the CI files from its tag, so later fixes on main must be cherry-picked. A note in the Maintenance Branches section of DEVELOPMENT.md would help, next to the existing Dependabot hint.

Behavior changes to confirm are intended

  • In pull-request.yml, manual runs now skip the changeset check (before, they compared against origin/main).
  • PRs into a feature branch (stacked PRs) are now compared against their own base, so each one needs its own changeset.
  • Snapshots from maintenance/ share the snapshot dist-tag while main is still on major N. That's as documented, and harmless, since every branch already overwrites snapshot.

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.
@coremedia-ci
coremedia-ci merged commit b24a07e into main Nov 16, 2026
9 checks passed
@coremedia-ci
coremedia-ci deleted the venus/align-workflows-maintenance branch November 16, 2026 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants