Fix release script: changelog archiving and master-branch links - #818
Open
wu-sheng wants to merge 2 commits into
Open
Fix release script: changelog archiving and master-branch links#818wu-sheng wants to merge 2 commits into
wu-sheng wants to merge 2 commits into
Conversation
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) <noreply@anthropic.com>
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) <noreply@anthropic.com>
mrproliu
approved these changes
Aug 6, 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.
Two fixes to
tools/releasing/release.sh, both hit while preparing 9.7.0.1. Changelog archiving was broken (release-blocking)
The "Move changelog" step of
cmd_prepareaborted the release on macOS, aftermvn release:preparehad already created the commits and the tag:There were two independent bugs in that one block:
a.
head -n -1is GNU-only. "All but the last line" is a GNU coreutilsextension; BSD
headon macOS rejects a negative count. Combined withset -euo pipefail, the release stopped mid-way.b. The sed range was wrong on every platform.
sed -n "/^${version}$/,/^------------------$/p" CHANGES.mdIn
CHANGES.mdthe------------------underline sits directly beneath theversion number, so the range closes on the very next line and matches only 2
lines. Even on Linux with GNU
head, the archivedchanges-x.y.z.mdwouldhave been the version number plus the milestone link, with the entire
changelog body silently dropped.
Both are replaced 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:
This reproduces the existing
changes/changes-9.6.0.mdlayout exactly. Alsoadded: a guard that fails loudly if the milestone line is missing, and a line
count in the log line so a truncated archive is visible in the release output.
2. Email templates linked to a non-existent
masterbranchThe vote and announce templates linked the changelog at
https://github.com/apache/skywalking-java/blob/master/changes/changes-${version}.md.This repository's default branch is
main, so both links 404 for anyonefollowing the release vote or announcement mail. Two occurrences, in
cmd_email voteandcmd_email announce.Testing
bash -n tools/releasing/release.shpasses.CHANGES.md: produces a38-line file whose structure diffs clean against
changes/changes-9.6.0.md(only the changelog bullets and milestone number differ).
sed -i,date -d,grep -P,readlink -f,sort -V, …); none found.🤖 Generated with Claude Code