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

Support use case for bumping from a pre-release version to a normal one #23

Open
kaharlichenko opened this issue Feb 22, 2024 · 2 comments · May be fixed by #26
Open

Support use case for bumping from a pre-release version to a normal one #23

kaharlichenko opened this issue Feb 22, 2024 · 2 comments · May be fixed by #26
Milestone

Comments

@kaharlichenko
Copy link

Use Case

I use pre-release versions (as defined in Semantic Versioning) for the work-in-progress code.

Here's my version flow visualized:

flowchart TD
    A(1.1.0) -->|1. Start the next work-in-progress version| B(1.2.0-pre)
    B -->|Add features| B
    B --> C{Major release?}
    C -->|2a. Release next major version| D1(2.0.0)
    C -->|2b. Release next minor version| D2(1.2.0)
    D1 -->|3a. Start the next work-in-progress version| E1(2.1.0-pre)
    D2 -->|3b. Start the next work-in-progress version| E2(1.3.0-pre)
Loading

Steps 1, 3a and 3b can be done with mix bump minor --pre pre.
Step 2a can be done with mix bump major.

My problem is that I couldn't find a way to implement step 2b with Versioce. The best I could achieve was mix bump minor, but that skips a whole minor version altogether: 1.2.0-pre -> 1.3.0.

According to Semantic Versioning a pre-release version comes before a normal one:

When major, minor, and patch are equal, a pre-release version has lower precedence than a normal version:

Example: 1.0.0-alpha < 1.0.0.

Therefore a transition from 1.2.0-pre to 1.2.0 is technically a version bump.

It would be nice to be able to do this with Versioce without resorting to shell scripting.

I'd give it a try implementing this myself, but I need advice how would you like the CLI command for such a case to look like.

@mpanarin
Copy link
Owner

Hey 👋

Thanks for opening an issue and using Versioce. Makes sense, will look into that

Currently you can achieve what you need with mix bump 1.2.0

@kaharlichenko
Copy link
Author

Thank you for the tip. The thing is, it would still force me to use shell scripting to extract that 1.2.0 part from the current pre-release version.

While the rest of the cases can be handled with a single mix task invocation, for 2b I'd need to resort to something like this:

mix bump "$(mix bump.version | cut -d- -f1)"

It would be nice to have a single mix command to achieve the same result.

@mpanarin mpanarin added this to the v3.0.0 milestone Mar 13, 2024
@mpanarin mpanarin linked a pull request Mar 13, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants