From 30be1abb949b23dcaefee5c43704364dceb0646b Mon Sep 17 00:00:00 2001 From: Wu Sheng Date: Thu, 6 Aug 2026 10:09:48 -0700 Subject: [PATCH 1/2] Fix release script email templates linking to non-existent master branch The vote and announce email templates in tools/releasing/release.sh link the changelog at blob/master/changes/changes-x.y.z.md, but the default branch of this repository is main, so those links 404. Co-Authored-By: Claude Opus 5 (1M context) --- tools/releasing/release.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/releasing/release.sh b/tools/releasing/release.sh index 8338e60486..111e7ab885 100755 --- a/tools/releasing/release.sh +++ b/tools/releasing/release.sh @@ -397,7 +397,7 @@ This is a call for vote to release Apache SkyWalking Java Agent version ${versio Release notes: - * https://github.com/apache/skywalking-java/blob/master/changes/changes-${version}.md + * https://github.com/apache/skywalking-java/blob/main/changes/changes-${version}.md Release Candidate: @@ -457,7 +457,7 @@ the previous version. The notable changes include: 3. ... Please refer to the change log for the complete list of changes: -https://github.com/apache/skywalking-java/blob/master/changes/changes-${version}.md +https://github.com/apache/skywalking-java/blob/main/changes/changes-${version}.md Apache SkyWalking website: http://skywalking.apache.org/ From 21ea81834779ebc19e1174d6bf181f35d1b31053 Mon Sep 17 00:00:00 2001 From: Wu Sheng Date: Thu, 6 Aug 2026 10:29:23 -0700 Subject: [PATCH 2/2] Fix changelog archiving in release script Two bugs in the "Move changelog" step of cmd_prepare made it fail or silently produce a near-empty changes/changes-x.y.z.md: 1. `head -n -1` (all but the last line) is a GNU coreutils extension. BSD head on macOS rejects a negative count, and with `set -euo pipefail` the release aborted right after `mvn release:prepare` had already created the commits and the tag: [INFO] Moving changelog to changes/changes-9.7.0.md... head: illegal line count -- -1 2. The extraction range was wrong on every platform: sed -n "/^9.7.0$/,/^------------------$/p" CHANGES.md In CHANGES.md the `------------------` underline sits directly beneath the version number, so the range closes on the very next line and yields only 2 lines. Even with GNU head the archived changelog would have been the version number plus the milestone link, with the entire body dropped. Replace both with a single POSIX sed address that keeps everything up to and including the milestone link and drops only the trailing "Find change logs of all versions" footer, which is exactly the existing changes-9.6.0.md layout. Guard on the milestone line being present, and report the line count so a truncated archive is visible in the release output. Co-Authored-By: Claude Opus 5 (1M context) --- tools/releasing/release.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/releasing/release.sh b/tools/releasing/release.sh index 111e7ab885..22c200dc46 100755 --- a/tools/releasing/release.sh +++ b/tools/releasing/release.sh @@ -189,10 +189,14 @@ cmd_prepare() { info "Moving changelog to changes/changes-${version}.md..." local changes_file="changes/changes-${version}.md" - # Extract current version section from CHANGES.md - sed -n "/^${version}$/,/^------------------$/p" CHANGES.md | head -n -1 > "$changes_file" - grep "All issues and pull requests" CHANGES.md >> "$changes_file" || true - info "Created $changes_file" + # Archive CHANGES.md as the release changelog: everything up to and including + # the milestone link, dropping only the trailing "Find change logs of all + # versions" footer. Uses POSIX sed addressing so it works on BSD and GNU alike. + if ! grep -q "All issues and pull requests" CHANGES.md; then + error "CHANGES.md has no 'All issues and pull requests' milestone line; cannot archive changelog." + fi + sed -n '1,/All issues and pull requests/p' CHANGES.md > "$changes_file" + info "Created $changes_file ($(wc -l < "$changes_file" | tr -d ' ') lines)" # Reset CHANGES.md for next development version cat > CHANGES.md << EOF