fix: correct versions with prereleases#495
Merged
Conversation
1 task
wraithgar
previously approved these changes
Dec 11, 2024
wraithgar
approved these changes
Dec 11, 2024
Merged
wraithgar
pushed a commit
that referenced
this pull request
Dec 11, 2024
🤖 I have created a release *beep* *boop* --- ## [4.23.6](v4.23.5...v4.23.6) (2024-12-11) ### Bug Fixes * [`252092a`](252092a) [#495](#495) correct versions with prereleases (#495) (@reggi) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.
prereleasesdo not work in release-please, i'm seeing the inability to get a repo into or out ofprereleasemode, (where the packages have tags in the versions ie.-pre-0at the end).reggi/packages.npm/clihas been stuck in prerelease mode. It was able to get itself into prerelease because of the wrapper around release-please we have in this repo. (trail: npm/cli workflow, Strategy Turnery)I do not believe release please has this
options.prerelease ternary anymorehere's the mapping of what versioning-strategy is uses.And even if it did choose to use
PrereleaseVersioningStrategyorDefaultVersioningStrategyneither of these strategies have the ability to leave a prerelease. Because they always add the currentprereleaseTypeorprereleaseTypefrom the config from the existing version. Neither of these classes even have access to theoptions.prereleaseboolean.I created a fork of release-please which would deprecate the need for this PR, https://github.com/reggi/release-please with the typescirpt / esm alternatives to the files included in this PR:
This is added as a new versioning-strategy
semver. To note the property currently documented asversioning-strategyin the docs is not working, and is currentlyversioning. I opened a PR to fix the json schema for the config, but now we know it's a bug i'll leave that discussion open there.So
"versioning-strategy": "semver"would be ignored and you'd need"versioning": "semver", again not relevant to this PR but another quirk to note.This PR replaces both strategies with a new
SemverVersioningStrategywhich is always used, and has prerelease-aware replacement forsemver.incsemver.inc, when incrementing topreminorwith2.1.0-pre.1it bumps the minor2.2.0-pre.0which is incorrect.incfunction included in this pr takes2.1.0-pre.1and sees thatpatchis0and will assume a bump has already taken place because it's in prerelease, and will only increment the tag number (known in semver asidentifierBaseorn) to2.1.0-pre.2.We will most likely also have extended conversations about adding this new prerelease-aware functionality to
semver.incin some way so other projects such as release-please can properly implement prereleases.