Skip to content

Conversation

@tonyandrewmeyer
Copy link
Collaborator

@tonyandrewmeyer tonyandrewmeyer commented Oct 22, 2025

Currently, the release script fails to recognise lines with the ! breaking change indicator in the category, meaning they are not included in the change log or release notes (and yet, are probably the most important to include).

The PR:

  • Changes the regular expression to use named groups for better readability.
  • Changes the regular expression to capture the ! if present.
  • Puts any breaking changes into a separate category (keeping the main category in the description).
  • In the changelog, puts the changes into a "Breaking Changes" group.
  • In the release notes, adds a top-level section that calls out that there are breaking changes, and lists them, and notifies the user about this, because it's likely that some hand-crafted text will be required to cover these.

Also, to handle the upcoming release, adds support for alpha, beta, and release candidate numbers in the version (in a fairly minimal way - the tag, the title, and generally not crashing).

Fixes #2111

Copy link
Contributor

@james-garner-canonical james-garner-canonical left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's a bug. The approach looks good overall though.

Would it be possible to see the output for an example release (e.g. this planned one) with both versions before merging?

@tonyandrewmeyer
Copy link
Collaborator Author

I think there's a bug.

Oops, yes. I broke things moving some stuff around just before committing.

Would it be possible to see the output for an example release (e.g. this planned one) with both versions before merging?

Yeah, I was being a bit lazy thinking I would test it with the release for today rather than go to the effort of organising a separate release. But that would be better I guess. Will do in a moment after addressing the other comments.

Copy link
Collaborator

@benhoyt benhoyt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy to just go with James' review on this one, seeing it's the release script. Thanks!

Copy link
Contributor

@james-garner-canonical james-garner-canonical left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I'm happy for this to be tested by trying to release the beta if you are.

I guess we're not type checking this script, because it should complain that we're passing a Mapping (categories) to functions that expect a dict (format_changes, format_release_notes) -- probably worth fixing before merging just for correctness, but shouldn't have any effect at runtime.

Comment on lines -129 to +134
if not re.match(r'^\d+\.\d+\.\d+$', new_tag):
logger.error('Error: Tag must be in format X.Y.Z')
if not re.match(r'^\d+\.\d+\.\d+(?:(?:a|b|rc)\d+)?$', new_tag):
logger.error('Tag must be in format X.Y.Z')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this doesn't handle pre and post releases either. Perhaps saner to parse with packing.version, but probably fine for now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, since this wasn't the main point of the PR and I just needed it to get the script to run, I did the minimal change. I agree using the official parser would be better, but I think that's a separate PR and more thought should be put into how the pieces are used.

@tonyandrewmeyer
Copy link
Collaborator Author

Release notes look like this:

image

Changelog looks like this:

image

@tonyandrewmeyer tonyandrewmeyer merged commit 0422491 into canonical:main Oct 22, 2025
53 checks passed
@tonyandrewmeyer tonyandrewmeyer deleted the include-breaking-changes-in-release-notes branch October 22, 2025 02:23
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.

Release script doesn't detect breaking changes

3 participants