Skip to content

fix(release): prevent calver prerelease jumps and fail on invalid semantic drift#176

Merged
iamfj merged 2 commits intonextfrom
fix/calver-release-pipeline
Apr 23, 2026
Merged

fix(release): prevent calver prerelease jumps and fail on invalid semantic drift#176
iamfj merged 2 commits intonextfrom
fix/calver-release-pipeline

Conversation

@iamfj
Copy link
Copy Markdown
Member

@iamfj iamfj commented Apr 23, 2026

Summary

  • route semantic-release commit analysis through calver-plugin
  • normalize releasable commit types by calver cadence:
    • same UTC month => patch
    • month rollover => minor
  • replace unsupported verifyRelease context mutation with explicit calver divergence validation
  • make calver month rollover semver-compatible by resetting monthly patch to .0
  • add unit coverage for mapping logic, delegated analysis, and divergence guardrails

Root cause addressed

verifyRelease tried to mutate context.nextRelease.version, but semantic-release passes plugins a cloned context, so mutation never persisted. semantic-release then published the original semver-derived version (2026.5.0-next.1).

Behavior after this PR

  • feat/fix on next still trigger releases with prerelease cadence
  • same month on next: ...-next.N+1
  • month rollover on next: YYYY.(M+1).0-next.1
  • release aborts loudly if semantic-release-computed version diverges from calver expectation

Validation

  • npm run check:ci
  • npx tsc --noEmit
  • npm test
  • npm run build
  • npx vitest run tests/unit/release/calver-plugin.test.ts tests/unit/release/calver.test.ts

iamfj added 2 commits April 23, 2026 19:13
Map releasable commit types to patch cadence on main/next.

Prevents prerelease train jumps to new minor from feat commits.

Replace unsupported verifyRelease mutation with divergence guard

against computeCalverVersion for fail-fast behavior.

Add unit coverage for mapping, delegated commit analysis,

and calver divergence safeguards.
Use month-rollover minor bump mapping in calver-plugin analyze step.

Adopt monthly reset to patch .0 so semantic-release can model rollover.

Keep verifyRelease guard to block any future version drift.

Expand release tests for rollover mapping and rollover versions.
@iamfj iamfj merged commit 3de339d into next Apr 23, 2026
8 checks passed
@iamfj iamfj deleted the fix/calver-release-pipeline branch April 23, 2026 18:02
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.

1 participant