Fix release version replacement appending old suffixes#193
Draft
Copilot wants to merge 2 commits into
Draft
Conversation
- Fix sed patterns in publish-maven.yml to use general qualifier regex `\(-[a-z][a-z0-9-]*\.[0-9][0-9]*\)*` that matches any version qualifier format (-java.N, -java-preview.N, -beta-java.N) and also handles previously-chained invalid versions - Fix awk regex patterns in update-changelog.sh to recognize -beta-java.N in [Unreleased] and version link patterns (-(beta-)?java(-preview)?.N) - Fix duplicate [Unreleased] link bug: track unreleased_link_handled flag so the first-version-link insertion block only fires when there is no existing [Unreleased] link to update - Move [Unreleased] handler before first-version-link handler in awk so the flag is set before the later block evaluates it - Update version validation regex to accept -beta-java.N format - Fix CHANGELOG.md: remove duplicate [Unreleased] links and fix incorrect predecessor version references for 1.0.0-beta-java.2 and .3 - Fix README.md, jbang-example.java, and cookbook markdown files: replace chained invalid versions with correct 1.0.0-beta-java.3 - Fix test-update-changelog.sh: replace ((passed++)) with passed=$((passed+1)) to avoid set -e triggering on arithmetic result 0; add two new tests for beta-java format and no-duplicate-links guarantee Co-authored-by: brunoborges <129743+brunoborges@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix release version replacement appending old suffixes
Fix release version replacement appending old suffixes
May 12, 2026
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.
The release automation was generating chained artifact versions like
1.0.0-beta-java.3-beta-java.2-beta-java.1and duplicate[Unreleased]link definitions inCHANGELOG.mdbecause the version qualifier regex didn't recognize the-beta-java.Nformat.Root causes
sed patterns (
publish-maven.yml) — BRE group syntax bug:(beta-)was treated as a literal string(beta-)rather than an optional group. Pattern only matched the baseM.M.P, then the new qualifier was appended, leaving the old suffix intact:awk script (
update-changelog.sh) — Two bugs:[Unreleased]:URL regex extracted only the base version, so the new version link pointed to the wrong predecessor (e.g.,v0.3.0-java.2instead ofv1.0.0-beta-java.2).[Unreleased]:handler and the first-version-link handler could fire in the same run, each inserting a new[Unreleased]:definition.Fixes
publish-maven.yml: Replaced all sed version patterns with\(-[a-z][a-z0-9-]*\.[0-9][0-9]*\)*— matches-java.N,-java-preview.N,-beta-java.N, and also cleans up pre-existing chained versions. Updated version validation regex to accept-beta-java.N.update-changelog.sh: Extended awk version regex to(-(beta-)?java(-preview)?.[0-9]+)?; addedunreleased_link_handledflag to prevent double-insertion of[Unreleased]links; reordered the two awk blocks so the flag is set before the first-version-link block evaluates it.CHANGELOG.md: Removed 18 duplicate[Unreleased]entries; corrected predecessor links for1.0.0-beta-java.2and1.0.0-beta-java.3.README.md,jbang-example.java, cookbook*.md: Replaced chained invalid versions with correct1.0.0-beta-java.3.test-update-changelog.sh: Fixed pre-existingset -e+((passed++))bug that caused only one test to run; added tests for-beta-java.Nformat and duplicate-link prevention.Pull request checklist
mvn spotless:applyhas been run to format the codemvn clean verifypasses locallyDoes this introduce a breaking change?