Repository navigation
Forcing the next version to be a (patch|minor|major) release always uses the highest existing tag #1392
Description
Activity
- addedtriagewaiting for initial maintainer reviewwaiting for initial maintainer review
on Dec 12, 2025 It is the expected behavior from some flawed code! I identified a similar bug with the approach of prereleases and fixed that a while back but it's still exists around the
tags_and_releases()function in which the force bump relies on. I have a larger refactor that fixes the internal function but I didn't realize it was connected to the force bump until you opened this issue. Thanks!Reacted by Stefan Karner- addedbugSomething isn't working properlySomething isn't working properlyconfirmedPrevent from becoming stalePrevent from becoming staleand removedtriagewaiting for initial maintainer reviewwaiting for initial maintainer review
on Dec 13, 2025 Thank you, great to hear a fix is on the roadmap!
"Larger refactor" sounds like the fix might take a while to be mainlined though, so in the meantime, I'll be using the following hack...
I'm sure it is misbehaving in some cases and I only dipped a toe into the codebase, so this is lacking nuance, but so far it seems to work for my specific use case:# cli/commands/version.py # Remove extra handling for forced_level_bump, pass it to next_version instead with Repo(str(runtime.repo_dir)) as git_repo: new_version = next_version( repo=git_repo, # ... forced_level_bump=forced_level_bump, ) # version/algorithm.py # Early out from next_version on forced_level_bump def next_version( repo: Repo, # ... forced_level_bump: LevelBump | None = None, ) -> Version: # ... # Step 3A. Early exit if we're force bumping the version if forced_level_bump and latest_version: next_version = latest_version.bump(forced_level_bump) logger.info(f"Forced bump from {latest_version} to {next_version}") return next_version
It has been 90 days since the last update on this confirmed issue. @python-semantic-release/team can you provide an update on the status of this issue?
- addedneeds-updateNeeds status update from maintainersNeeds status update from maintainers
on Mar 15, 2026 This also seems to affect
--prereleaseThis is with both 9.21.1 and 10.5.3.
- removedneeds-updateNeeds status update from maintainersNeeds status update from maintainers
on Jul 4, 2026 It has been 90 days since the last update on this confirmed issue. @python-semantic-release/team can you provide an update on the status of this issue?
- addedneeds-updateNeeds status update from maintainersNeeds status update from maintainers
on Oct 2, 2026
Question
When running the
versioncommand on a hotfix branch, the new version is based on the tags in the hotfix branch's history. This is expected and what I want.But when doing the same with
--patch, the new version is a patch increase of the highest tag in the repo.In the log attached below, this gives
1.4.1as the new version.Is this expected behavior?
Configuration
Semantic Release Configuration
Additional context
git log --oneline --decorate --graph --all -n 50