-
Notifications
You must be signed in to change notification settings - Fork 382
Fix CalVer enforcement running on semver-only releases #3234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Previously, enforce-calver-ci.js would unconditionally run for all CalVer packages (hydrogen, hydrogen-react, skeleton) even when only semver packages (cli, mini-oxygen, create-hydrogen) had changesets. This caused phantom version bumps and CHANGELOG entries for CalVer packages with no actual changes. The fix adds an early exit check that skips CalVer enforcement when no CalVer changesets are detected, ensuring semver-only releases don't touch CalVer packages. Fixes the issue seen in PR #3233 where a CLI-only release incorrectly bumped hydrogen/hydrogen-react/skeleton.
Contributor
|
Oxygen deployed a preview of your
Learn more about Hydrogen's GitHub integration. |
The guard check was using hasCalVerChangesets() which checks for .md files in .changeset/ directory. But this runs AFTER 'changeset version' has already deleted those files, causing the check to always return false and skip enforcement for ALL releases (including CalVer releases). Fix: Compare actual version changes by checking if pkg.version differs from git baseline (oldVersion). This correctly: - Skips when only semver packages change (no CalVer version changes) - Runs when any CalVer package version changes - Works regardless of whether changeset files still exist The readPackageVersions() function already provides both values for comparison.
enforce-calver-ci.js: Compare version changes instead of checking deleted changeset files test-calver.yml: Calculate expected branches from actual hydrogen version instead of hardcoding 2025-05
Patches/minors: Each CalVer package uses its own git baseline for independent versioning Majors: All CalVer packages sync to same quarter using hydrogen's baseline This allows hydrogen, hydrogen-react, and skeleton to have different patch versions while ensuring all majors stay synchronized to the same quarter.
When calculating new versions, preserve unchanged packages instead of bumping them. This enables truly independent patch versioning while maintaining major sync.
Tests complete version script flow for: - Semver-only releases (validates guard check skips CalVer enforcement) - CalVer releases (validates enforcement runs and version.ts updates) This catches regressions in the full pipeline, not just isolated scripts.
CalVer packages now support: - Independent patch/minor versions (hydrogen@2025.7.2, react@2025.7.0) - Synchronized major versions (all at 2025.10.0 for Q4)
Creates a dummy patch changeset for cli-hydrogen to validate that: - Version PR is titled "[ci] release semver" (not CalVer date) - Only cli-hydrogen is bumped (no CalVer packages touched) - enforce-calver-ci.js correctly skips CalVer enforcement
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
WHY are these changes introduced?
Related to #3233
When merging changesets for only semver packages (cli-hydrogen, mini-oxygen, create-hydrogen), the CalVer enforcement script ran unconditionally and created phantom version bumps for CalVer packages (hydrogen, hydrogen-react, skeleton). This forced maintainers to manually revert changeset commits.
The script checked for changeset files that had already been deleted by
changeset version, causing it to skip enforcement for ALL releases including legitimate CalVer releases.WHAT is this pull request doing?
Primary fix: Guard check now compares actual version changes instead of checking for deleted changeset files.
Additional improvements:
.changeset/enforce-calver-ci.js.changeset/enforce-calver-ci.js.changeset/enforce-calver-ci.js.github/workflows/test-calver.yml.github/workflows/test-calver.ymldocs/CALVER.mdBefore:
After:
HOW to test your changes?
Verify semver-only skips CalVer enforcement
Verify CalVer releases run enforcement
Verify independent patches
Verify synced majors
Checklist