Skip to content

Not rewriting config file when bumping#162

Closed
balrok wants to merge 4 commits intoc4urself:masterfrom
balrok:bump-config
Closed

Not rewriting config file when bumping#162
balrok wants to merge 4 commits intoc4urself:masterfrom
balrok:bump-config

Conversation

@balrok
Copy link
Contributor

@balrok balrok commented Oct 2, 2020

Since pr #90 stalled, I fixed the missing tests. By doing that, it also uncovered some regressions.

  1. when current_version did not exist in .bumpversion.cfg, it will not be created:
  • when retrieving the version from the git tag
  • when retrieving the version via --current_version flag
  1. when .bumpversion.cfg contains a "new_version" field, previously this
    field was removed, but with this change it is not possible anymore

Solutions:
Not staying backwards compatible, because:

  1. is a relatively uncommon, once this case happens the file has the "current_version" written afterwards, so it might not affect many
  2. even if there is a use-case for this, it can be easily migrated to print an error when new_version is found in the config and recommend "--new_version="

Staying backwards compatible, but being less intuitive:
Additionally, write the file whenever case 1 or 2 is true. This can be implemented by letting _load_configuration return a boolean.

This would solve:

albireox and others added 4 commits October 2, 2020 22:00
there are backwards incompatible changes right now:
* when current_version did not exist in .bumpversion.cfg, it will not be created:
  * when retrieving the version from the git tag
  * when retrieving the version via --current_version flag
* when .bumpversion.cfg contains a "new_version" field, previously this
  field was removed, but with this change it is not possible anymore
@balrok
Copy link
Contributor Author

balrok commented Oct 4, 2020

I found a third option, which avoids breaking backwards comaptibility. Closing it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants