Skip to content

Add release-notes generator script and Makefile target#1785

Open
wallrj-cyberark wants to merge 1 commit into
cert-manager:release-nextfrom
wallrj-cyberark:release-notes-generator
Open

Add release-notes generator script and Makefile target#1785
wallrj-cyberark wants to merge 1 commit into
cert-manager:release-nextfrom
wallrj-cyberark:release-notes-generator

Conversation

@wallrj-cyberark

@wallrj-cyberark wallrj-cyberark commented Sep 28, 2025

Copy link
Copy Markdown
Member

Producing release notes has always been one of the most laborious parts of the cert-manager release process. This PR adds a Go tool that automates the tedious, error-prone steps — extracting the changelog from GitHub PR history, formatting contributor and maintainer lists, and maintaining the structured MDX markers the website expects — so we spend less time on formatting and more time reviewing content.

What this adds

scripts/release-notes/ — Go CLI tool

  • Uses k8s.io/release/pkg/notes to collect changelog entries from merged PRs between two git revisions.
  • Auto-detects the end revision: tries the release tag (v1.21.0), then the release branch (release-1.21), then falls back to master. The tool can therefore be run before the tag exists.
  • Generates a new release-notes file from a template (if not already present) with placeholder sections for summary, themes, contributors, maintainers, steering committee, and changelog.
  • On subsequent runs, updates only the relevant sections (contributors, maintainers, steerers, changelog), leaving hand-edited sections untouched.
  • Handles legacy files (created before this tool existed) by inserting MDX markers using structural heuristics, then regenerating the changelog section.
  • Quotes PR numbers and GitHub handles for spell-checker compatibility.

make/02_mod.mkgenerate-release-notes target

export GITHUB_TOKEN=$(gh auth token)
make generate-release-notes        # uses cert_manager_latest_version from variables.json
make generate-release-notes CERT_MANAGER_VERSION=v1.21.0

content/docs/contributing/release-process.md — updated to document the new tool and Makefile target.

content/docs/releases/release-notes/release-notes-1.21.md — first real use of the tool: generated the v1.21.0 pre-release notes from 216 commits since v1.20.0.

Testing

Unit tests cover:

  • Creating a new versioned changelog section from an unversioned placeholder
  • Inserting a new version above existing versioned sections (newest-first ordering)
  • Replacing an existing section for the same version (handles pre-release → final transitions)
  • Legacy files: inserting community markers via structural heuristics
  • Legacy files: replacing a bare ## \vX.Y.Z`` heading with generated content on first run
  • Contributor extraction from changelog handles ([@handle] and [`@handle`] forms)

Manually verified by running make generate-release-notes CERT_MANAGER_VERSION=v1.21.0 against the existing release-notes-1.21.md file that was created manually — the tool inserted the community markers and generated the full changelog, including PRs merged up to the time of the run.

@cert-manager-prow cert-manager-prow Bot added dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Sep 28, 2025
@netlify

netlify Bot commented Sep 28, 2025

Copy link
Copy Markdown

Deploy Preview for cert-manager ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 4dea748
🔍 Latest deploy log https://app.netlify.com/projects/cert-manager/deploys/6a44abe0699727000876dd1c
😎 Deploy Preview https://deploy-preview-1785--cert-manager.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@wallrj wallrj requested a review from Copilot September 28, 2025 20:15

This comment was marked as outdated.

@wallrj-cyberark wallrj-cyberark force-pushed the release-notes-generator branch 4 times, most recently from a3349fd to effb7f3 Compare October 3, 2025 16:32
@cert-manager-prow cert-manager-prow Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 16, 2025
@@ -0,0 +1,101 @@
# Release Notes Generator

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested this script, but wasn't able to run it because I hadn't create the tag yet. The release process says that I should prepare the release notes before releasing. Here is what I'm getting:

$ cd scripts/release-notes
$ go run . --release-notes-dir ../../content/docs/releases/release-notes --release-version v1.20.1
INFO[0000] Cloning/updating repository cert-manager/cert-manager
INFO[0015] Using found start SHA: 0d2f215fe26ca2674758b5dfd780f04ac1dfde92
invalid configuration: invalid notes options: resolving v1.20.1: reference not found
exit status 1

@wallrj-cyberark wallrj-cyberark force-pushed the release-notes-generator branch from 9ffaa3c to 96f7aa1 Compare June 30, 2026 20:58
@cert-manager-prow cert-manager-prow Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 30, 2026
@wallrj-cyberark wallrj-cyberark changed the base branch from master to release-next June 30, 2026 20:58
@wallrj-cyberark wallrj-cyberark force-pushed the release-notes-generator branch from 96f7aa1 to 8298740 Compare June 30, 2026 21:08
@cert-manager-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign wallrj for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@wallrj-cyberark wallrj-cyberark force-pushed the release-notes-generator branch 3 times, most recently from acce1b6 to a12d38b Compare June 30, 2026 22:01
@wallrj-cyberark wallrj-cyberark changed the title WIP: Add release-notes generator script and update release docs Add release-notes generator script and Makefile target Jun 30, 2026
@cert-manager-prow cert-manager-prow Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 30, 2026
@wallrj-cyberark wallrj-cyberark force-pushed the release-notes-generator branch 3 times, most recently from f956f32 to ae8e82a Compare June 30, 2026 22:17
- Add scripts/release-notes Go tool that generates and maintains
  release notes using k8s.io/release changelog extraction
- Add make generate-release-notes target with CERT_MANAGER_VERSION
  variable; the tool auto-detects the best end revision (tag →
  release branch → master) so it works before the tag is created
- Update release process docs to use make generate-release-notes
  in step 4 (prepare release notes PR, can be done ahead of time)
  and step 11 (re-run after tag is created if needed)
- Remove dependency on the separately-installed k8s release-notes CLI
- Update release-notes-1.18.md with auto-generated content
- Add content/docs/releases/release-notes/.spelling for version strings

Signed-off-by: Richard Wall <richard.wall@cyberark.com>
@wallrj-cyberark wallrj-cyberark force-pushed the release-notes-generator branch from ae8e82a to 4dea748 Compare July 1, 2026 05:55
@cert-manager-prow cert-manager-prow Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 9, 2026
@cert-manager-prow

Copy link
Copy Markdown
Contributor

PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants