googleapis / googleapis/release-please

Convert a prerelease version to stable version

Open
#2,515 8 comments 7 reactions 1 assignee Claimed by @chingor13 View on GitHub
priority: p3 type: feature request
Dominant language
TypeScript
Stars
7.5k
Forks
588
Avg merge
12h 16m
Merged PRs (30d)
7

Description

**Is your feature request related to a problem? Please describe.**
I need to create development versions which indicates that the package version is under development and should be used with care.
So I came up with the "prerelease" version strategy which fits that need pretty nice.
When I finish the development I wanted to change the versioning strategy from "prerelease" to "default", which results in an unexpected behaviour:
**v1.0.0-dev.4** (created by 5 runs of "prerelease" version strategy, one commit was "feat!") were bumped to
**v2.0.0-dev.4** ("default" version strategy)

What i expected though is the new version **v1.0.0**

**Describe the solution you'd like**
The idea I came up with is a new versioning strategy. Lets call it "release-from-prerelease" and its very simple:
While the "prerelease" already handles version bumps very well, the new strategy only needs to get rid of the "build" and "prerelease" property. As a result we can use the "CustomVersionUpdate" updater like this:
```
return new CustomVersionUpdate(
Version.parse(`${version.major}.${version.minor}.${version.patch}`).toString()
);
```

**Describe alternatives you've considered**
A more clean way would be the implement that behaviour in the "prerelease" property - So when the "prerelease" prroperty was set, then use the "prerelease" versioning strategy, otherwise set the new "release-from-prerelease" startegy.
Another way would be to change the "Major/Minor/PatchVersionUpdate" classes, but I think that might have some side-effect

**Additional context**
I know there are discussions how to handle pre-releases well [here](https://github.com/googleapis/release-please/issues/510), but they are ongoing for four years. I can not understand how release-please took so much hype without pre-release handling. Hope this issue makes a little step to takle this, even if its very simple.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.