Skip to content

fix: prevent prerelase from creating a bump when there are no commits #307

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

Merged
merged 1 commit into from
Nov 21, 2020

Conversation

woile
Copy link
Member

@woile woile commented Nov 21, 2020

Closes #281

Checklist

  • Add test cases to all the changes you introduce
  • Run ./script/format and ./script/test locally to ensure this change passes linter check and test
  • Test the changes on the local machine manually

Steps to Test This Pull Request

Described in the issue

Additional context

This issue can only be triggered if there are commits but they are not elegible for an increment.

  • let's say tag exists 0.1.0
  • a new commit is created "ci: update job name"
  • cz bumo -pr alpha is executed
  • commitizen will find commits, but no increment, thus triggering the bug that happens afterwards.

@codecov
Copy link

codecov bot commented Nov 21, 2020

Codecov Report

Merging #307 (7bafa42) into master (720befe) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #307   +/-   ##
=======================================
  Coverage   96.96%   96.97%           
=======================================
  Files          33       33           
  Lines         924      926    +2     
=======================================
+ Hits          896      898    +2     
  Misses         28       28           
Flag Coverage Δ
unittests 96.97% <100.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
commitizen/__version__.py 100.00% <100.00%> (ø)
commitizen/commands/bump.py 94.44% <100.00%> (+0.12%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d42f744...7bafa42. Read the comment docs.

@woile woile marked this pull request as draft November 21, 2020 14:04
@woile
Copy link
Member Author

woile commented Nov 21, 2020

potential issue:

  • can an alpha version become a beta version with no commits? if yes, then this RP breaks that behavior

solved:
this check is only triggered when going from normal release to a pre-release, not from pre-release to pre-release.
it also provides a way to fix the issue: you can transition to pre-release with no commits, but you have to manually specify the increment using --increment.

@woile woile marked this pull request as ready for review November 21, 2020 15:07
@woile woile force-pushed the 281-prerelease-bug branch from fda3017 to 7bafa42 Compare November 21, 2020 15:08
@woile woile merged commit ef15316 into master Nov 21, 2020
@woile woile deleted the 281-prerelease-bug branch November 21, 2020 15:13
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 this pull request may close these issues.

Prevent Prerelease 'Bump' From Release Version With No Increment Detected
1 participant