fix patch bump pre release#93
Open
MarkOSullivan94 wants to merge 1 commit into
Open
Conversation
f3ath
reviewed
Jun 19, 2026
| expect(err.buffer.toString().trim(), | ||
| 'The next version must be higher than the current one.'); | ||
| }); | ||
| test('bump patch --pre=beta from pre-release bumps patch number', () async { |
Owner
There was a problem hiding this comment.
I think this can be reproduced by adding the line
['bump', 'patch', '--pre=alpha']: '0.0.6-alpha',
to the test above
f3ath
reviewed
Jun 19, 2026
| @@ -50,7 +50,17 @@ class Project { | |||
| mutation = m.Sequence([mutation, m.SetPreRelease(pre)]); | |||
Owner
There was a problem hiding this comment.
It looks like a cleaner solution would be to strip the pre-release here, like
mutation = m.Sequence([m.StripPreRelease(), mutation, m.SetPreRelease(pre)]);but since we don't have StripPreRelease yet, this should work too.
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.
Resolves #92
This pull request addresses an issue with version bumping when using the
--preflag on a pre-release version. Previously, bumping a patch with the same pre-release identifier could result in no version change (e.g.,0.0.16-beta→0.0.16-beta). The logic now ensures the numeric component is incremented as expected. A new test case was also added to verify this behavior.Version bumping logic improvements:
Projectto retry the bump against the stripped release version if the next version does not advance due to the--preflag and the current version is already a pre-release. This ensures the numeric component is incremented (e.g.,0.0.16-beta→0.0.17-beta).Testing enhancements:
--pre=betafrom a pre-release correctly increments the patch number and applies the pre-release suffix (e.g.,0.0.16-beta→0.0.17-beta).