Skip to content

Add changelog generation tool for GitHub milestones#13063

Open
cmcfarlen wants to merge 3 commits intoapache:masterfrom
cmcfarlen:new-changelog-tool
Open

Add changelog generation tool for GitHub milestones#13063
cmcfarlen wants to merge 3 commits intoapache:masterfrom
cmcfarlen:new-changelog-tool

Conversation

@cmcfarlen
Copy link
Copy Markdown
Contributor

Replaces tools/git/changelog.pl with a Python implementation that generates changelogs from merged PRs in a milestone using the GitHub API or gh CLI. Default output matches the existing CHANGELOG-* file format. The --doc mode includes merge SHAs, labels, and full PR descriptions to guide AI-assisted release documentation updates. Supports text and YAML output formats.

Replaces tools/git/changelog.pl with a Python implementation
that generates changelogs from merged PRs in a milestone using
the GitHub API or gh CLI. Default output matches the existing
CHANGELOG-* file format. The --doc mode includes merge SHAs,
labels, and full PR descriptions to guide AI-assisted release
documentation updates. Supports text and YAML output formats.

Co-Authored-By: Claude <noreply@anthropic.com>
@cmcfarlen cmcfarlen added this to the 11.0.0 milestone Apr 6, 2026
@cmcfarlen cmcfarlen self-assigned this Apr 6, 2026
@cmcfarlen cmcfarlen added the Tools label Apr 6, 2026
@cmcfarlen
Copy link
Copy Markdown
Contributor Author

hmm, the uv.lock file is making the RAT check mad. Should I remove uv.lock?

Replace reference to tools/git/changelog.pl with the new
tools/changelog/changelog.py invocation using uv run.

Co-Authored-By: Claude <noreply@anthropic.com>
@bneradt
Copy link
Copy Markdown
Contributor

bneradt commented Apr 7, 2026

hmm, the uv.lock file is making the RAT check mad. Should I remove uv.lock?

I think it's recommended to add uv.lock to ensure the exact packages are added. Let's add it back. The problem wasn't your patch adding the lock, the problem is the RAT check incorrectly failing on the lock file. I'll update CI to allow it.


Update

#13066

@cmcfarlen cmcfarlen force-pushed the new-changelog-tool branch from 2b949cf to 44f4931 Compare April 8, 2026 20:40
Copy link
Copy Markdown
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

This PR introduces a new Python-based changelog generator under tools/changelog/ to produce CHANGELOG-*-style output from GitHub milestones (via direct REST API calls or the gh CLI), and updates the release-process documentation to use it.

Changes:

  • Add tools/changelog/changelog.py with text/YAML output and an extended --doc mode for richer metadata.
  • Add tools/changelog/pyproject.toml and tools/changelog/uv.lock for dependency management/execution via uv.
  • Update release-process docs to use the new tool (with --use-gh).

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 7 comments.

File Description
tools/changelog/changelog.py Implements milestone PR collection via REST API or gh, plus output formatting.
tools/changelog/pyproject.toml Defines the Python project and console script entry point.
tools/changelog/uv.lock Pins Python dependencies for uv-managed execution.
doc/developer-guide/release-process/index.en.rst Updates the documented release workflow to generate changelogs via the new tool.

Comment on lines +70 to +71
uv run --project tools/changelog python tools/changelog/changelog.py \
-o apache -r trafficserver -m X.Y.Z --use-gh > CHANGELOG-X.Y.Z
Comment on lines +70 to +71
uv run --project tools/changelog python tools/changelog/changelog.py \
-o apache -r trafficserver -m X.Y.Z --use-gh > CHANGELOG-X.Y.Z
Comment on lines +242 to +250
resp = client.get(f"/repos/{owner}/{repo}/milestones")
_check_rate_limit(resp)
resp.raise_for_status()
for ms in resp.json():
if ms["title"] == title:
return ms["number"]
return None


"""Use the gh CLI to fetch milestone PRs (avoids API rate limits)."""
milestone_id = None
result = subprocess.run(
["gh", "api", f"/repos/{owner}/{repo}/milestones", "--paginate"],
Comment on lines +278 to +282
parser.add_argument(
"--doc",
action="store_true",
help="Include extra metadata (merge SHA, full commit message, labels) for documentation",
)
Comment on lines +52 to +57

try:
import yaml
except ImportError:
yaml = None

sys.exit(2)


def main():
@bryancall bryancall self-requested a review April 20, 2026 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants