Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 304
Add --exact option to bump, to force it to honor the increment for prereleases#981
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
chadrik commented Feb 5, 2024 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
ae0c133 to 66896bcComparechadrik commented Feb 5, 2024
For the record, I'm thinking of wrapping up some of the functionality from my gitlfow autopilot demo into a |
codecovbot commented Feb 5, 2024 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@## master #981 +/- ## ========================================== + Coverage 97.33% 97.44% +0.11% ========================================== Files 42 55 +13 Lines 2104 2392 +288 ========================================== + Hits 2048 2331 +283 - Misses 56 61 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
9779ee4 to 255878cComparewoile commented Feb 6, 2024
Hey, I'll have to read this in detail once I'm no longer sick. I would like to hear the thoughts from @noirbizarre@Lee-W@jenstroeger |
Lee-W commented Feb 6, 2024
We have a longer holiday in the following week. I think I'll have some time to check |
Lee-W left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @chadrik , thanks for your great contribution! I'm good with the overall implementation. But I'm not sure whether we should name this argument as exact. I'm not able to understand it even after reading it for a while. Would it be possible for us to come up with a more descriptive name? @woile@noirbizarre would appreciate if you have some idea on this one.
Also we might need some documentation and examples for this chanhge
commitizen/cli.py Outdated
| "action": "store_true", | ||
| "help": ( | ||
| "treat the increment and prerelease arguments " | ||
| "explicitly. Disables logic that attempts to deduce " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| "explicitly. Disables logic that attempts to deduce " | |
| "explicitly. Disables logic that attempts to deduce " |
chadrik commented Feb 16, 2024 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
What this flag does is apply the exact changes that have been specified (or determined from the commit log). For example, Here are some new examples that I think are illustrative of the new behavior: The second to last example is particularly interesting. without Here are some other potential names:
I'm open to ideas! |
Lee-W commented Feb 18, 2024 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
This is helpful! It would be great if we could add these examples somewhere in |
noirbizarre commented Feb 18, 2024
Sorry, I'm on a trip without computer and with very limited connectivity. I'll be able to review it next week. |
noirbizarre commented Feb 18, 2024
Forgot to say, this seems helpful and I'm totally okay with it. |
255878c to 9f7b3d4Comparechadrik commented Feb 18, 2024
I made some updates:
|
9f7b3d4 to 1d66c3dCompareWhen bumping a prerelease to a new prerelease, honor the detected increment and preserve the prerelease suffix, rather than bumping to the next non-prerelease version
This avoids calls to git and additional validations that are not necessary when using --increment
This provides some future proofing for implementing new version progression behaviors
e6da5df to 4d666cbComparechadrik commented Feb 20, 2024 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Note: I changed the This provides some future proofing for implementing new version progression behaviors, since this is a subjective area with plenty of room for valid and differing opinions. For example, if someone creates an issue complaining about how the linear progression change introduced in #799 broke backward compatibility for them, it would be possible to implement a "legacy" mode. I could also foresee a "gitflow" mode that determines |
chadrik commented Feb 23, 2024
nudge |
woile left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really good idea, I like the new naming, and the docs. Code looks good.
I'll merge Monday if there are no other comments 👍🏻
Lee-W commented Feb 26, 2024
Sounds good! I'm traveling these days, but i've checked before the minor fixes. I think I'm good with merging it as well! |
Description
PR #799 just merged which adds some nuance to prerelease bumping by improving the default logic for when to bump major versions and prerelease suffixes. While this is an improvement over the original logic, it's still very prescriptive and I think there's room for debate over whether this is a one-size-fits-all solution. There are scenarios where more control is required.
This PR adds
bump --exactto honor the increment when a prerelease suffix is present, which provides the user with more control rather utilizing the current approach with its various edge cases.I made this change in support of a gitflow-on-autopilot workflow (demo here) using the common set of 3 branches:
develop,staging,master. In this autopilot workflow, when a sprint ends and it's time to create a new release, all of the branches merge to the right (develop→staging→master), anddevelopis restarted for the next round of beta development. When restarting beta, I wantcz bump --increment MINOR --prelease betato increment to1.0.0b5 → 1.1.0b0Here's a sample git graph:
Checklist
./scripts/formatand./scripts/testlocally to ensure this change passes linter check and testExpected behavior
These tests cases compare the behavior with and without
exact:Steps to Test This Pull Request
Additional context