fix(changeset-preview): match get-release-plan to the repo's changesets major #423
main fromrefs/pull/423/head·opened 🎯 Changes#
The Changeset Version Preview comment shows major bumps for minor changesets on repos that have moved to changesets v3. For example, on TanStack/query#12059 it shows @tanstack/react-query 5.104.3 → 6.0.0, while changeset-bot and the real release give a minor (5.105.0).
Cause#
The action always used @changesets/get-release-plan@^4, which is built on the changesets v2 libraries (@changesets/config@^3, @changesets/assemble-release-plan@^6). In v2, a minor bump makes every package that lists it in peerDependencies go major, unless the config sets ___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH.onlyUpdatePeerDependentsWhenOutOfRange. TanStack/query removed that option when it moved to changesets v3 (TanStack/query#11583), because v3 doesn't need it. Its fixed group then takes every package to 6.0.0.
Results with a single '@tanstack/react-query': minor changeset on TanStack/query:
| Tool | @tanstack/react-query | lit-query / svelte-query |
|---|---|---|
pnpm exec changeset status (@changesets/cli 3.0.3) | 5.104.1 → 5.105.0 minor | patch |
@changesets/get-release-plan@4.0.16 (current action) | 5.104.1 → 6.0.0 major | 1.0.0 / 7.0.0 major |
@changesets/get-release-plan@4.0.16 + the experimental option put back in the config | 5.104.1 → 5.105.0 minor | patch |
@changesets/get-release-plan@5.0.2 | 5.104.1 → 5.105.0 minor | patch |
Fix#
A plain bump to v5 would break repos that still use changesets v2. Of the 12 repos using this action, 5 are on @changesets/cli@^2:
| changesets v3 | changesets v2 |
|---|---|
| form, hotkeys, pacer, query, store, table, template | devtools, persist, router, virtual, workflow |
So the action now installs both majors under npm aliases (get-release-plan-v4, get-release-plan-v5). It resolves @changesets/cli/package.json from GITHUB_WORKSPACE and uses the matching get-release-plan (cli v2 → v4, cli v3 → v5). If the CLI can't be found or its major isn't known, it falls back to v5 with a warning. Every user runs Setup Tools, which installs the repo's dependencies, before this action, so the CLI can be found.
I also tried loading get-release-plan from the repo's own node_modules, so the preview could never drift from the release tool. That doesn't work for v3, because @changesets/cli@3 no longer depends on @changesets/get-release-plan.
v5 has no API changes that affect this script: the default export is still the function, and ReleasePlan.releases[] has the same shape. v5 is ESM-only and needs Node ^22.11 || ^24 || >=26.
Testing#
Ran GITHUB_WORKSPACE=… node preview-changeset-versions.mjs against fresh, installed clones:
- TanStack/query (cli 3.0.3 → v5) with
'@tanstack/react-query': minor: the fixed group shows 5.104.3 → 5.105.0 minor; lit/svelte/vue-query-devtools show patch. There are no major bumps, and the result matchespnpm exec changeset statuspackage for package. - TanStack/router (cli 2.30.0 → v4) with
'@tanstack/router-core': minor:router-coreshows minor and the rest show patch. This matcheschangeset status("NO packages to be bumped at major"). - Workspace without
@changesets/cli: warns and falls back to v5.
Follow-up#
After this merges, the repos need to bump their pinned TanStack/config/.github/changeset-preview@<sha> to pick up the fix. TanStack/query pins e4b48f16568324f76f467aa4c2aac2f05db632c3 in .github/workflows/pr.yml (job version-preview).
✅ Checklist#
- I have followed the steps in the Contributing guide.
- I have tested this code locally with
pnpm test:pr. (This changes only a GitHub Action, whichtest:prdoesn't cover. I tested it manually as described above.)
🚀 Release Impact#
- This change affects published code, and I have generated a changeset.
- This change is docs/CI/dev-only (no release).
🤖 Generated with Claude Code
Summary by CodeRabbit#
- Chores
- Updated release preview tooling to work with supported versions of the Changesets CLI by selecting compatible release-plan support. When the CLI version cannot be detected or is unsupported, the tooling uses its default compatibility option. This helps keep release previews available across different workspace configurations without changing the preview experience.
- 1
View your CI Pipeline Execution ↗ for commit 953251352edd5e2edb3f7582434d275dec6f9be1
Command Status Duration Result nx affected --targets=test:sherif,test:docs,tes...✅ Succeeded <1s View ↗ nx run-many --target=build✅ Succeeded <1s View ↗
☁️ Nx Cloud last updated this comment at
2026-10-17 17:13:50UTCNo actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
bfdf4d2f-812d-436c-93ca-5aea557f4d7d
📥 Commits
-
Reviewing files that changed from the base of the PR and between d9fd42a408846961031f58b9203c5f9efc3ec954 and 953251352edd5e2edb3f7582434d275dec6f9be1.
📒 Files selected for processing: 2
-
.github/changeset-preview/package.json.github/changeset-preview/preview-changeset-versions.mjs
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.
-
📝 Walkthrough
-
The preview script now detects the workspace Changesets CLI major version and dynamically loads the corresponding release-plan package. The package manifest adds aliases for release-plan versions 4 and 5.
Changes: Changeset release-plan selection
Layer / File(s) Summary Resolve the matching release-plan package
.github/changeset-preview/package.json,.github/changeset-preview/preview-changeset-versions.mjsThe package manifest adds aliases for release-plan versions 4 and 5. The script selects version 4 for CLI v2 and version 5 for CLI v3. If detection fails or finds an unsupported major, the script warns and uses the v3 mapping. mainawaits the loader before requesting the release plan.Priority: ➖ Normal
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers:
alemtuzlak,lachlancollins
Merge Risk: ⚪ Minimal · up to
95325-
The action reports a failed package load, and its installation workflow supports the new aliases. No issue identified here needs to delay merging.
Pre-merge checks:
4 · 1-
Failed checks: 1 warningCheck name Status Explanation Resolution Docstring Coverage Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 1 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold. Passed checks: 4 passed-
Check name Status Explanation Title check The title clearly and concisely describes the main change: selecting the compatible get-release-plan version for the repository's Changesets major. Description check The description is complete and follows the repository template. It explains the problem, cause, fix, testing, release impact, and follow-up work. It also explains why pnpm test:pr was not run. Linked Issues check Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 1 files. (1 skipped: 1 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
- Fix all pre-merge checks with AI
✨ Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment `@coderabbitai help` to get the list of available commands.-
npm i https://pkg.pr.new/@tanstack/eslint-config@423npm i https://pkg.pr.new/@tanstack/publish-config@423npm i https://pkg.pr.new/@tanstack/typedoc-config@423npm i https://pkg.pr.new/@tanstack/vite-config@423commit:
9532513Review the following changes in direct dependencies. Learn more about Socket for GitHub.
Diff Package Supply Chain
SecurityVulnerability Quality Maintenance License @changesets/get-release-plan@5.0.2 DogPawHat closed this
Sign in to join this conversation.
⚠️ No Changeset found#
Latest commit: 953251352edd5e2edb3f7582434d275dec6f9be1
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR