-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve release automation #72
Conversation
e97dc07
to
10e49dd
Compare
This commit introduces several helpers: * A script that reads the most recent released version from CHANGELOG.md and can be instructed to guess the next version based on news fragments. * A new workflow that renders the changelog and submits a PR with this changelog. * A new trigger for the release workflow that runs when pull requests are closed and checks if it was a release PR as created by the workflow described above. In conclusion, this patch allows to quickly release new versions instead of having to perform the above steps manually on the CLI.
10e49dd
to
967aeb9
Compare
.. also ensure there are no news fragments left when checking for rendered changelog
@max-arnold Could you review this please? I like the simplicity of the new release process for maintainers, but could use another pair of eyes since the implementation is a bit tricky. This optimizes for the usual case where releases are cut in a linear process from the default branch, brushing over many corner cases probably. I'm fine with this since extension projects should be kept simple. The manual release by tagging still works to account for more custom processes. |
Sorry for the delay. Will take a look early next week. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The resulting GH workflows are quite complex for me to review in a meaningful way (I have limited experience using them). I tried to run them locally using the act
tool, but it turned out to be fiddly so I gave up.
Instead, below are a couple of questions to clarify:
- Am I correct that it will generate a release PR even if I just push my changes directly without making a feature PR?
- What will happen if I push two changes that contain changelog items? Will it result in two release PRs?
- Will the docs get rebuilt properly (i.e. contain the updated changelog) after I merge an automated release PR?
- For automated tagging, are there any benefits in using annotated tags?
project/{% if 'github.com' in source_url %}.github{% endif %}/workflows/pr.yml.j2
Show resolved
Hide resolved
No worries, I was primarily hoping for general comments/suggestions. :) Wasn't sure if there were obvious gotchas with this approach/workflow that I was missing.
Yes, but only if there is at least one news fragment to render.
No, there will always be at most one open release PR (which is updated when new changes are pushed).
The automated release PR only builds the changelog (which would have needed to be done manually before). Merging it triggers the same workflows as when pushing a new tag, i.e. the docs are regenerated and published as always. The only issue is the release date - if the automated PR was generated day(s) before merging it, the release date is off.
I don't see any, do you have suggestions? |
Annotated tags have explicit attributes that might be useful to tell who and when made them:
Also they are (kind of) immutable. But it is just a suggestion to consider. |
@max-arnold Thanks a lot for the suggestion, TIL. I assumed all tags were treated as git objects and were thus "immutable". I'll set |
This commit introduces several helpers:
In conclusion, this patch allows to quickly release new versions instead of having to perform the above steps manually on the CLI.
Fixes: #18