Repository navigation
feat: release automation script - #1855
Conversation
tonyandrewmeyer
left a comment
There was a problem hiding this comment.
A few comments, but in general I think the primary test is a release, and the last two, which used this, seemed fine, and if we think there should be tweaks as we each use this to do a release, doing it at the time seems fine.
benhoyt
left a comment
There was a problem hiding this comment.
Looks like a good start!
dimaqq
left a comment
There was a problem hiding this comment.
Partial review at this point, sorry I'm multitasking with secondment.
Co-authored-by: James Garner <james.garner@canonical.com>
|
Another test after refactoring according to all comments above: $ git branch
main
$ python release.py --owner ironcoreworks --repo release-automation # testing org and repo
2025-07-10 11:13:14,849 - INFO - Latest tag in branch "main": 0.1.0
2025-07-10 11:13:14,850 - INFO - Suggested new version: 0.2.0
Input the new tag for the release (press enter to use the tag 0.2.0), or 'c' to cancel:
3.2.0
2025-07-10 11:13:17,939 - WARNING - Check out the releases page: https://github.com/ironcoreworks/release-automation/releases before confirming!
Confirm creating tag '3.2.0' on branch 'main'? [y/N]: y
2025-07-10 11:13:19,675 - INFO - Draft release created: https://github.com/IronCoreWorks/release-automation/releases/tag/untagged-5a42876b7b5b428d3b6b.
================================================================================
Formatted release notes:
================================================================================
## What's Changed
### Features
* Add changes.md in https://github.com/IronCoreWorks/release-automation/pull/6
* Update release automation script and versions in https://github.com/IronCoreWorks/release-automation/pull/20
* Update in https://github.com/IronCoreWorks/release-automation/pull/23
* Update release script in https://github.com/IronCoreWorks/release-automation/pull/24
### Documentation
* Add version in https://github.com/IronCoreWorks/release-automation/pull/3
### Tests
* Add test in https://github.com/IronCoreWorks/release-automation/pull/4
**Full Changelog**: https://github.com/IronCoreWorks/release-automation/compare/0.1.0...3.2.0
================================================================================
2025-07-10 11:13:19,676 - INFO - The automatically generated title is: 3.2.0
Enter release title, press Enter to keep the auto-generated title:
> Test release, ops 3.2.0, tracing 3.2.0, testing/scenario 8.2.0
Enter release summary (multi-line supported; type '.' on a new line to finish):
This is a release for testing the automation script.
The previous tag from my repo is 0.1.0, hence the suggested version is 0.2.0, which is overriden by values provided by the user.
A quick brown fox jumps over something that I forgot.
Put a single dot at the final line to finish drafting the introduction paragraph.
.
2025-07-10 11:13:38,740 - INFO - Release updated: https://github.com/IronCoreWorks/release-automation/releases/tag/untagged-01c17942f2ee6832d913.
2025-07-10 11:13:38,742 - INFO - Updated CHANGES.md with new release notes.
2025-07-10 11:13:38,742 - INFO - Suggested new scenario version: 8.2.0
Input new scenario version (press enter to use the suggested version 8.2.0), or 'c' to cancel:
Confirm using scenario version '8.2.0'? [y/N]: y
2025-07-10 11:13:47,429 - INFO - Updated ops/version.py to version 3.2.0
2025-07-10 11:13:47,430 - INFO - Updated pyproject.toml to version 8.2.0
2025-07-10 11:13:47,430 - INFO - Updated testing/pyproject.toml to version 8.2.0
2025-07-10 11:13:47,431 - INFO - Updated tracing/pyproject.toml to version 3.2.0
Using CPython 3.12.9
Resolved 149 packages in 304ms
Updated ops-scenario v8.2.0.dev0 -> v8.2.0
Updated ops-tracing v3.2.0.dev0 -> v3.2.0
Switched to a new branch 'release-prep-3.2.0'
[release-prep-3.2.0 0a8f4d0] chore: prepare release 3.2.0
6 files changed, 26 insertions(+), 9 deletions(-)
Enumerating objects: 20, done.
Counting objects: 100% (20/20), done.
Delta compression using up to 10 threads
Compressing objects: 100% (8/8), done.
Writing objects: 100% (11/11), 2.03 KiB | 2.03 MiB/s, done.
Total 11 (delta 6), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (6/6), completed with 6 local objects.
remote:
remote: Create a pull request for 'release-prep-3.2.0' on GitHub by visiting:
remote: https://github.com/IronCore864/release-automation/pull/new/release-prep-3.2.0
remote:
To github.com:IronCore864/release-automation.git
* [new branch] release-prep-3.2.0 -> release-prep-3.2.0
2025-07-10 11:13:53,908 - INFO - Created PR: https://github.com/IronCoreWorks/release-automation/pull/26
2025-07-10 11:13:53,908 - INFO - Draft release created. Please merge the version bump PR, publish the draft release, thenrun this script with --post-release to perform post-release actions. |
tonyandrewmeyer
left a comment
There was a problem hiding this comment.
I'm happy with this as-is. I'm sure we'll want to tweak things in the future, but this seems a good starting point. It's only for our use, so we have more flexibility than with most changes.
The one change I'd like is for HACKING.md to be updated to include instructions for running this script and remove instructions for all the things this script does.
james-garner-canonical
left a comment
There was a problem hiding this comment.
I'm happy with merging this as is. I still kind of like iterating over tags rather than releases for suggesting versions, but I don't think that's a blocker. +1 on Tony's comment to ensure HACKING.md is up-to-date.
benhoyt
left a comment
There was a problem hiding this comment.
Looking close. A few changes requested (and I agree about updating HACKING.md). Let's try to get this merged by the end of this week.
benhoyt
left a comment
There was a problem hiding this comment.
Looks good, thanks for the updates. Approving optimistically, but a few minor changes to HACKING.md suggested.
tonyandrewmeyer
left a comment
There was a problem hiding this comment.
A couple of small notes, but looks great, thanks!
|
Merged main into this branch, resolved the conflicts in HACKING.md, also tweaked the description in HACKING.md a little bit. Merging now. |




This PR automates the release process according to our discussion in Frankfurt, see here (internal link) for more details.
Dependencies:
GITHUB_TOKENsetgitcommand is available locallypygithub(managed by tox; if you want to run the script directly for testing purposes, you need to have it).The script does the following:
pygithub, installed by tox, andgitcommand)tox -e release. This detects version from the latest tag and suggests a new version for user confirmation. It can be overriden with user-provided value.CHANGES.mdare formatted (for example, drop the GitHub usernames)with categorizations accordingly
@tonyandrewmeyer @james-garner-canonical please have a look because I think according to the order it's going to be you guys doing releases soon.
Done: