Restore HEAD sentinel in scm tag - #1044
Merged
Merged
Conversation
maven-release-plugin rewrites <scm><tag> during release:prepare and then restores it from pom.xml.releaseBackup in the development phase. It replays whatever the tree held before prepare ran rather than computing a correct value, so the field is a loop: whatever master holds, master keeps holding. Through v0.10.28 and the first v0.10.29 attempt the loop ran on the HEAD sentinel. The v0.10.29 cleanup commits (#1009, #1011) reverted master to a tree that still carried the release-time value v0.10.29, and the loop has replayed that stale literal ever since -- including through the v0.10.30 release, which restored v0.10.29 instead of HEAD. Left alone this is self-perpetuating, and it is a live footgun for a standalone release:perform: without release.properties the plugin resolves the checkout from the POM's <scm> section, so it would check out v0.10.29 and try to redeploy an already-published version. The stale pointer is wrong twice over, since the v0.10.29 tag itself points at e032ae1 rather than 558b87a, the commit the published 0.10.29 artifacts were built from. Restoring HEAD is self-healing: the development phase will back up HEAD and restore HEAD from now on. Also gitignore release.properties and pom.xml.releaseBackup. They are cleaned on a successful release:perform but linger after a failed one, where they can be committed by accident -- plausibly how the value got baked in originally. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1044 +/- ##
=========================================
Coverage 91.87% 91.87%
Complexity 288 288
=========================================
Files 27 27
Lines 1034 1034
Branches 90 90
=========================================
Hits 950 950
Misses 55 55
Partials 29 29 🚀 New features to boost your workflow:
|
2 of 3 tasks
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.
Summary
maven-release-pluginrewrites<scm><tag>duringrelease:prepare, then restores it frompom.xml.releaseBackupin the development phase. The restore replays whatever the tree held before prepare ran rather than computing a correct value, so the field behaves as a loop: whatever master holds, master keeps holding.Master currently holds
v0.10.29— two releases stale.How it broke
prepare releaseprepare for next devv0.10.27HEAD✅v0.10.28HEAD✅4212693)v0.10.29HEAD✅558b87a)v0.10.29v0.10.29❌e655bb2)v0.10.30v0.10.29❌The loop ran correctly on the
HEADsentinel for years. It broke during the v0.10.29 cycle: the cleanup commits (#1009, #1011) reverted master to a tree that still carried the release-time valuev0.10.29instead of the development-time sentinel, and the loop has replayed that stale literal ever since — including through v0.10.30, which restoredv0.10.29rather thanHEAD.Why it is worth fixing now
Nothing published is affected: the v0.10.30 prepare commit set
v0.10.30correctly, anddbeam-parent-0.10.30.pomon Maven Central carries<tag>v0.10.30</tag>. This is master's working state only.The exposure is a standalone
release:perform. Its checkout URL falls back torelease.propertiesand then to the POM's own<scm>section, including<tag>. In the normalrelease:prepare release:performinvocationrelease.propertiesexists with the rightscm.tagand the POM value is never consulted — but retrying a failed deploy afterrelease:clean, splitting prepare and perform into separate CI jobs, or performing from a fresh checkout would resolve the tag from the POM, check out v0.10.29, and try to redeploy an already-published version.The pointer is wrong twice over: the
v0.10.29tag itself points ate032ae1, while the published 0.10.29 artifacts were built from558b87a(the Central pom containscentral-publishing-maven-plugin, which only landed in05add13/ #1012).Restoring
HEADis self-healing — the development phase will back upHEADand restoreHEADfrom here on. Worth landing before 0.10.31 is cut, so that cycle does not re-bake the stale value.Also
release.propertiesandpom.xml.releaseBackupare now gitignored. They are cleaned on a successfulrelease:performbut linger after a failed one, where they can be committed by accident — plausibly how the value got baked in originally.Test plan
xmllint --noout pom.xml— well-formed<scm><tag>is the only occurrence in the tree;dbeam-coreanddbeam-bomhave no<scm>block and inherit from the parent<tag>HEAD</tag>on master after the development-phase commit🤖 Generated with Claude Code