From 3d6e8405639af0deca590b6a4d77f0b9308f1547 Mon Sep 17 00:00:00 2001 From: Wu Sheng Date: Wed, 12 Aug 2026 15:32:55 +0800 Subject: [PATCH] Prompt for the next milestone ID when resetting CHANGES.md When cmd_prepare resets CHANGES.md for the next development version it wrote a literal placeholder: All issues and pull requests are [here](https://github.com/apache/skywalking/milestone/xxx?closed=1) Nothing in the release flow ever filled that in, so the placeholder rode the release PR into main unless someone noticed and edited it by hand, leaving the next version's change log pointing at a dead milestone link. Ask for the milestone ID instead. The prompt is raised up front, next to the version confirmation, rather than after release:prepare, so the release does not stop for input in the middle of a multi-minute build. The answer is validated as numeric and cross-checked against the milestone's title on apache/skywalking, so a typo or a stale ID (for example last release's milestone) is reported before anything is committed. NEXT_MILESTONE= answers non-interactively for scripted runs, and a blank answer keeps the old placeholder behaviour but now warns. gh api writes its error body to stdout on failure, so the title lookup gates on gh's exit status; otherwise a 404 payload would be reported as the milestone name. Co-Authored-By: Claude Opus 5 (1M context) --- docs/en/contribution/release-java-agent.md | 8 +++++ tools/releasing/release.sh | 36 +++++++++++++++++++++- 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/docs/en/contribution/release-java-agent.md b/docs/en/contribution/release-java-agent.md index 5b941a822c..9555ac786a 100644 --- a/docs/en/contribution/release-java-agent.md +++ b/docs/en/contribution/release-java-agent.md @@ -76,6 +76,14 @@ Then run `gpgconf --kill gpg-agent` and `gpg --sign /dev/null` to cache it. 4. **upload** — upload to Apache SVN `dist/dev` (prompts for SVN credentials) 5. **email vote** — print vote email template with pre-filled version, commit ID, submodule commit, and checksums +Before the long build starts, **prepare** asks for the GitHub milestone ID of the next +development version, which it writes into the reset `CHANGES.md`. Look up the +`Java - ` milestone at https://github.com/apache/skywalking/milestones and +enter its number. The ID is checked against that milestone's title, and you are warned if +they disagree. Set `NEXT_MILESTONE=` to answer non-interactively; leave the prompt +blank to keep the `milestone/xxx` placeholder and edit it by hand before merging the +release PR. + Copy the generated email and send it to `dev@skywalking.apache.org`. Voting remains open for at least 72 hours. At least 3 (+1 binding) PMC votes with more +1 than -1 are required. ## Vote Check diff --git a/tools/releasing/release.sh b/tools/releasing/release.sh index 22c200dc46..92fe6fb68d 100755 --- a/tools/releasing/release.sh +++ b/tools/releasing/release.sh @@ -160,6 +160,40 @@ cmd_prepare() { echo " Tag: v${version}" echo " Next dev version: ${next_version}-SNAPSHOT" echo " Branch: ${branch_name}" + echo "" + + # At the end of this step CHANGES.md is reset for the next development + # version, and its milestone link needs that version's GitHub milestone ID. + # Ask for it here, up front, so the release does not stop for input after + # the long release:prepare build. Set NEXT_MILESTONE= to skip the prompt. + local next_milestone="${NEXT_MILESTONE:-}" + if [ -z "$next_milestone" ]; then + echo " CHANGES.md will be reset for ${next_version}, and its milestone link needs an ID." + echo " Find 'Java - ${next_version}' at https://github.com/apache/skywalking/milestones" + read -rp " Milestone ID for ${next_version} (number, or blank to fill in manually later): " next_milestone + fi + if [ -n "$next_milestone" ]; then + case "$next_milestone" in + *[!0-9]*) error "Milestone ID must be a number, got: ${next_milestone}" ;; + esac + # gh api writes the error body to stdout on failure, so gate on its + # exit status rather than letting a 404 payload become the title. + local milestone_title + if ! milestone_title=$(gh api "repos/apache/skywalking/milestones/${next_milestone}" -q .title 2>/dev/null); then + milestone_title="" + fi + if [ -z "$milestone_title" ]; then + warn " Could not verify milestone ${next_milestone} on apache/skywalking; using it as given." + elif [ "$milestone_title" != "Java - ${next_version}" ]; then + warn " Milestone ${next_milestone} is '${milestone_title}', expected 'Java - ${next_version}'. Double-check it." + else + info " Next milestone: ${next_milestone} (${milestone_title})" + fi + else + next_milestone="xxx" + warn " No milestone ID given; CHANGES.md will keep 'milestone/xxx' - edit it before merging the release PR." + fi + echo "" read -rp "Continue? [y/N] " confirm if [[ ! "$confirm" =~ ^[Yy]$ ]]; then @@ -208,7 +242,7 @@ ${next_version} ------------------ -All issues and pull requests are [here](https://github.com/apache/skywalking/milestone/xxx?closed=1) +All issues and pull requests are [here](https://github.com/apache/skywalking/milestone/${next_milestone}?closed=1) ------------------ Find change logs of all versions [here](changes).