bump icon indicating copy to clipboard operation
bump copied to clipboard

bump:pre is too simple

Open bquorning opened this issue 8 years ago • 10 comments

The current pre-release bumping (implemented in #11) is very naïve and not really intuitive:

» rake bump:current
Current version: 1.2.3
» rake bump:pre
Bump version 1.2.3 to 1.2.3-alpha
» rake bump:pre
Bump version 1.2.3-alpha to 1.2.3-beta
» rake bump:pre
Bump version 1.2.3-beta to 1.2.3-rc
» rake bump:pre
Bump version 1.2.3-rc to 1.2.3
» rake bump:pre
Bump version 1.2.3 to 1.2.3-alpha
» rake bump:pre
Bump version 1.2.3-alpha to 1.2.3-beta

If you need e.g. three beta versions before moving to a release candidate, bump is of no help.

I would prefer if repeated calls to bump:pre increased a number. Perhaps that requires separate bump:alpha, bump:beta and bump:rc commands?

» rake bump:current
Current version: 1.2.3
» rake bump:alpha
Bump version 1.2.3 to 1.2.3-alpha1
» rake bump:alpha
Bump version 1.2.3-alpha1 to 1.2.3-alpha2
» rake bump:beta
Bump version 1.2.3-alpha2 to 1.2.3-beta1
» rake bump:rc
Bump version 1.2.3-beta1 to 1.2.3-rc1
» rake bump:rc
Bump version 1.2.3-rc1 to 1.2.3-rc2
» rake bump:rc
Bump version 1.2.3-rc2 to 1.2.3-rc3

bquorning avatar Nov 07 '17 10:11 bquorning

maybe rake bump:pre[alpha] etc to control the flow ?

On Tue, Nov 7, 2017 at 2:37 AM, Benjamin Quorning [email protected] wrote:

The current pre-release bumping (implemented in #11 https://github.com/gregorym/bump/pull/11) is very naïve and not really intuitive:

» rake bump:current Current version: 1.2.3 » rake bump:pre Bump version 1.2.3 to 1.2.3-alpha » rake bump:pre Bump version 1.2.3-alpha to 1.2.3-beta » rake bump:pre Bump version 1.2.3-beta to 1.2.3-rc » rake bump:pre Bump version 1.2.3-rc to 1.2.3 » rake bump:pre Bump version 1.2.3 to 1.2.3-alpha » rake bump:pre Bump version 1.2.3-alpha to 1.2.3-beta

If you need e.g. three beta versions before moving to a release candidate, bump is of no help.

I would prefer if repeated calls to bump:pre increased a number. Perhaps that requires separate bump:alpha, bump:beta and bump:rc commands?

» rake bump:current Current version: 1.2.3 » rake bump:alpha Bump version 1.2.3 to 1.2.3-alpha1 » rake bump:alpha Bump version 1.2.3-alpha1 to 1.2.3-alpha2 » rake bump:beta Bump version 1.2.3-alpha2 to 1.2.3-beta1 » rake bump:rc Bump version 1.2.3-beta1 to 1.2.3-rc1 » rake bump:rc Bump version 1.2.3-rc1 to 1.2.3-rc2 » rake bump:rc Bump version 1.2.3-rc2 to 1.2.3-rc3

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/gregorym/bump/issues/78, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAsZx5lVN2MxyRHfq6syCRQ_BneIFeCks5s0DLPgaJpZM4QUlI7 .

grosser avatar Nov 07 '17 15:11 grosser

I think it’s possible to accomplish with colons instead of brackets, i.e. rake bump:pre:alpha.

bquorning avatar Nov 07 '17 15:11 bquorning

There are a few edge cases to consider, e.g.:

» rake bump:current
Current version: 1.2.3
» rake bump:alpha
Bump version 1.2.3 to 1.2.3-alpha1
» rake bump:beta
Bump version 1.2.3-alpha1 to 1.2.3-beta1
» rake bump:alpha
… what now?

bquorning avatar Nov 07 '17 15:11 bquorning

declare failure

On Tue, Nov 7, 2017 at 7:57 AM, Benjamin Quorning [email protected] wrote:

There are a few edge cases to consider, e.g.:

» rake bump:current Current version: 1.2.3 » rake bump:alpha Bump version 1.2.3 to 1.2.3-alpha1 » rake bump:beta Bump version 1.2.3-alpha1 to 1.2.3-beta1 » rake bump:alpha … what now?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/gregorym/bump/issues/78#issuecomment-342528637, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAsZ9koT17Dzt0JCN0fbSiFnHjdEAX6ks5s0H3_gaJpZM4QUlI7 .

grosser avatar Nov 07 '17 16:11 grosser

It's also worth noting that 1.2.3-alpha is not an increase from 1.2.3.

Really, in order to go from a non-pre release to a pre-release, one would need to know the eventual non-pre target. ie, if current is 1.2.3, pre-major would be 2.0.0-alpha, pre-minor would be 1.3.0-alpha, and pre-patch would be 1.2.4-alpha.

Perhaps bump:pre:major, bump:pre:minor, bump:pre:patch to derive the correct increment for the prerelease. (Probably defaulting to pre:major?)

And then bump:pre:alpha, bump:pre:beta, bump:pre:rc to increment the counter when already on a prerelease?

jasonkarns avatar Jul 03 '18 19:07 jasonkarns

I'd also recommend that the pre-counter be dot-separated, as semver describes the pre-release version:

a series of dot separated identifiers immediately following the patch version

So 1.2.3-alpha.0 and 1.2.3-rc.4

jasonkarns avatar Jul 03 '18 19:07 jasonkarns

Hey, I've added PR that adds new prerelease bumps here https://github.com/gregorym/bump/pull/81.

Regarding applying the prerelease label to the final version (e.g. 1.2.3 => 1.2.3-alpha) I propose following workflow.

➜ bump major --no-commit
# Bump from 1.2.3 to 2.0.0
➜ bump alpha
# Commits to git
# Bump from 2.0.0 to 2.0.0-alpha

mckomo avatar Oct 05 '18 09:10 mckomo

It might be worth following patterns that other version bumping tools follow:

npm has premajor, preminor, and prepatch which does the bumping of the relevant major/minor/patch bit as well as the prerelease bit all at once, so that multiple steps aren't necessary: https://docs.npmjs.com/cli/version. (That's part of my inspiration for bump:pre:major, et. al.)

jasonkarns avatar Oct 05 '18 12:10 jasonkarns

Hi guys, I found this gem very useful, but you need to add the alpha, beta and rc bumps. I thing the @mckomo PR could work.

jefferson-rios-globant avatar Sep 03 '21 12:09 jefferson-rios-globant

bump is for "idk what version I'm on, but this is a patch" so having to say ":alpha/:beta/:rc" means the user knows what the current state is (can't do beta after rc etc) so simple solution would be to bump:set 🤷

  • if we add alpha/beta/rc then they should have .1 suffix to follow semver
  • I'd prefer to hide them and :pre from -T to not spam a projects rake tasks with it
  • ideally get rid of pre since it's unintuitive no matter what way it's implemented
  • bump:set could be interactive and say hey it's 1.2.3-alpha.5 now, what do you want to set it to, to make it intuitive and open

grosser avatar Sep 17 '21 21:09 grosser