Repository navigation
chore: adjust versions after the 3.8.4 release - #61
Merged
Merged
Conversation
tonyandrewmeyer
added a commit
to canonical/operator
that referenced
this pull request
Oct 7, 2026
This replaces `.github/release.py` with two workflows, so that a release happens in Actions rather than on a maintainer's machine, and the human steps become reviewing a PR and publishing a draft release (the flow agreed in #2224). * "Propose a release" (`workflow_dispatch`) works out the version from the conventional commits since the last tag (or takes one as input), updates the version files and `CHANGES.md`, drafts the release notes via OpenRouter, and opens the bump PR with the notes in the description. If the version it works out from the commits is already tagged elsewhere, it stops and asks for an explicit version. The changelog, the version inference and the notes drafting come from canonical/charm-tech-code (the `changelog` and `draft-release-notes` tools), so our other repos can use them too. It also credits contributors from outside the team, which we've been doing by hand (and sometimes forgetting). * "Create the draft release" (`workflow_dispatch`, given the number of the merged bump PR) checks that the PR was merged to `main` or a `*-maintenance` branch and moved to a non-dev version, and creates a draft release from the PR description plus the `CHANGES.md` entry, targeting the merged commit. It never publishes anything or creates a tag. It then opens the PR that moves the branch back to a dev version. * Both workflows run from `main`, including for a maintenance release: both are dispatched, so the workflow always comes from the default branch, and the scripts and release-note examples are read from `main` rather than from the branch being released. That means nothing has to be backported to `2.23-maintenance` (or any other maintenance branch) for this to work there. * `publish.yaml` now triggers on `release: published` rather than on a tag push, so publishing the draft is explicitly what sends the package to PyPI rather than a side effect of the tag being created. `test-publish.yaml` is folded into it as the `workflow_dispatch` job. * `release.py`, its tox environments, and the `release` dependency group are removed. The check for open "update charm pins" PRs goes with it and isn't replaced (as written it only fired with two or more open, and I don't think we want it). The `.github/` script tests now run as part of `tox -e unit`. * The release section of `CONTRIBUTING.md` is rewritten for the new process. To review, I'd start with the release section of `CONTRIBUTING.md`, which walks through the whole flow, then `propose-release.yaml`, `create-draft-release.yaml`, and `publish.yaml`, and finally `update-release-versions.py` and its tests. I've run the flow on my fork, with this branch merged into the fork's `main`: a [dry run without a version](https://github.com/tonyandrewmeyer/operator/actions/runs/37292054966), which stops because 3.8.3 is tagged outside `main`'s history, a [dry run with 3.8.4](https://github.com/tonyandrewmeyer/operator/actions/runs/37292158459), the [proposal](https://github.com/tonyandrewmeyer/operator/actions/runs/37292271500) ([fork#60](tonyandrewmeyer#60)), the [draft release and post-release PR](https://github.com/tonyandrewmeyer/operator/actions/runs/37294123074) ([fork#61](tonyandrewmeyer#61)), publishing the [draft](https://github.com/tonyandrewmeyer/operator/releases/tag/3.8.4) (which created the tag on the merge commit), and merging the post-release PR. I haven't run a pre-release or a maintenance release through the workflows, but I have run `update-release-versions.py` against `2.23-maintenance` and `3.3-maintenance` in both modes, and it rewrites the four version files and skips the versions doc that neither branch has. There are also two settings changes: a `release-notes` environment with an `OPENROUTER_API_KEY` secret and an `OPENROUTER_MODEL` variable (without them the workflow puts a placeholder where the notes would go, rather than failing), and the Test PyPI trusted publisher needs to point at `publish.yaml` instead of `test-publish.yaml`. Separately, both workflows open their PRs with `GITHUB_TOKEN`, so checks don't start on those PRs until someone closes and reopens them. A token that starts checks (an app token, or a PAT in a repository secret) would fix that, but I'd rather do that after the first release with this. Fixes #2224 --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
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.
3.8.4 is drafted, so
maingoes back to a development version.opsandops-tracinggo to3.9.0.dev0, andops-scenariofollows it.This is safe to merge before the draft release is published: the draft is pinned to the commit that was reviewed, not to the branch.
The version here is a placeholder that stops the tree claiming to be 3.8.4. Nothing counts from it - the next release is counted from the last tag on the branch - so it does not matter if the next release turns out to be a different one.