You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Forcing the next version to be a (patch|minor|major) release always uses the highest existing tag #1392
When running the version command 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.1 as the new version.
Is this expected behavior?
Configuration
Semantic Release Configuration
[tool.semantic_release.branches.main]
match = "(main|master)"prerelease_token = "rc"prerelease = false
[tool.semantic_release.branches.hotfix]
match = "hotfix/*"prerelease_token = "rc"prerelease = false
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!
"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 insteadwithRepo(str(runtime.repo_dir)) asgit_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_bumpdefnext_version(
repo: Repo,
# ...forced_level_bump: LevelBump|None=None,
) ->Version:
# ...# Step 3A. Early exit if we're force bumping the versionifforced_level_bumpandlatest_version:
next_version=latest_version.bump(forced_level_bump)
logger.info(f"Forced bump from {latest_version} to {next_version}")
returnnext_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?
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?
Activity
codejedi365 commentedon Dec 13, 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!somnolik commentedon Dec 14, 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:
github-actions commentedon Mar 15, 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?
nwns commentedon Jul 3, 2026
This also seems to affect
--prereleaseThis is with both 9.21.1 and 10.5.3.
github-actions commentedon Oct 2, 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?