[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
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

bump:pre is too simple #78

Open
bquorning opened this issue Nov 7, 2017 · 10 comments
Open

bump:pre is too simple #78

bquorning opened this issue Nov 7, 2017 · 10 comments

Comments

@bquorning
Copy link

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
@grosser
Copy link
Collaborator
grosser commented Nov 7, 2017 via email

@bquorning
Copy link
Author

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

@bquorning
Copy link
Author

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?

@grosser
Copy link
Collaborator
grosser commented Nov 7, 2017 via email

@jasonkarns
Copy link
Contributor
jasonkarns commented Jul 3, 2018

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
Copy link
Contributor

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

@mckomo
Copy link
mckomo commented Oct 5, 2018

Hey, I've added PR that adds new prerelease bumps here #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

@jasonkarns
Copy link
Contributor

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.)

@jefferson-rios-globant
Copy link

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.

@grosser
Copy link
Collaborator
grosser commented Sep 17, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants