Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
747fc46
Add .nextchanges fragment directory and collator
janniklasrose Jun 11, 2026
368042d
Add changelog-collate release workflow
janniklasrose Jun 11, 2026
7707dd1
Point contributors at .nextchanges in PR template and pr-checklist
janniklasrose Jun 11, 2026
6543e30
Demo: add test changelog fragments (revert after review)
janniklasrose Jun 12, 2026
bf196ac
Demo: collate test changelog fragments into NEXT_CHANGELOG.md (revert…
janniklasrose Jun 12, 2026
73d3550
Revert NEXT_CHANGELOG.md
janniklasrose Jun 12, 2026
25cb944
Reuse the changelog-collate task in the collate workflow
janniklasrose Jun 12, 2026
3108bff
Tighten .nextchanges guidance in pr-checklist
janniklasrose Jun 12, 2026
e92c6be
Render .nextchanges/ into CHANGELOG.md via a tagging.py wrapper
janniklasrose Jul 3, 2026
38eef21
Remove the NEXT_CHANGELOG.md collate bridge
janniklasrose Jul 3, 2026
1fd1ae2
Update changelog docs for direct-to-CHANGELOG release
janniklasrose Jul 3, 2026
74f3ddd
Merge remote-tracking branch 'origin/main' into janniklasrose/changel…
janniklasrose Jul 3, 2026
d774453
Name the release wrapper release_tagging.py, keep tagging.py pristine
janniklasrose Jul 3, 2026
dbb13e7
Revert ruff.toml comment
janniklasrose Jul 3, 2026
3a32f0a
Revert tagging.py
janniklasrose Jul 3, 2026
ae081d0
Tidy Taskfile
janniklasrose Jul 3, 2026
4b17443
Rename changelog task
janniklasrose Jul 3, 2026
04e637a
Demo: add test changelog fragments (revert after review)
janniklasrose Jul 3, 2026
7a290e2
Demo: render fragments into CHANGELOG.md (revert after review)
janniklasrose Jul 3, 2026
e0a2aa4
Revert "Demo: render fragments into CHANGELOG.md (revert after review)"
janniklasrose Jul 3, 2026
d2093d8
Revert "Demo: add test changelog fragments (revert after review)"
janniklasrose Jul 3, 2026
1d06899
Match CHANGELOG.md formatting in release_tagging.py render
janniklasrose Jul 3, 2026
e925f8d
Demo: add test changelog fragments (revert after review)
janniklasrose Jul 3, 2026
a339ab0
Demo: render fragments into CHANGELOG.md (revert after review)
janniklasrose Jul 3, 2026
fcdb4cc
Revert "Demo: render fragments into CHANGELOG.md (revert after review)"
janniklasrose Jul 3, 2026
e334168
Revert "Demo: add test changelog fragments (revert after review)"
janniklasrose Jul 3, 2026
0826ce0
Update changelog agent rule for .nextchanges/
janniklasrose Jul 3, 2026
2ee9000
Reject unexpected files under .nextchanges/
janniklasrose Jul 3, 2026
606a0ee
Expand PR links via update_github_links, not in the release wrapper
janniklasrose Jul 3, 2026
129fb7c
Clarify PR-link expansion in .nextchanges README
janniklasrose Jul 3, 2026
1e09675
Add release note preview workflow for PRs
janniklasrose Jul 10, 2026
a6287a8
Update .github/workflows/changelog-preview.yml
janniklasrose Jul 10, 2026
36a5b19
Merge branch 'main' into janniklasrose/preview-changelog
janniklasrose Jul 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/changelog-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Changelog Preview

# Renders the CHANGELOG.md section the next release would generate from this
# PR's .nextchanges/ fragments, so reviewers can see the result (in this check's
# logs / summary) without cutting a release.
#
# Uses `pull_request` with a read-only token: it renders the PR's own
# .nextchanges/ content and never needs write credentials.
on:
pull_request:
types: [opened, reopened, synchronize]
paths:
- ".nextchanges/**"
- "internal/genkit/**"
- "tools/validate_nextchanges.py"
- "tools/update_github_links.py"

permissions:
contents: read

jobs:
preview:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
version: "0.8.9"

- name: Render changelog preview
run: |-
{
echo '### Changelog preview'
echo ''
echo "What the next release would add to CHANGELOG.md from this PR's .nextchanges/:"
echo ''
echo '```markdown'
uv run --locked internal/genkit/release_tagging.py --preview
echo '```'
echo ''
echo '_Preview only — the date and version are computed at release time._'
} | tee "$GITHUB_STEP_SUMMARY"
5 changes: 5 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,11 @@ tasks:
cmds:
- "./tools/validate_nextchanges.py"

changelog-preview:
desc: Print the CHANGELOG.md section the next release would add from .nextchanges/
cmds:
- "uv run --locked internal/genkit/release_tagging.py --preview"

deadcode:
desc: Check for dead code
sources:
Expand Down
44 changes: 41 additions & 3 deletions internal/genkit/release_tagging.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
untouched ``process()`` for all commit/tag/race/recovery logic.
"""

import argparse
import os
import re
from datetime import datetime, timezone
from typing import Optional

import tagging
Expand Down Expand Up @@ -162,8 +165,43 @@ def install_nextchanges() -> None:
tagging.clean_next_changelog = clear_nextchanges


def preview() -> None:
"""
Print the ``## Release vX.Y.Z`` section(s) the next release would prepend to
CHANGELOG.md, rendered from the current ``.nextchanges/`` — without touching
git, GitHub, or any file. Mirrors write_changelog's date stamp so the output
matches what would land. Read-only: safe to run anytime, no credentials.
"""
current_date = datetime.now(tz=timezone.utc).strftime("%Y-%m-%d")
printed = False
for package in tagging.find_packages():
tag_info = get_next_tag_info(package)
if tag_info is None:
continue
dated = re.sub(
rf"## Release v({tagging.Version.PATTERN})",
rf"## Release v\1 ({current_date})",
tag_info.content.strip(),
)
print(dated)
printed = True
if not printed:
print("No .nextchanges/ entries — the next release would add no changelog section.")


if __name__ == "__main__":
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument(
"--preview",
action="store_true",
help="Print the changelog section the next release would add, then exit (no writes, no network).",
)
args = parser.parse_args()

install_nextchanges()
tagging.validate_git_root()
tagging.init_github()
tagging.process()
if args.preview:
preview()
else:
tagging.validate_git_root()
tagging.init_github()
tagging.process()
Loading