Skip to content
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

Feedback about the release process #12509

Closed
sbidoul opened this issue Feb 4, 2024 · 4 comments
Closed

Feedback about the release process #12509

sbidoul opened this issue Feb 4, 2024 · 4 comments
Labels
state: needs eyes Needs a maintainer/triager to take a closer look type: maintenance Related to Development and Maintenance Processes type: refactor Refactoring code

Comments

@sbidoul
Copy link
Member

sbidoul commented Feb 4, 2024

The current release processes bumps the version, generates things (NEWS.rst, AUTHORS.rst), then creates a git tag, then bumps the version again for development.

When, say, NEWS.rst needs to be tweaked, the process is a little bit cumbersome. One needs to update the file, commit, reorder the commits so the bump for development commits is last, then delete the tag and re-create it.

I open this issue to discuss how we could make things a little bit easier (or find out if I missed something).

One possibility would be to have two nox actions: one to prepare the release branch, and a second one to tag and bump for development.

@webknjaz
Copy link
Member

webknjaz commented Mar 4, 2024

Hey 👋 I'm obsessed with the release automation among other things, so I have something to share on this topic.

I like GHA-based workflows (I know that some people here don't like having such automation, but please, bear with me!). And in that context, I prefer using publishing on workflow_dispatch, not pushing tags or publishing GitHub Releases. This allows me to have a process where the first thing happening is building the dists (and pre-making a commit with changelog changes that's bundled into them too), then running tests against these dists and finally, publishing the exact same dists that were tested. After that, the workflow creates a Git tag, makes GitHub Releases, publishes sigstore signatures and other stuff.

I think what's important in this example is the order of the steps. And that order can be reproduced with plain nox commands without the CI/CD bit.

The idea is that I always rely on the event of publishing to the PyPI as a point of no return. So everything before it is ephemeral, so to speak. There's dists that are stored as artifacts and passed between the jobs, there's the changelog commit that's also passed around. But these are not yet set in stone. When the time comes to actually publish (a step where a CD workflow is usually paused until approved), the final decision on proceeding is made. So then, the publishing happens and after that, we just have to persist the changes making them permanent. And that includes applying the pre-cooked changelog commit to Git, making a tag, and for projects that don't use SCM-based versioning, also bumping a constant in a Python module.

I observed time and time again that in a lot of projects, making a Git tag (or even a GitHub Release that implies a tag!) is seen as a pre-requisite for publishing, something that's happening early in the release process. So they do this and related changes to Git first, and then publish. If publishing fails for some reason, they have to remove the tag, make other changes and so on. This means that for some time, there's a public tag pushed to the Git remote that many external observers may treat as "a release happened". And then, the actual release may happen and succeed but in hours. Or it may fail and that promise of immutable tags is not true anymore. Then, the embarrassing need to clean up emerges.

My point is that by making updates like tagging a Git commit a consequence/output of release rather than a trigger/input allows reducing the amount of things to clean up if something goes wrong. And I use the fact of succeeding publishing to the PyPI as a marker/flag with the semantics of "a release actually happened".

All this is to say that I think the the proposed separation makes sense, with a caveat that the twine publish step would probably also need to be separate.

@webknjaz webknjaz added type: refactor Refactoring code type: maintenance Related to Development and Maintenance Processes state: needs eyes Needs a maintainer/triager to take a closer look labels Mar 4, 2024
@pradyunsg
Copy link
Member

When, say, NEWS.rst needs to be tweaked, the process is a little bit cumbersome. One needs to update the file, commit, reorder the commits so the bump for development commits is last, then delete the tag and re-create it.

FWIW, I've filed #12764 to allow tweaking the NEWS file prior to the set of commits being made.

@webknjaz
Copy link
Member

Oh, I thought it's already being reviewed/post-processed pre-release..

@sbidoul
Copy link
Member Author

sbidoul commented Jun 24, 2024

I'm happy with #12764, so closing this. Thanks @pradyunsg !

@sbidoul sbidoul closed this as completed Jun 24, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
state: needs eyes Needs a maintainer/triager to take a closer look type: maintenance Related to Development and Maintenance Processes type: refactor Refactoring code
Projects
None yet
Development

No branches or pull requests

3 participants