Skip to content

feat(create-release-branch): add Changesets mode - #170

Draft
GuillaumeRx wants to merge 1 commit into
gr/crb-cs-05-applyfrom
gr/crb-cs-06-mode
Draft

GuillaumeRx wants to merge 1 commit into
gr/crb-cs-05-applyfrom
gr/crb-cs-06-mode

Conversation

@GuillaumeRx

@GuillaumeRx GuillaumeRx commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Explanation

Adds Changesets mode to create-release-branch. It connects the load, candidates, plan, and apply steps from the earlier PRs.

  • Choosing the mode. Use the --changesets flag, or set "mode": "changesets" in release.config.json. --interactive is not supported yet. It fails before it changes anything.

  • createChangesetsMode implements Mode. Its prepare step checks that the .changeset directory has no uncommitted changes. The core runs this step before the "Initialize Release" commit, so that this commit does not take in a Changeset by mistake. The mode reads the Changesets again each time it lists the candidates, so it sees changes that the user makes while the editor is open. plan reuses what the last listCandidates call read, because the core calls them one after the other.

  • Release spec template. Each package gets the version specifier that the Changesets give and a short comment. The instructions say not to change the value:

    packages:
      "@scope/a": major # 1.4.0 -> 2.0.0, 3 changesets
      "@scope/c": patch # 1.4.0 -> 1.4.1
  • Tests. New functional tests run the tool on a Changesets monorepo with the real @metamask/changesets-changelog. They cover a full release, a partial release, a changed version that stops the tool, Unreleased entries that stop the tool, an uncommitted Changeset that stops the tool before the first commit, a committed Changeset without a pull request number, the config file, a failed apply, the legacy fallback, and --interactive.

  • Docs. docs/setup.md has a new "Changesets mode" section. It says that the tool does not release Unreleased entries, and stops if a released package has them. It also says that an entry has no link if the commit of its Changeset has no pull request number.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

@GuillaumeRx
GuillaumeRx added this pull request to stack #171 November 12, 2026 14:07
@GuillaumeRx
GuillaumeRx force-pushed the gr/crb-cs-06-mode branch 2 times, most recently from 3e9a3f2 to 847ec33 Compare November 12, 2026 16:11
@GuillaumeRx
GuillaumeRx force-pushed the gr/crb-cs-06-mode branch 2 times, most recently from 1d90303 to 5061364 Compare November 12, 2026 17:33
Select the mode with --changesets or with "mode": "changesets" in
release.config.json. The release spec lists the packages of the pending
Changesets with the version specifiers that the Changesets give. The
maintainer can leave packages out, but cannot change their versions.

Before the Initialize Release commit, the mode checks that the .changeset
directory has no uncommitted changes, so that this commit does not take
in a Changeset by mistake.

The functional tests load the real @metamask/changesets-changelog module
from its source.
@Mrtenz

Mrtenz commented Nov 13, 2026

Copy link
Copy Markdown
Member

@metamaskbot publish-preview

Hijacking your PR to test preview builds with OIDC.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants