Repository navigation
fix(algorithm): ignore unreleased commit/revert pairs - #1506
Open
Aschenbath wants to merge 4 commits into
Open
Aschenbath wants to merge 4 commits into
Aschenbath wants to merge 4 commits into
Conversation
This branch has not been deployed
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
A breaking change followed by its revert can still trigger a major release even when neither commit has been released. Ignore an unambiguous ordinary commit/revert pair when determining the automatic next version. References #402.
Rationale
Match standard Git Revert/Reapply or conventional revert subjects with a complete commit reference inside the current release window. Process the reference graph independently of history traversal order so a revert of a revert restores the original impact. Preserve a connected group when multiple reverts point to the same target, avoiding order-dependent results.
Forced bumps, already-released targets, and historical changelog entries retain their existing behavior. Git merge reverts (git revert -m) remain outside this pairing because their impact can include commits from the merged parent history. The documentation describes these boundaries.
How did you test?
Implemented with OpenAI Codex and independently reviewed by a separate Codex agent; no human review is claimed.
How to Verify
Run the new tests in tests/unit/semantic_release/version/test_reverts.py and tests/e2e/cmd_version/test_version_reverts.py. In a tagged repository, create a breaking change, run git revert on it, and run semantic-release version --print: the existing version should remain. Revert the revert and the breaking version impact should return.
PR Completion Checklist