Skip to content

Prompt for the next milestone ID when resetting CHANGES.md - #820

Closed
wu-sheng wants to merge 1 commit into
mainfrom
fix/release-script-milestone-prompt
Closed

Prompt for the next milestone ID when resetting CHANGES.md#820
wu-sheng wants to merge 1 commit into
mainfrom
fix/release-script-milestone-prompt

Conversation

@wu-sheng

Copy link
Copy Markdown
Member

Problem

When cmd_prepare resets CHANGES.md for the next development version, it writes a
literal placeholder that nothing ever fills in:

All issues and pull requests are [here](https://github.com/apache/skywalking/milestone/xxx?closed=1)

The release flow has no step that resolves xxx, so unless the release manager
spots it and edits by hand, the placeholder rides the release PR straight into
main and the next version's change log ships pointing at a dead milestone link.

This was hit while preparing 9.7.0 and had to be corrected manually on the release
branch.

Fix

Ask for the milestone ID and substitute it.

  • Asked up front, next to the version confirmation, rather than after
    release:prepare — so the release doesn't stop for input in the middle of a
    multi-minute build.
  • Validated as numeric, and cross-checked against the milestone's title on
    apache/skywalking. Entering last release's ID by mistake is reported before
    anything is committed:
    [WARN]   Milestone 249 is 'Java - 9.7.0', expected 'Java - 9.8.0'. Double-check it.
    
  • NEXT_MILESTONE=<id> answers non-interactively for scripted runs.
  • A blank answer keeps the previous placeholder behaviour, but now warns rather
    than doing it silently.

gh api writes its error body to stdout on failure, so the title lookup gates on
gh's exit status — otherwise a 404 JSON payload would be reported as the milestone
name.

Testing

bash -n passes. All five input paths exercised against the live GitHub API:

Input Result
263 (correct) [INFO] Next milestone: 263 (Java - 9.8.0)
249 (last release's) [WARN] Milestone 249 is 'Java - 9.7.0', expected 'Java - 9.8.0'
999999 (nonexistent) [WARN] Could not verify milestone 999999; using it as given
26x3 (non-numeric) [ERROR] Milestone ID must be a number — aborts
blank [WARN] ... will keep 'milestone/xxx'

The generated CHANGES.md is byte-identical to the hand-written correction made on
the 9.7.0 release branch (diff clean).

🤖 Generated with Claude Code

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=<id> 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) <noreply@anthropic.com>
@wu-sheng

Copy link
Copy Markdown
Member Author

Folded into #821 along with the tag-based version fix, so the release-tooling changes land together. The commit is preserved there via cherry-pick.

@wu-sheng wu-sheng closed this Aug 12, 2026
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.

1 participant