Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature(prerelease-type): changing prerelease-type in manifest or from cli does not bump to new status and reset counter. #2447

Open
jasonbraley opened this issue Dec 3, 2024 · 5 comments
Assignees
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@jasonbraley
Copy link

jasonbraley commented Dec 3, 2024

Problem description:
My product goes through an alpha, beta, rc, release cycle. Fairly standard. I cannot seem to find a way through the config/manifest system to move to the next phase of prerelease. prerelease-type in the manifest seems to just be ignored if the previous prerelease status was not empty

Solution:
When doing a prerelease version bump, the code should check the prerelease-type flag and if it doesn't match the last version, use this new value and reset the counter to zero.

Alternatives:
I've currently been using release-as: to move to the next phase. It works, but it's not automated.

@jasonbraley jasonbraley added priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. labels Dec 3, 2024
@wraithgar
Copy link

@chingor13 I see this is assigned to you. We (npm) are using release-please and also have found several issues w/ how release-please approaches pre-releases. The TLDR is that it's not really following the semver spec, nor is it even using the semver package to affect semver versioning. This leads to the issue describe here, as well as other issues such as not actually being able to leave pre-release mode once you are in it.

We ended up having to use our own fork with a custom versioning stragtegy in the past. We're no longer using that fork, but are likely going to have to re-implement that custom strategy in our release-please consumer to ship npm 11 this week.

It'd be great if long-term we could go back to using a versioning strategy that ships with release-please. I would love to help here if possible.

@wraithgar
Copy link

Using semver itself in the default and prerelease version strategies, with the same bit of logic from the custom strategy I linked above, would fix this bug and the one we're having with being unable to leave pre-release mode.

> semver.inc('1.1.1', 'premajor', 'pre')
'2.0.0-pre.0'
> semver.inc('2.0.0-pre.0', 'prerelease')
'2.0.0-pre.1'
> semver.inc('2.0.0-pre.0', 'major')
'2.0.0'
> semver.inc('2.0.0-pre.0', 'prerelease', 'foo')
'2.0.0-foo.0'

@reggi
Copy link

reggi commented Dec 11, 2024

I created a pr with some context regarding the current issues and troubles we've had #2451

@reggi
Copy link

reggi commented Dec 11, 2024

@jasonbraley to unblock you theoretically you could set "versioning": "prerelease" (undocumented property 😠 ) with the "prereleaseType": "alpha" and it may work, not 100% though. Also once you're in prerelaese it may not leave 😆

@jasonbraley
Copy link
Author

jasonbraley commented Dec 11, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

4 participants