-
Notifications
You must be signed in to change notification settings - Fork 236
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
semantic-release version --prerelease
does not force a prerelease version bump.
#639
Comments
Hey @css-optivoy - The intention with By default |
Thank you for clarifying. Unfortunately that is surprising because:
We are currently relying on the old behaviour for all our repos, so I've unfortunately had to downgrade all of them to v7 when this started breaking everything. I see |
Hi @css-optivoy I've had a re-read of the docs and the source code, I responded in a hurry to this yesterday which was probably a bad idea - something about the notion of "if there's one to be made" didn't sit right with me. It turns out that that would be really strange and inconsistent - and that's not how I wrote the code, nor how I documented it, and it's a bug/break because it should be consistent. I still think you need to add in those I've raised #647 which should put these options straight - really what |
Thank you.
I've left some thoughts on #647 (comment)
A bit of an aside, but is there a I think what we'd want is essentially |
Have responded on the PR - thanks for having a look. To your aside - there's no |
) * test(version): add validation of `--as-prerelease` and `--prerelease opts` * fix(version-cmd): correct `--prerelease` use Prior to this change, `--prerelease` performed the role of converting whichever forced version into a prerelease version declaration, which was an unintentional breaking change to the CLI compared to v7. `--prerelease` now forces the next version to increment the prerelease revision, which makes it consistent with `--patch`, `--minor` and `--major`. Temporarily disabled the ability to force a prerelease. Resolves: #639 * feat(version-cmd): add `--as-prerelease` option to force the next version to be a prerelease Prior to this change, `--prerelease` performed the role that `--as-prerelease` now does, which was an unintentional breaking change to the CLI compared to v7. `--prerelease` is used to force the next version to increment the prerelease revision, which makes it consistent with `--patch`, `--minor` and `--major`, while `--as-prerelease` forces for the next version to be converted to a prerelease version type before it is applied to the project regardless of the bump level. Resolves: #639 * docs(commands): update version command options definition about prereleases --------- Co-authored-by: codejedi365 <codejedi365@gmail.com>
🎉 This issue has been resolved in version 9.6.0 🎉The release is available on: |
The problem
semantic-release version --prerelease
does not force a prerelease version bump:Expected behavior
Running the above should produce a new prerelease version.
Environment
Additional context
From a quick glance at the code it looks like it might be the logic around here:
python-semantic-release/semantic_release/cli/commands/version.py
Lines 246 to 271 in 2129b72
Setting any of
--major
,--minor
and--patch
will setforce_level
, but setting--prerelease
will setforce_prerelease
, which does not appear to set thelevel_bump
.Adding
force_level = "PRERELEASE_REVISION"
here, makes the logic work as expected:python-semantic-release/semantic_release/cli/commands/version.py
Lines 246 to 247 in 2129b72
The text was updated successfully, but these errors were encountered: