Repository navigation
Conversation
A calver prerelease adds the channel suffix to the version that the next stable release would get, such as 2026.11.2-beta.1. The counter continues while that version stays the same and restarts at 1 in a new period. A stable release in the same period then takes that version. Calver tags with a semver prerelease suffix now parse, sort below their stable release, and update version file markers.
A Release-As footer on a calver target now sets the next version. The value must match the configured format, be stable, be newer than the current version, and not be in a later calendar period. On a prerelease channel yeet adds the channel suffix, such as 2026.11.5-beta.1. Before, calver targets ignored the footer with a warning. A footer that is not valid for the calver format now fails the release, as it does for semver targets.
…erived targets A derived target with a Release-As footer in its own commits lost the requested version when an included target had a higher bump. yeet then planned the next version from the child bump and ignored the footer. yeet now plans the derived target again with the higher bump and keeps the requested version. This also changes semver derived targets: with Release-As: 1.0.1 and a child feature, the derived target now releases 1.0.1 instead of 1.1.0, as a path target already does.
…ffixes compareCalVerParts returned through a semver comparison even when both suffixes were equal, which includes two stable versions. It now returns early in that case.
The counter restarts when the version the next stable release would get changes, such as after a stable release or in a new period, not only in a new period.
A Release-As footer that is not in the calver format of a target now gives a warning and yeet ignores it for that target, as before calver supported the footer. One commit in a repository with semver and calver targets can then set the semver version, such as Release-As: 2.0.0, and the calver target still releases normally. A value in the calver format that breaks a rule still fails the release, as a semver value does: it must be stable, newer than the current version, and not in a later calendar period.
The hint for an invalid Release-As value always said to use a stable version newer than the current version. For a calver value in a later calendar period that advice is wrong, because a newer version does not help. The hint now asks for a version from the current calendar period in that case, and for the version format of the target when the format does not match. Other problems keep the old hint.
A calver.label such as beta is added to every stable version, for example 2026.11.1-beta. A labeled version is a release: MICRO counts it, stable runs keep its tag, and the provider release is not a prerelease. Without the label, MICRO continues from the latest tag, labeled or not. A label is one identifier with at least one letter and no dot, so a labeled tag (v2026.11.2-beta) is different from a channel prerelease tag (v2026.11.2-beta.1).
The version pattern stopped a prerelease suffix at the first hyphen. A marker with 1.2.3-rc-1 or a calver label such as 2026.11.1-public-beta became 1.2.4-1 or 2026.11.2-public-beta-beta. The suffix now accepts hyphens, as the build metadata already did.
…alue A Release-As value with a label, such as 2026.11.5-beta on a target with calver.label, gave the hint to use a stable version newer than the current version. The hint now says to remove the label, because calver.label adds it.
Member
|
This PR combines several independent changes, and some of them also change semver behaviour. Please split it into small, focused PRs so each one can be reviewed and released on its own. I'll review the details in the split PRs. SplitPRs that can go ahead:
Please open an issue first for these two, as CONTRIBUTING.md asks for larger changes:
Use cases for label and calver Release-AsBefore any code for 4 and 5, I'd like to understand the use case:
|
This was referenced Oct 31, 2026
Contributor
Author
|
Thanks for the review. I split the PR as you suggested:
All three are rebased on For |
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
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.
Suggested title:
feat(version): support prerelease channels, Release-As, and a version label for calver targetsWhat
Calver targets can now release on a prerelease channel, honour a
Release-Asfooter, and carry a fixed version label such asbetaon every stable release. Before, a channel run with a calver target failed withprerelease channel "beta" supports semver targets only, calver targets ignoredRelease-As, and there was no way to keep a label on the main line.Small commits, so
Release-Asor the derived target fix can be dropped or split out if you prefer:feat(version): support prerelease channels for calver targetsfeat(version): support Release-As for calver targetsfix(release): keep Release-As over child bumps on semver and calver derived targets(also changes semver, see Behaviour notes)refactor(version): skip the prerelease comparison for equal calver suffixesdocs(versioning): say when the calver prerelease counter restartsfix(release): ignore a calver Release-As value in another formatfix(diagnostics): fit the Release-As hint to the problemfeat(version): add a fixed label for calver releasesdocs(versioning): describe the calver labelfix(versionfile): keep hyphens in a prerelease suffix(also changes semver, see Behaviour notes)fix(diagnostics): hint to remove the label from a calver Release-As valueCommits 8 to 11 add the label and can also be split into their own PR if you prefer. They reuse the calver suffix parsing of commit 1.
Why
Projects that use calver also ship betas, for example
2026.11.1-beta.1,2026.11.1-beta.2, then2026.11.1. The channel mechanics (branches, channel changelogs, prerelease provider releases) are already scheme-neutral; only the calver strategy refused prereleases.Other projects go through a public beta phase on their main line: every release is a beta, and these betas are the latest releases that users install. They want
2026.11.1-beta,2026.11.2-beta,2026.12.1-beta, and at general availability they drop the label and continue with2026.12.2. A channel does not fit, because channel releases are prereleases with a counter, and "latest" on the provider must point at the beta.Behaviour
A channel prerelease is the version the next stable release would get now, plus
-<prerelease>.<N>.Ncontinues while that version stays the same and restarts at 1 when it changes. Stable runs still ignore prerelease tags.Format
YYYY.0M.MICRO,betachannel, release in November 2026:2026.11.1-beta.1v2026.11.1-beta.12026.11.1-beta.2v2026.11.12026.11.2-beta.1v2026.11.2-beta.12026.11.2-beta.2v2026.11.1, withv2026.11.2-beta.*on the beta branch2026.11.2v2026.10.4-beta.22026.11.1-beta.1v2026.11.1+Release-As: 2026.11.52026.11.5v2026.11.2-beta.1+Release-As: 2026.11.52026.11.5-beta.1Version label,
calver.label: beta, stable run, release in November 2026:calver.labelbeta2026.11.1-betav2026.11.1-betabeta2026.11.2-betav2026.11.2(label added)beta2026.11.3-betav2026.11.2-beta(label removed)2026.11.3v2026.10.4-betabeta2026.11.1-betav2026.11.2-alpha(label changed)beta2026.11.3-betav2026.11.1-beta+Release-As: 2026.11.5beta2026.11.5-betav2026.11.2-beta, beta channel runbeta2026.11.3-beta.1Details:
v2026.11.1-beta.1). They sort below their stable release:2026.11.1-beta.1 < 2026.11.1-beta.2 < 2026.11.1. Stable runs filter them out, as for semver.x-yeet-versiongets the full prerelease version. Segment markers (x-yeet-month,x-yeet-micro, ...) get the base.Release-Ason calver must match the configured format, be stable, be newer than the current version, and not be in a later period than today (a future version would make the next run fail with "current calver is from a future calendar period"). The footer value is normalized to the format (2026.1.5becomes2026.01.5). A value that is in the format but breaks one of these rules fails the release, as an invalid semver footer does. A value that is not in the format is ignored for that target with a warning, as before (see Behaviour notes).nextPrereleaseCounter,prereleaseAllowed); semver behaviour is unchanged.calver.label(top level or per target; a target inherits the top-level label and can set its own) adds-<label>to every stable version. A labeled version is a release, not a prerelease:MICROcounts it, stable runs keep its tag, and the provider release is created withprerelease: false, so "latest" points at it. This needs no new publishing code: the provider prerelease flag already comes from the channel, and a labeled release runs on the stable branch. Removing the label continuesMICROfrom the latest tag, labeled or not. Channel versions do not carry the label. ARelease-Asvalue is given without the label and yeet adds it; a value with a label is rejected.v2026.11.2-betais a labeled release andv2026.11.2-beta.1is a prerelease. This matters at general availability, when the label is no longer configured but the old tags must still count. Ordering stays semver:2026.11.1-beta < 2026.11.1 < 2026.11.2-beta.withChannelChangelogsstays, with a scheme-neutral message. Both built-in schemes now return true fromSupportsPrereleaseandSupportsReleaseAs, so that gate andwarnUnsupportedReleaseAsare only reachable from tests. I kept them to keep the diff small; happy to remove them in this PR or a follow-up.Behaviour notes
Release-Asfooter in its own commits lost the requested version when an included target had a higher bump: yeet re-planned from the child bump and dropped the footer. It now keeps the footer. For semver this changes a result: current1.0.0,Release-As: 1.0.1on the derived target and afeatin a child now gives1.0.1instead of1.1.0, which matches what a path target already does. The plan still reports the higher child bump type. If you want semver left as it was, I can move this commit to its own PR or limit it to calver.Release-Asin another format on a calver target (commit 6). A value that is not in the calver format of a target, such as2.0.0, gives the warningignoring release override in another version formatwithhint="use the calver format YYYY.0M.MICRO to set the version of this target", and yeet ignores it for that target. This keeps repositories with semver and calver targets working: one commit withRelease-As: 2.0.0that touches both sets the semver target to2.0.0, and the calver target releases normally. A value in the calver format that is a prerelease, not newer, or in a later period still fails. Semver is unchanged: a value that is not valid semver still fails. The body of commit 2 says a footer in another format fails the release; commit 6 replaces that rule.v2026.11.2-beta(no counter) was a prerelease of2026.11.2, and a beta run continued it as2026.11.2-beta.1. With commit 8 that tag is a labeled release of2026.11.2, so stable runs see it and a beta run continues with2026.11.3-beta.1. Channel tags always have a counter, so tags that yeet creates are not affected. Onmainbefore this PR, calver ignored every tag with a suffix.x-yeet-versionon1.2.3-rc-1became1.2.4-1, and on a label such as2026.11.1-public-betait became2026.11.2-public-beta-beta. The suffix now accepts hyphens, as the build metadata part of the same pattern already did. This also fixes semver versions with a hyphen in the prerelease.Release-As: 2026.11.5-betaon a target withcalver.label: betafails withrequested version must not include a labelandhint="remove the label from the version, calver.label adds it".Release-Asvalue was alwaysuse a stable version newer than the current version. For a calver value in a later period it is nowuse a version from the current calendar period. The other cases keep the old hint, so the existing golden files do not change. The switch also maps the format reason touse a version in the version format of the target, but a release run never reaches it, because commit 6 warns and skips that value first.Tests
internal/version: calver channelNextReleasetable (same period, new period and new year, first beta of a period, counter past 9, no counter, padded and unpadded formats, day and week formats, future period, invalid counter, no bump), stableNextafter a beta, prerelease tag parsing and rejection,OrderedRefsordering and channel filtering,Release-As(normalize, apply, channel suffix, bump, five rejection cases).internal/release: channel planning through the releaser with a fixed clock (no tags, first beta of the period, stable tag, beta tag, beta from an earlier month, stable run after betas), calverRelease-Asplanning, a calver value in another format ignored with a warning (and a calver footer in another commit still applied), a future-period calver value rejected, a semver and calver repository where one commit withRelease-As: 2.0.0touches both targets (2.0.0and2026.11.1),Release-Ason semver and calver derived targets with a higher child bump, the gate message with a strategy that has no prerelease support.internal/version(label): label validation (accepted and rejected labels,NewCalVerrejects an invalid label),NextReleasewith a label (first release, same period, new period, label added in the middle of a period, label removed in the same and in a later period, label changed, unpadded and day formats, future period), channel versions without the label, labeled tag parsing with a strategy that has no label,OrderedRefswith labeled and unlabeled tags mixed on stable and channel runs,Release-Aswith a label (added, a value with a label rejected, the version of the current labeled release rejected).internal/config: invalid top-level and target labels, a target inherits or overrides the label.internal/release(label): planning with a fixed clock (no tags, labeled tag in the period, labeled tag from an earlier period, label removed, channel prerelease tags ignored), and an auto-merged labeled release created withPrerelease: false.internal/versionfile: markers with a calver prerelease version, with a labeled version, and after the label is removed.internal/versionfile(fix): a semver version with a hyphen in the prerelease, and a calver label with a hyphen.tests/(binary, fake GitHub): labeled release after a labeled tag, release without the label after a labeled tag, aRelease-Asvalue with a label rejected with the label hint, a dotted label rejected by config validation. Also, beta after a stable tag, counter reset in a new period, stable run ignores beta tags, calverRelease-Asapplied, calverRelease-Asin another format ignored with the warning and hint, calverRelease-Asfrom a future period rejected with the period hint. These use tags from 2025 so they do not depend on the current month.make fmt,make lint(0 issues),make test, andmake buildpass.Manual check with the binary and the fake GitHub provider, run in October 2026 with
calver.label: beta: no tags gives2026.10.1-beta; afterv2026.10.1-betagives2026.10.2-beta; with the label removed afterv2026.10.2-betagives2026.10.3. Finalizing a merged release PR forv2026.10.2-betalogscreating release tag=v2026.10.2-beta ... prerelease=false.Docs
docs/versioning.md: calver prerelease versions, and when the counter restarts.docs/release.md: replaced "Channels require semver." with a link to the calver rules.docs/commits.md:Release-Ason calver targets, and the warning for a value in another format.yeet.schema.json: thechannelsdescription no longer says semver, andcalverhas alabelproperty.docs/versioning.md: a "Version label" section under Calver.docs/release.md: labeled calver versions are stable releases, not prereleases.docs/configuration.md: theversionmarker writes the full version, including a prerelease suffix or a label.docs/commits.md: giveRelease-Aswithout the label.Out of scope
A channel on the stable branch itself (no separate beta branch) is still refused by validation. That is a separate question for its own issue.
1.3.0-betaalready means "before 1.3.0", and stable runs, channel filtering and bump planning all treat a suffix as a prerelease, so it is not a small change. Calver has no such meaning for the suffix.Questions
calver.labela good name?labelis also used for PR labels underrelease.labels. Alternatives:calver.suffixorcalver.prerelease_label.public.beta? I did not allow it so that the tag alone tells a label from a channel prerelease.Security impact
None. The only new input is the label, which is validated as one semver prerelease identifier. Version strings are parsed and validated the same way as semver prerelease identifiers.