Skip to content

On branch edburns/dd-2794379-cosmetic-post-public-fixes Support adr-002 version number scheme.#11

Merged
edburns merged 2 commits intomainfrom
edburns/dd-2794379-cosmetic-post-public-fixes
Mar 17, 2026
Merged

On branch edburns/dd-2794379-cosmetic-post-public-fixes Support adr-002 version number scheme.#11
edburns merged 2 commits intomainfrom
edburns/dd-2794379-cosmetic-post-public-fixes

Conversation

@edburns
Copy link
Collaborator

@edburns edburns commented Mar 17, 2026

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.P version numbers (e.g., 1.0.0). With ADR-002's -java.N qualifier (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". On 0.1.32-java.0, PATCH would become 32-java, causing $((PATCH + 1)) to fail.

Fix: Extract BASE_VERSION (the M.M.P portion) via grep -oE, extract the QUALIFIER (e.g., -java.0) via sed, split only the base, then reassemble: ${MAJOR}.${MINOR}.${NEXT_PATCH}${QUALIFIER}-SNAPSHOT.

2. publish-maven.yml — sed regexes for README.md / jbang-example.java (lines 115–123)

The sed patterns [0-9]*\.[0-9]*\.[0-9]* wouldn't match the trailing -java.0 qualifier, 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-style 1.0.0 tags and new 0.1.32-java.0 tags.

3. publish-maven.yml — PREV_TAG grep (line 196)

The grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' filter would exclude any tag with a -java.N suffix, 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.N version links and fail to insert new ones correctly.

Fix: Added (-java\.[0-9]+)? to all four patterns. Existing bare M.M.P links (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.0 qualifier), while the Maven XML example already had the correct 0.1.32-java.0.

Fix: Changed to copilot-sdk-java:0.1.32-java.0.

How to trigger the first release

Workflow: publish-maven.yml → Run workflow
  releaseVersion:      0.1.32-java.0
  developmentVersion:  (leave empty — auto-computes 0.1.33-java.0-SNAPSHOT)

Testing

  • All existing M.M.P version strings (e.g., [1.0.11]:) continue to match the updated regexes — no existing CHANGELOG content is invalidated.
  • The sed BRE patterns and awk regexes were verified against both 1.0.0 and 0.1.32-java.0 formats.

Related

  • ADR-002: Maven version and reference implementation tracking

…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>
Copilot AI review requested due to automatic review settings March 17, 2026 00:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.yml dev-version auto-increment to handle -java.N qualifiers and updates tag/version regexes used during release creation.
  • Updates update-changelog.sh awk patterns so changelog link handling matches both qualified and unqualified versions.
  • Corrects the README Gradle dependency example to include the required -java.0 qualifier.

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>
@edburns edburns merged commit f01f466 into main Mar 17, 2026
5 checks passed
@edburns edburns deleted the edburns/dd-2794379-cosmetic-post-public-fixes branch March 17, 2026 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants