Conversation
…02 version number scheme. modified: .github/scripts/release/update-changelog.sh modified: .github/workflows/publish-maven.yml modified: README.md Signed-off-by: Ed Burns <edburns@microsoft.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the release automation and documentation to fully support ADR-002’s Maven version scheme (M.M.P-java.N) across the Maven publish workflow and changelog tooling, preventing version parsing/substitution failures during release.
Changes:
- Fixes
publish-maven.ymldev-version auto-increment to handle-java.Nqualifiers and updates tag/version regexes used during release creation. - Updates
update-changelog.shawk patterns so changelog link handling matches both qualified and unqualified versions. - Corrects the README Gradle dependency example to include the required
-java.0qualifier.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| README.md | Updates Gradle dependency example to use 0.1.32-java.0. |
| .github/workflows/publish-maven.yml | Makes version parsing/substitution and previous-tag detection compatible with -java.N versions. |
| .github/scripts/release/update-changelog.sh | Extends version-link regex matching to handle -java.N changelog link formats. |
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.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.
Fix release workflow and docs for ADR-002 version scheme (
M.M.P-java.N)Problem
The publish-maven.yml workflow and update-changelog.sh script assumed bare
M.M.Pversion numbers (e.g.,1.0.0). With ADR-002's-java.Nqualifier (e.g.,0.1.32-java.0), several operations would break on the first release from this repository.Changes
1. publish-maven.yml — Dev-version auto-increment (lines 84–91)
The auto-computed next development version used
IFS='.' read -r MAJOR MINOR PATCH <<< "$RELEASE_VERSION". On0.1.32-java.0,PATCHwould become32-java, causing$((PATCH + 1))to fail.Fix: Extract
BASE_VERSION(theM.M.Pportion) viagrep -oE, extract theQUALIFIER(e.g.,-java.0) viased, split only the base, then reassemble:${MAJOR}.${MINOR}.${NEXT_PATCH}${QUALIFIER}-SNAPSHOT.2. publish-maven.yml —
sedregexes for README.md / jbang-example.java (lines 115–123)The
sedpatterns[0-9]*\.[0-9]*\.[0-9]*wouldn't match the trailing-java.0qualifier, so version substitution in docs would silently fail or leave stale versions.Fix: Use BRE with an optional group:
[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\(-java\.[0-9][0-9]*\)\{0,1\}. This matches both old-style1.0.0tags and new0.1.32-java.0tags.3. publish-maven.yml —
PREV_TAGgrep (line 196)The
grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$'filter would exclude any tag with a-java.Nsuffix, making the GitHub release notes "since previous tag" logic unable to find the prior release.Fix: Extend to
'^v[0-9]+\.[0-9]+\.[0-9]+(-java\.[0-9]+)?$'.4. update-changelog.sh — Four awk patterns (lines 56, 90–91, 103)
The awk regexes that match version link lines (
[1.0.11]:,[Unreleased]:compare URL) used[0-9]+\.[0-9]+\.[0-9]+without the optional qualifier. This would cause the script to miss existing-java.Nversion links and fail to insert new ones correctly.Fix: Added
(-java\.[0-9]+)?to all four patterns. Existing bareM.M.Plinks (e.g.,[1.0.11]:) still match because the suffix is optional.5. README.md — Gradle dependency line (line 63)
The Gradle example had
copilot-sdk-java:0.1.32(missing the-java.0qualifier), while the Maven XML example already had the correct0.1.32-java.0.Fix: Changed to
copilot-sdk-java:0.1.32-java.0.How to trigger the first release
Testing
M.M.Pversion strings (e.g.,[1.0.11]:) continue to match the updated regexes — no existing CHANGELOG content is invalidated.sedBRE patterns and awk regexes were verified against both1.0.0and0.1.32-java.0formats.Related