Skip to content

feat(calendar): add calendar versioning strategy - #2637

Open
wikando-ck wants to merge 26 commits into
googleapis:mainfrom
wikando-ck:feat/calendar-versioning-strategy
Open

wikando-ck wants to merge 26 commits into
googleapis:mainfrom
wikando-ck:feat/calendar-versioning-strategy

Conversation

@wikando-ck

@wikando-ck wikando-ck commented Dec 16, 2025 •

Copy link
Copy Markdown

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes:

To try this, check out the branch and run

npm run compile && node build/src/bin/release-please.js release-pr \
--token=$GITHUB_TOKEN \
--repo-url=org/repo \
--release-type=node \
--versioning-strategy=calendar \
--calver-scheme=YYY.0M.0D-MICRO \
--dry-run

@google-cla

google-cla Bot commented Dec 16, 2025

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@product-auto-label product-auto-label Bot added size: xl Pull request size is extra large. api: calendar Issues related to the Calendar API API. labels Dec 16, 2025
@wikando-ck
wikando-ck force-pushed the feat/calendar-versioning-strategy branch 2 times, most recently from a43cab4 to e432123 Compare December 16, 2025 16:54
@wikando-ck
wikando-ck force-pushed the feat/calendar-versioning-strategy branch 2 times, most recently from d62481e to 916156d Compare December 16, 2025 22:01
@wikando-ck
wikando-ck marked this pull request as ready for review December 17, 2025 07:49
@wikando-ck
wikando-ck requested review from a team December 17, 2025 07:49
@ckrack

ckrack commented Feb 10, 2026

Copy link
Copy Markdown

@chingor13 any chance to get a review?
I'll rebase once we get going.

@wikando-ck
wikando-ck force-pushed the feat/calendar-versioning-strategy branch from 916156d to 21caad6 Compare February 17, 2026 21:39
@wikando-ck
wikando-ck requested review from a team as code owners February 17, 2026 21:39
@wikando-ck
wikando-ck force-pushed the feat/calendar-versioning-strategy branch from 21caad6 to 678518c Compare February 17, 2026 21:48
@mickaelalvs

Copy link
Copy Markdown

👋🏼 Hi! Any news on that subject 😊 Thanks!

@tilalx

tilalx commented Aug 10, 2026

Copy link
Copy Markdown

@chingor13 I'd love to have this feature. Is there any chance it could get reviewed and merged? Thanks!

@wikando-ck

Copy link
Copy Markdown
Author

I'll gladly rebase again, once a maintainer had a look.

@tilalx

tilalx commented Aug 10, 2026

Copy link
Copy Markdown

@JoeWang1127 @codyoss Would either of you have time to take a look at this PR?

@lokkju

lokkju commented Oct 2, 2026

Copy link
Copy Markdown

Thanks for keeping this rebased. One naming suggestion: the strategy is calendar, but the config key is already calver-scheme, #1848 asks for "calver", and other release tools (yeet, for one) call the same strategy calver. Registering it as calver, or accepting both names, would keep configs portable between tools.

@lokkju

lokkju commented Oct 2, 2026

Copy link
Copy Markdown

I tested this branch against existing releases. Unpadded three-part schemes work (YYYY.MM.MICRO: 2026.9.4 bumps to 2026.10.0 and survives the manifest and tag round trip), but zero-padded and four-part schemes don't survive a second release:

  • bump() fails on the first release after an existing one. With YYYY.0M.0D.MICRO, Version.parse('2026.10.01.3') returns 2026.10.1, and the strategy then throws Failed to parse version "2026.10.1" with format "YYYY.0M.0D.MICRO". YYYY.0M.0D and YYYY.0M.MICRO fail the same way.
  • Release creation re-parses the version from the release PR's title and body, which gives 2026.10.2 for 2026.10.02.1, so the tag created at merge would be wrong.
  • TagName.parse('v2026.10.02.0') reads the version as 10.2.0, so last-release lookup breaks for these schemes as well.

The cause is outside the strategy: Version is three-part SemVer with an unanchored regex, and release-please re-parses stored versions in several places. Supporting padded or four-part CalVer would need Version to keep the original string and the parsing to be anchored throughout, which is a much larger change than a strategy. The tests here only use unpadded schemes, which is why none of this shows up.

For what it's worth, I'm moving my CalVer projects to yeet instead. It does release PRs with native YYYY.0M.0D.MICRO support on GitHub and GitLab.

@wikando-ck

Copy link
Copy Markdown
Author

Thanks @lokkju, good catch. thats unfortunate.
It could be fixed my modifying that behaviour, possibly depending on the strategy or with a flag.
Indeed, that would make the PR even larger.

I'll wait for feedback before doing anything.

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

Labels

api: calendar Issues related to the Calendar API API. size: xl Pull request size is extra large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Calendar versioning (CalVer) alternatively to SemVer Support of calver

7 participants