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

Add --ignore-vcs-tag for old version support purpose #207

Merged
merged 2 commits into from May 18, 2023

Conversation

unkcpz
Copy link
Contributor

@unkcpz unkcpz commented May 17, 2023

we have a use case that after the new version 23.05.0 is released, we using branch support-23.04.x for cherry-pick commits and making releases to the old version.
However, running bumpver update --set-version v23.04.2 to bump the version from old version, errors raise because of VCS version in the remote is higher:

╰─± bumpver update --set-version v23.04.4 --dry                     
INFO    - fetching tags from remote (to turn off use: -n / --no-fetch)
INFO    - Working dir version        : v23.04.2
INFO    - Latest version from VCS tag: v23.10.0a0
ERROR   - Invariant violated: New version must be greater than old version 
ERROR   -   Failed Invariant: 'v23.04.4' > 'v23.10.0a0'
ERROR   - Invalid argument --set-version='v23.04.4'

I add --ignore-version-conflicts option to CLI to skip this check, test for my package and all works as expected.

@mbarkhau
Copy link
Owner

mbarkhau commented May 17, 2023

If you have the time, there is some housekeeping still left:

  • Is there a better/shorter name you can think of?
  • Can you write a test case? I think you can base it on test/test_cli.py#L930.
  • Run scripts/update_readme_examples.py.
  • Update the CHANGELOG.md

@unkcpz unkcpz changed the title Add --ignore-version-conflict for old version support purpose Add --ignore-vcs-tag for old version support purpose May 18, 2023
@unkcpz
Copy link
Contributor Author

unkcpz commented May 18, 2023

Okay, done!
I make the ignore slightly more specific. The option is --ignore-vcs-tag which only ignores the tags fetched from the remote but still keeps validating w.r.t cfg.current_version. The test is composed by mock the get_latest_vcs_version_tag.
Need to mention that --no-fetch not working in this case since I have a new version tag locally released from another branch.

@unkcpz unkcpz force-pushed the cli/ignore-version-conflict branch from 34a464b to f8cfe6f Compare May 18, 2023 10:02
@unkcpz unkcpz force-pushed the cli/ignore-version-conflict branch from f8cfe6f to eac944c Compare May 18, 2023 10:02
@mbarkhau
Copy link
Owner

LGTM, thank you 👍

@mbarkhau mbarkhau merged commit e73ce30 into mbarkhau:master May 18, 2023
2 checks passed
@unkcpz unkcpz deleted the cli/ignore-version-conflict branch May 18, 2023 14:17
unkcpz added a commit to aiidalab/aiidalab-qe that referenced this pull request Jun 22, 2023
In order to use mbarkhau/bumpver#207 for backport compatibility support for branch `support-23.04.x`.
unkcpz added a commit to aiidalab/aiidalab-qe that referenced this pull request Jun 22, 2023
In order to use mbarkhau/bumpver#207 for backport compatibility support for branch `support-23.04.x`.
unkcpz added a commit to aiidalab/aiidalab-qe that referenced this pull request Jun 22, 2023
In order to use mbarkhau/bumpver#207 for backport compatibility support for branch `support-23.04.x`.
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.

None yet

2 participants