-
Notifications
You must be signed in to change notification settings - Fork 395
WIP: Add release-notes generator script and update release docs #1785
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
wallrj-cyberark
wants to merge
6
commits into
cert-manager:master
Choose a base branch
from
wallrj-cyberark:release-notes-generator
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
76ab465
feat(release-notes): add release notes generator and make target
wallrj-cyberark 9f1d126
docs(release-notes): add markers for contributors and changelog sections
wallrj-cyberark 036f9d7
docs(release-process): simplify and reorganize release instructions
wallrj-cyberark effb7f3
make generate-release-notes
wallrj-cyberark f3eed8c
chore(spellcheck): add release-notes spelling file and enable target-…
wallrj-cyberark 9ffaa3c
Further simplify and re-order release-process
wallrj-cyberark File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| v1.18.0 | ||
| v1.18.1 | ||
| v1.18.2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| # Release Notes Generator | ||
|
|
||
| > This tool generates and maintains cert-manager release notes. It gathers | ||
| > changelog entries via the `k8s.io/release` notes tooling, renders a changelog | ||
| > snippet, and updates a templated Markdown release-notes file. | ||
|
|
||
|
|
||
| ### Quick overview | ||
|
|
||
| - **Purpose:** generate and update the website release-notes page for cert-manager. | ||
| - **Location:** `scripts/release-notes`. | ||
| - **Language:** Go. | ||
|
|
||
| ### Requirements | ||
|
|
||
| - Go 1.25+. | ||
| - Network access to GitHub. A token reduces API rate limits. | ||
| - Optional: the `gh` CLI to obtain a token (`gh auth token`). | ||
|
|
||
| ### Install / run locally | ||
|
|
||
| 1. Change to the tool directory. | ||
|
|
||
| ```bash | ||
| cd scripts/release-notes | ||
| ``` | ||
|
|
||
| 1. Run one-off using `go run`: | ||
|
|
||
| ```bash | ||
| go run . \ | ||
| --release-version v1.19.0 \ | ||
| --release-notes-dir ../content/docs/release \ | ||
| ``` | ||
|
|
||
| 1. Build the binary: | ||
|
|
||
| ```bash | ||
| go build -o release-notes . | ||
| ./release-notes --help | ||
| ``` | ||
|
|
||
| ### Basic usage | ||
|
|
||
| - Required flags: | ||
| - `--release-version` : the release tag (must be a valid semver, leading `v` expected). | ||
| - Useful flags: | ||
| - `--end-rev` (set to the release branch if the release version tag has not yet been created: `release-1.19`) | ||
| - `--release-notes-dir` (default: `.`) | ||
| - `--github-org` and `--github-repo` (defaults: `cert-manager` / `cert-manager`) | ||
|
|
||
| ### What the tool does | ||
|
|
||
| 1. Validates and canonicalizes `--release-version`. | ||
| 2. Uses `k8s.io/release/pkg/notes` to gather categorized notes and render Markdown. | ||
| 3. Ensures a release-notes file exists (creates from a template if missing). | ||
| 4. Updates the release-notes file: | ||
| - Replaces the `maintainers`, `steerers`, and `contributors` sections. | ||
| - Inserts or replaces a versioned changelog section delimited by markers. | ||
| - Replaces prerelease sections for the same MAJOR.MINOR.PATCH when appropriate. | ||
| 5. Writes updates atomically (writes a `.new` temp file and renames it). | ||
|
|
||
| ### Release-notes file markers / format | ||
|
|
||
| - Unversioned (bootstrap) changelog: | ||
| - `{/* BEGIN changelog */}` and `{/* END changelog */}` | ||
| - Versioned changelog: | ||
| - `{/* BEGIN changelog vX.Y.Z */}` … `{/* END changelog vX.Y.Z */}` | ||
| - Keep each marker on its own line and use `LF` line endings when possible. | ||
|
|
||
| ### Semver / prerelease handling | ||
|
|
||
| - When inserting a final release (e.g., `v1.2.3`), the tool will replace earlier prerelease sections (e.g., `v1.2.3-beta.1`) for the same MAJOR.MINOR.PATCH. | ||
|
|
||
| ### Troubleshooting & tips | ||
|
|
||
| - If you see `invalid release version` errors: | ||
| - Ensure you pass a leading `v`, e.g. `v1.19.0`. | ||
| - If changelog sections are not detected: | ||
| - Verify markers are in the expected form and on separate lines. | ||
| - Normalize line endings to `LF`. | ||
| - For GitHub API rate limits: | ||
| - Export `GITHUB_TOKEN` or use `export GITHUB_TOKEN=$(gh auth token)` before running. | ||
|
|
||
| ### Testing | ||
|
|
||
| - Run unit tests: | ||
|
|
||
| ```bash | ||
| cd scripts/release-notes | ||
| go test ./... | ||
| ``` | ||
|
|
||
| ### Contributing / development notes | ||
|
|
||
| - The tool leverages `k8s.io/release/pkg/notes`. If you change changelog markers or templates, update regexes in `main.go` and add tests for edge cases (CRLF vs LF, prerelease replacement). | ||
|
|
||
| ### License & contact | ||
|
|
||
| - See the repository root for license information. | ||
| - For questions or bugs, open an issue or contact the maintainer in the repo. | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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: