Add a changelog-entry CI check for user-facing PRs and automate GitHub release notes from CHANGELOG
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 9
- Forks
- 17
- Avg merge
- 21h 36m
- Merged PRs (30d)
- 22
Description
Summary
Close two release-hygiene gaps: (1) a CI check that user-facing PRs include a CHANGELOG.md entry (with an explicit skip label for exempt changes), and (2) automation that derives GitHub Release notes from the corresponding CHANGELOG section when a release is published.
Priority: P2 · Confidence: Medium
Why this matters
The CHANGELOG is well-maintained by convention, but conventions without gates drift — one forgotten entry breaks the "track every release" promise the README makes. And today release notes are assembled by hand from a file that already contains exactly the right content; automating the copy removes release-day toil and guarantees the two never disagree.
Current evidence
CHANGELOG.mdfollows Keep a Changelog with an[Unreleased]section; no CI job validates that PRs touch it (verified across.github/workflows/*.yml)..github/workflows/publish.ymltriggers onrelease: types: [published]— the GitHub Release body is authored manually with no link to CHANGELOG content.- The PR template (
.github/pull_request_template.md) includes a checklist but checklists aren't gates. - Adjacent open issue #468 (release-pipeline integrity: tag/version checks, pre-publish tests, pinned actions) is the publish-side counterpart; this issue covers the authoring side and notes generation. Coordinate so the version/tag consistency check isn't duplicated.
External context
Keep a Changelog–driven release notes extraction is a common lightweight pattern (a small script slicing the ## [X.Y.Z] section); changelog-presence checks with a skip-changelog label are standard in many OSS workflows.
Proposed implementation
- CI job (in
ci.yml): on PRs, fail if noCHANGELOG.mddiff unless the PR carries askip-changeloglabel; docs-only/CI-only paths can be auto-exempted by path filters (decide the exemption list deliberately). - Add
scripts/extract_changelog.py NOTES_VERSION: print the matching CHANGELOG section; fail if missing or empty — this doubles as a pre-publish "release has notes" gate (#468 synergy). - Wire it into the release flow: either a small workflow that updates the GitHub Release body on publish, or a documented
gh release create --notes "$(python scripts/extract_changelog.py vX.Y.Z)"step in the release procedure — maintainer preference. - Document the rules in
CONTRIBUTING.md(when an entry is required; how to use the skip label).
AI-agent execution notes
- Inspect first:
CHANGELOG.mdheading format (exact anchor/dash style for parsing),ci.ymljob structure,publish.yml,tests/test_check_readme_version.pyfor the script-test pattern. - Run:
pyteston the new extractor tests; a dry-run of the PR check logic against recent merged PRs to calibrate exemptions. - Add tests: extractor handles current and historical sections, missing version,
[Unreleased]; PR-check path filters behave. - Edge cases: release-please-style multi-section bodies; pre-release tags; the
[Unreleased]→ versioned-section move at release time. - Do not enforce retroactively or block bot PRs (exempt by author if needed).
Acceptance criteria
- A user-facing PR without a CHANGELOG entry fails CI; adding the skip label passes it.
extract_changelog.py 0.14.0prints exactly that release's section; missing-version exits non-zero.- Release procedure (automated or documented) produces notes from CHANGELOG content.
Test plan
Extractor unit tests with fixture changelogs; a test PR exercising both check outcomes; one dry-run release on a pre-release tag.
Documentation plan
CONTRIBUTING.md changelog rules; release-procedure doc update (wherever #468 documents it); CHANGELOG entry (fittingly).
Migration and compatibility notes
Not expected to require migration — contributor workflow gains one labeled escape hatch.
Risks and tradeoffs
Path-based exemptions can misclassify (start permissive, tighten); label-based skips rely on maintainer discipline (visible in PR history, which is the point). Keep the extractor's parser strict about the Keep-a-Changelog format so it doubles as a format check.
Suggested labels
developer-experience, testing, documentation
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Inspect CHANGELOG.md, .github/workflows/ci.yml, .github/workflows/publish.yml, CONTRIBUTING.md, and tests/test_check_readme_version.py first. Add extractor tests for versioned and missing sections, then validate the PR check and release flow; done means user-facing PRs are gated or explicitly skipped and release notes match CHANGELOG content.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, python
- Domain
- ci-cd, developer-experience, documentation, release
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100