[Misc] Compare a branch's plugin version against its merge base, not master's tip - #100
Merged
Merged
Conversation
…master's tip * Invariant 6 asked whether the branch's version differed from origin/master's tip, which answers the wrong question now that master keeps releasing while a branch is open: a branch that forked at 1.1.7 and never touched a version field still differs from a master that has reached 1.5.1, so every long-lived PR was told to revert a bump it never made. Compare against the merge base instead, which is what "did this branch change the version?" actually means. * Name the merge base and its version in the failure message, so the fix is unambiguous on a branch whose fork point is far behind. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Jira URL
None —
[Misc], follow-up to #99.Changes
Description
Invariant 6 (added in #99) compared the branch's five version fields against
origin/master'stip. That answers the wrong question, now that
masterkeeps releasing while a branch is open: abranch that forked when the version was
1.1.7and never touched a version field still differsfrom a master that has since reached
1.5.1, so it would be told to revert a bump it never made.Compare against the merge base instead — the point where the branch forked — which is what "did
this branch change the version?" actually means. The failure message now also names the merge base
and the version it expects, since on a stale branch that value is not obvious.
Clarifications
Found while stripping the version bumps out of the five open PRs (#18, #77, #81, #94, #98), whose
fork points range from
1.1.7to1.5.0against a master now at1.5.1. Without this fix, everyone of them would have gone red the moment its bump was removed — the exact opposite of the intent.
scripts/release.mjsis unaffected: it measures from the last release tag, not from a branch.Screenshots & Video
Verified against the real PR #18 branch (fork point
986ed9f, version1.1.7) with master at1.5.1. As the PR stands today, having bumped the version:And with the bump removed, i.e. the version left at its fork-point value of
1.1.7while master says1.5.1— this is the case that was previously a false failure:Executed Tests
Plus the two cases above, run against the real
pull/18/headin a throwaway clone withorigin/masterpointed at the current master, so nothing was pushed anywhere.
Nothing under
xwiki/changes here, so this correctly triggers no release.Expected merging strategy
Prefers squash: Yes. No backport branches.
🤖 Generated with Claude Code