Commit 0511444
authored
Fix CalVer enforcement running on semver-only releases (#3234)
* Fix CalVer enforcement running on semver-only releases
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.
* Document semver-only release guard check in CALVER.md
* Fix CalVer enforcement guard check to compare version changes
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.
* Fix CalVer guard check and dynamic Test 5
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
* Implement independent patches with synced majors
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.
* Skip unchanged CalVer packages in patch releases
When calculating new versions, preserve unchanged packages instead of bumping them.
This enables truly independent patch versioning while maintaining major sync.
* Add Test 8: Full pipeline integration test
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.
* Document independent patches and synced majors in CALVER.md
CalVer packages now support:
- Independent patch/minor versions ([email protected], [email protected])
- Synchronized major versions (all at 2025.10.0 for Q4)
* Add test changeset for semver-only release validation
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 enforcement1 parent 12374c8 commit 0511444
File tree
4 files changed
+143
-45
lines changed- .changeset
- .github/workflows
- docs
4 files changed
+143
-45
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
35 | 35 | | |
36 | | - | |
37 | 36 | | |
38 | 37 | | |
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
43 | | - | |
44 | | - | |
| 42 | + | |
| 43 | + | |
45 | 44 | | |
46 | 45 | | |
47 | | - | |
48 | 46 | | |
49 | 47 | | |
50 | | - | |
51 | | - | |
| 48 | + | |
| 49 | + | |
52 | 50 | | |
53 | | - | |
| 51 | + | |
| 52 | + | |
54 | 53 | | |
55 | 54 | | |
56 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
57 | 71 | | |
58 | 72 | | |
59 | | - | |
| 73 | + | |
| 74 | + | |
60 | 75 | | |
61 | 76 | | |
62 | 77 | | |
| |||
81 | 96 | | |
82 | 97 | | |
83 | 98 | | |
84 | | - | |
85 | | - | |
86 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
87 | 110 | | |
88 | 111 | | |
89 | 112 | | |
| |||
226 | 249 | | |
227 | 250 | | |
228 | 251 | | |
229 | | - | |
230 | | - | |
231 | | - | |
| 252 | + | |
232 | 253 | | |
233 | 254 | | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
234 | 273 | | |
235 | 274 | | |
236 | 275 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
229 | | - | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
230 | 251 | | |
231 | 252 | | |
232 | 253 | | |
233 | 254 | | |
234 | | - | |
| 255 | + | |
235 | 256 | | |
236 | 257 | | |
237 | 258 | | |
238 | 259 | | |
239 | 260 | | |
240 | 261 | | |
241 | | - | |
| 262 | + | |
242 | 263 | | |
243 | 264 | | |
244 | | - | |
| 265 | + | |
245 | 266 | | |
246 | | - | |
247 | | - | |
| 267 | + | |
| 268 | + | |
248 | 269 | | |
249 | | - | |
| 270 | + | |
250 | 271 | | |
251 | 272 | | |
252 | 273 | | |
253 | 274 | | |
254 | 275 | | |
255 | 276 | | |
256 | 277 | | |
257 | | - | |
| 278 | + | |
258 | 279 | | |
259 | 280 | | |
260 | 281 | | |
| |||
264 | 285 | | |
265 | 286 | | |
266 | 287 | | |
267 | | - | |
268 | | - | |
| 288 | + | |
| 289 | + | |
269 | 290 | | |
270 | | - | |
271 | | - | |
| 291 | + | |
| 292 | + | |
272 | 293 | | |
273 | | - | |
| 294 | + | |
274 | 295 | | |
275 | 296 | | |
276 | 297 | | |
| |||
279 | 300 | | |
280 | 301 | | |
281 | 302 | | |
282 | | - | |
| 303 | + | |
283 | 304 | | |
284 | | - | |
| 305 | + | |
285 | 306 | | |
286 | 307 | | |
287 | 308 | | |
288 | 309 | | |
289 | 310 | | |
290 | 311 | | |
291 | 312 | | |
292 | | - | |
| 313 | + | |
293 | 314 | | |
294 | 315 | | |
295 | 316 | | |
| |||
430 | 451 | | |
431 | 452 | | |
432 | 453 | | |
433 | | - | |
434 | | - | |
435 | | - | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
436 | 460 | | |
437 | 461 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
159 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
160 | 163 | | |
161 | 164 | | |
162 | 165 | | |
| |||
211 | 214 | | |
212 | 215 | | |
213 | 216 | | |
214 | | - | |
| 217 | + | |
215 | 218 | | |
216 | 219 | | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
217 | 224 | | |
218 | 225 | | |
219 | 226 | | |
| |||
455 | 462 | | |
456 | 463 | | |
457 | 464 | | |
458 | | - | |
459 | | - | |
460 | | - | |
461 | | - | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
462 | 469 | | |
463 | 470 | | |
464 | 471 | | |
| |||
548 | 555 | | |
549 | 556 | | |
550 | 557 | | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
551 | 581 | | |
552 | 582 | | |
553 | 583 | | |
| |||
0 commit comments