Repository navigation
chore(release): generate CHANGELOG.md with git-cliff under cargo release - #2808
Merged
Merged
Conversation
CHANGELOG.md is git-cliff output. scripts/release-changelog.sh, the cargo-release pre-release-hook, renders the whole Conventional Commit history with the version being cut as the newest section, by absolute path under WORKSPACE_ROOT so the per-package runs write one file, and the release commit carries it. A preview run (DRY_RUN=true) writes nothing. The same cliff.toml still renders the GitHub release notes. The PR title is the changelog line; `!` or a BREAKING CHANGE footer files it under Breaking. The PR template, CONTRIBUTING.md, RELEASING.md, CLAUDE.md and the sponsord architecture doc say so instead of asking for a hand-written entry. The generated file is excluded from markdownlint (pre-commit and the ci.yml job) and from the ADR anchor guard. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Gas snapshotNo gas changes vs base. |
Code coverage overviewLanguages: Rust, Solidity Rust / code-coverage/cargo-llvm-cov
View coverage of the 3 most impacted files.
Solidity / code-coverage/forge
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. Updated |
There was a problem hiding this comment.
🔵 Needs a closer look
The cargo release --execute integration remains unverified, requiring maintainer confirmation that the signed release commit includes the generated CHANGELOG.md before publishing.
No open issues 🎉
What changed in this PR
Automates deCDN’s changelog generation during cargo release, using the same git-cliff configuration as GitHub release notes instead of hand-written entries.
Changes:
- Adds a workspace-root release hook with dry-run handling, dependency checks, newline normalization, and focused tests.
- Updates contributor and release guidance to use Conventional Commit titles and breaking-change markers.
- Excludes the generated changelog from Markdown linting and ADR anchor checks.
| File | Description |
|---|---|
scripts/tests/test_release_changelog.py |
Tests dry runs, missing prerequisites, absolute paths, and trailing newlines. |
scripts/release-changelog.sh |
Generates the root changelog during release execution. |
RELEASING.md |
Documents automated generation and hook behavior. |
release.toml |
Registers the pre-release hook. |
docs/sponsord/architecture.md |
Documents PR-title markers for breaking changes. |
CONTRIBUTING.md |
Replaces manual-entry guidance with generated-changelog guidance. |
cliff.toml |
Updates the generated header and spacing between release sections. |
CLAUDE.md |
Aligns sponsord guidance with breaking-change markers. |
adr/Makefile |
Removes the changelog from anchor-check inputs. |
.markdownlintignore |
Excludes the generated changelog from Markdown linting. |
.github/workflows/release.yml |
Updates comments describing changelog and release-note generation. |
.github/workflows/ci.yml |
Excludes the changelog from linting and ADR job triggers. |
.github/pull_request_template.md |
Updates breaking-change instructions and removes the manual changelog checklist item. |
Review effort: Balanced
…G pointers The hook renders to a temporary file beside CHANGELOG.md and moves it over, so a render error leaves the committed file alone (git-cliff opens --output before it renders). It requires cliff.toml (git-cliff falls back to its built-in template with exit 0), accepts only the literal true or false for DRY_RUN, and refuses the renders git-cliff exits 0 on but a release must not ship: an empty file, no section for the new version, no section for the previous one. A preview renders and checks but does not write, so those failures surface before the version bump. Three source comments pointed at hand-written CHANGELOG prose; each now carries what it needs. The CI tooling job installs the release workflow's git-cliff so the real-render test runs there. Co-Authored-By: Claude Fable 5.1 <[email protected]>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
CHANGELOG.mdis now git-cliff output.scripts/release-changelog.sh, the cargo-releasepre-release-hookinrelease.toml, renders the whole Conventional Commit history with the version being cut as the newest section; the release commit (git commit -am) carries it. The hook writes by absolute path underWORKSPACE_ROOT, so the one-run-per-package behaviour leaves one file, and a preview run (DRY_RUN=true) writes nothing.v0.3.0(7 sections). The samecliff.tomlstill renders the GitHub release notes inrelease.yml; its body now separates sections with a blank line, and the hook ends the file in a single newline soend-of-file-fixerleaves the release commit alone.!after the type (or aBREAKING CHANGE:footer) files it under### Breaking. The PR template,CONTRIBUTING.md,RELEASING.md,CLAUDE.mdanddocs/sponsord/architecture.mdsay so..markdownlintignore(pre-commit) and theci.ymljob globs (markdownlint-cli2 does not read the ignore file), and from the ADR anchor guard (ANCHOR_SRCS, theadrpath filter).scripts/tests/test_release_changelog.pycovers the dry-run no-op, the missing-env and missing-git-clifffailures, the absolute-path arguments and the single trailing newline.Verification
cargo release patch --workspace --no-confirm -vvon a clean tree: the hook is called 15 times (once per released package), exit 0, tree still clean, nocrates/*/CHANGELOG.md.WORKSPACE_ROOT=$PWD NEW_VERSION=0.4.0 DRY_RUN=false scripts/release-changelog.shadds a## [0.4.0]section and touches onlyCHANGELOG.md; withDRY_RUN=truethe file is byte-identical.pre-commit run --all-files: 25 hooks passed.markdownlint-cli2with the CI globs: 0 errors.make -C adr check-refs: passes.uvx --with pyyaml pytest scripts/tests .github/scripts/tests: 479 passed.cargo release --executewith the hook. Check that thechore(release): vXcommit's file list includesCHANGELOG.md.🤖 Generated with Claude Code