Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(bump): manual version bump if prerelease offset is configured #1358

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

Conversation

Copy link
Contributor

@ckagerer ckagerer commented Feb 17, 2025
edited
Loading

Description

If a prerelease offset is configured (I introduced this about 2 years ago with PR #614), no bump is possible with the manual version.
To do this, the configuration must first be changed and then reset after the bump.

For this reason, it makes more sense to remove the check that prevents the manual bump.

Checklist

  • Add test cases to all the changes you introduce
    • I'm not sure where best to cover this case. Please give me a hint in which existing test file I could extend this.
  • Run poetry all locally to ensure this change passes linter check and test
  • Test the changes on the local machine manually
  • (削除) Update the documentation for the changes (削除ここまで)

Expected behavior

Bumping a manual version works without changing the configuration file.

Steps to Test This Pull Request

  1. Use the follwoing Configuration
[tool.commitizen]
changelog_incremental = true
tag_format = "v$version"
update_changelog_on_bump = true
version = "1.2.0b13"
prerelease_offset = 1
  1. cz bump 9.8.7

Additional context

@ckagerer ckagerer force-pushed the fix/manual-version-with-prerelease-offset-in-config branch from 9377d32 to 89677ae Compare February 17, 2025 15:30
Copy link

codecov bot commented Feb 17, 2025
edited
Loading

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.55%. Comparing base (120d514) to head (dfd2fdf).
Report is 562 commits behind head on master.

Additional details and impacted files
@@ Coverage Diff @@
## master #1358 +/- ##
==========================================
+ Coverage 97.33% 97.55% +0.21% 
==========================================
 Files 42 55 +13 
 Lines 2104 2620 +516 
==========================================
+ Hits 2048 2556 +508 
- Misses 56 64 +8 
Flag Coverage Δ
unittests 97.55% <ø> (+0.21%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ckagerer ckagerer marked this pull request as ready for review February 17, 2025 15:45
If you use the prerelase offset in the .cz.toml, as in the following
example, no bump with a manual version number is possible.
The error occurs when bumping with manual version number:
cz bump 9.8.7
--prerelease-offset cannot be combined with MANUAL_VERSION
```toml
[tool.commitizen]
changelog_incremental = true
tag_format = "v$version"
update_changelog_on_bump = true
version = "1.2.0b13"
prerelease_offset = 1
```
@ckagerer ckagerer force-pushed the fix/manual-version-with-prerelease-offset-in-config branch from 89677ae to dfd2fdf Compare February 18, 2025 09:08
Copy link
Member

@Lee-W Lee-W left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ckagerer !

@woile @noirbizarre This PR looks good to me. I'm going to merge it this days if there's no objection

@Lee-W Lee-W added the pr-status: ready-to-merge almost ready to merge. just keep it for a few days for others to check label Feb 18, 2025
Copy link
Member

woile commented Feb 18, 2025 via email

LGTM
...
On 2025年2月18日, 07:53 Wei Lee, ***@***.***> wrote: ***@***.**** approved this pull request. Thanks @ckagerer <https://github.com/ckagerer> ! @woile <https://github.com/woile> @noirbizarre <https://github.com/noirbizarre> This PR looks good to me. I'm going to merge it this days if there's no objection — Reply to this email directly, view it on GitHub <#1358 (review)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AATXJWGCZRL32V4GBW6HOAT2QMGLZAVCNFSM6AAAAABXJTTSUWVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDMMRTGE2TMNJYG4> . You are receiving this because you were mentioned.Message ID: ***@***.***>

Copy link
Member

@noirbizarre noirbizarre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you !

@Lee-W Lee-W merged commit d831c99 into commitizen-tools:master Feb 18, 2025
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@noirbizarre noirbizarre noirbizarre approved these changes

@Lee-W Lee-W Lee-W approved these changes

@woile woile Awaiting requested review from woile woile is a code owner

Assignees
No one assigned
Labels
pr-status: ready-to-merge almost ready to merge. just keep it for a few days for others to check pr-status: wait-for-review
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /