fix(cmd-version): scope forced bumps to branch history - #1469
Open
floze-the-genius wants to merge 2 commits into
Open
fix(cmd-version): scope forced bumps to branch history#1469floze-the-genius wants to merge 2 commits into
floze-the-genius wants to merge 2 commits into
Conversation
Resolves: python-semantic-release#1392 Signed-off-by: Floze <88098863+floze-the-genius@users.noreply.github.com>
Resolves: python-semantic-release#1392 Signed-off-by: Floze <88098863+floze-the-genius@users.noreply.github.com>
Author
|
The remaining Python 3.14 E2E failure appears unrelated to this change: the new forced-bump regression and the shallow-repository test both passed, while two existing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Fixes #1392.
Forced
version --patch,--minor,--major, and--prereleasecalculations now use only release tags reachable from the active branch. A higher tag on a divergent branch no longer causes maintenance or hotfix branches to over-bump.Rationale
The dynamic
next_version()path already filtered tags against the active branch history, butversion_from_forced_level()calledtags_and_versions()directly and therefore selected the highest semantic version anywhere in the repository.This change extracts the existing reachability filter into
tags_and_versions_in_history()and reuses it for both dynamic and forced calculations. Shallow repositories retain the previous tag-name behavior when the graph is intentionally unavailable, such as--noopreporting an unshallow operation.How did you test?
v1.0.0tag on a divergent branch and verifiedversion --print --patchreturns0.1.2from the active branch'sv0.1.1history.masterwith1.0.1before the fix.4264 passed, 15 skipped.265 passed, 708 skipped.How to Verify
AI Assistance Disclosure
OpenAI Codex was used to investigate the issue, implement the change, and run the validation workflow. The final diff and test results were reviewed during the contribution process.
DCO
Both commits include a
Signed-off-bytrailer.PR Completion Checklist