Skip to content

feat: add a changelog package - #5

Draft
tonyandrewmeyer wants to merge 4 commits into
canonical:mainfrom
tonyandrewmeyer:changelog-package
Draft

feat: add a changelog package#5
tonyandrewmeyer wants to merge 4 commits into
canonical:mainfrom
tonyandrewmeyer:changelog-package

Conversation

@tonyandrewmeyer

@tonyandrewmeyer tonyandrewmeyer commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

canonical/operator's release.py is being replaced by three workflows, and the formatting half of it isn't specific to one repository, so parse_release_notes, format_release_notes, format_changes and 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

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
Comment thread changelog/README.md Outdated
Comment thread changelog/README.md Outdated
Comment thread changelog/README.md Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants