feat: add a changelog package - #5
Draft
tonyandrewmeyer wants to merge 4 commits into
Draft
Conversation
Lifts `parse_release_notes`, `format_release_notes`, `format_changes` and the commit-type-to-category mapping out of `canonical/operator`'s `release.py`, which is being replaced by three workflows. The formatting is the part that isn't specific to one repository; the version arithmetic, the file rewriting and the GitHub calls stay behind in operator. The one behaviour change while lifting is that `format_changes` takes the date as an argument rather than calling `datetime.datetime.now()` itself, which is what made it impossible to assert on. The package does no I/O at all now, so a conftest fixture blocks the clock to keep it that way. The tests use two real operator releases as fixtures, reconstructed from the repository's own history: 3.8.2 for the ordinary case (eleven of its twenty-three pull requests are `chore`, and none of them reach the changelog) and a trimmed 3.8.0 for the one breaking change merged into a 3.x release. There's no console script, because what a command line should look like depends on the workflow that calls it, and that workflow hasn't been written yet. Refs canonical/operator#2224 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DC6P7uEu7Qw7kh2tDBuJyB
tonyandrewmeyer
commented
Sep 10, 2026
tonyandrewmeyer
commented
Sep 10, 2026
tonyandrewmeyer
commented
Sep 10, 2026
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.
canonical/operator'srelease.pyis being replaced by three workflows, and the formatting half of it isn't specific to one repository, soparse_release_notes,format_release_notes,format_changesand the commit-type-to-category mapping move here. The version arithmetic, the file rewriting and the GitHub calls stay behind in operator.The tests use two real operator releases as fixtures: 3.8.2 for the ordinary case, and a trimmed 3.8.0 for the one breaking change that was merged into a 3.x release.
There's no console script, because what a command line should take and print depends on the workflow that calls it, and that workflow hasn't been written yet.
Refs canonical/operator#2224