Views on tag deletion prior to release #2185
Replies: 1 comment 5 replies
-
I view the git tag is the point of truth that everything else in the release chain derives from (as the GH release is derived from the tag, the sdist is strictly derived from the tag, and any down stream packaging (like wheels, conda packages, linux packages, ...) are derived from the sdist). If you create a tag "locally" either on your own machine or in a CI job but do not push it I think it is fair to change your mind and remake the tag (or just abort the whole process) because no one else has had a chance to see it. However, once the tag is pushed to the canonical repository you have irrevocably used that name for than commit. If something goes wrong somewhere down stream from creating the tag I think the options are to either fix those downstream things in what ever way you have to or to fix them upstream and make a new tag. At the end of the day incrementing a patch release number is super cheap compared to violating "tags never change". Similarly, "a tag is missing artifacts" is free, but "the tag does not match the artifacts that have the same name", even if rare, can have a huge cost! |
Beta Was this translation helpful? Give feedback.
-
This is a transfer and summary of points brought up on PR #2183. So tagging people who were part of that discussion RE: Git tags: @webknjaz, @kratsg, @henryiii. Thanks again to @webknjaz for the time he's contributed to discussing these ideas with us!
There @webknjaz had mentioned
and
As I mentioned in #2183 (comment), while I understand the idea that the tag is immutable (because it is) I don't see the problem with deleting a tag if there is a problem that was caught when it was made. Deleting a tag is not ideal, and should be rare, but I would prefer to delete a tag that has existed in a repository that I maintain for less than 10 minutes before a release is made then to treat a pre-release tag as an unchangeable component of Git history that can't be rewritten through deletion to avoid disruption in development and user experience (here I'm imagining a worse case scenario where a tag has been pushed to some branch through human error where it should never have landed).
I also want to ensure the provenance of the distribution by requiring that a tag with an associated GitHub release necessarily cause the creation and deployment of a distribution to PyPI from that tag. I should also mention that after a distribution is published then I very much want to treat that tag as undeletable as I want to keep provenance.
Also, what is an example of an external system that watches git tags? I do not know of any services that I use that do this. On the contrary, Zenodo is looking for a GitHub Release (as @kratsg pointed out in #2183 (comment)) and conda-forge is looking for a PyPI release (which for pyhf means a GitHub Release was made). I fully believe that there are services that are looking specifically for tags but if I as a maintainer am not using them, and I am not providing infrastructure as a service, then should I be constrained in how I want to manage a project given a service that exists that I don't support?
The current (pre-PR #2183) workflow of how
pyhf
publishes things might be relevant for how I'm thinking about things and can be found here #2183 (comment).I'm by all admissions not an expert's expert here, so if there are things that I'm missing from security, or workflow best practices, or just overlooked problems I'd be quite interested to learn about them. At the moment not being able to rewrite Git history for a good reason feels like imposing SVN-like restrictions on my maintainer workflow for dealing with errors in deployment that never should happen unless gross human error has occurred. Can people explain more to me?
Though @webknjaz did mention
so I should probably be looking at workflows that he manages to understand this approach, though the provenance seems a bit off if the artifact is build before the tag is created.
In the event that this needs to be said, I very much welcome feedback from the broader Python community here, so if you were not tagged I would still like to hear from you.
Beta Was this translation helpful? Give feedback.
All reactions