I need to revert a PR applied to main and backported to 3.13 and 3.14. The original commits had a NEWS file. I’ve not had to do this before, so I’m just posting here to make sure I’m going about it the right way, which seems to me to be in each of main, 3.13 and 3.14:
Revert the original (squashed) commit in that branch using git revert and using the original issue number in the PR.
Add a NEWS file indicating the reversion.
I notice that even though the original NEWS entry is deleted in the reversion, and “skip news” isn’t set on the PR, the NEWS check still passes - not sure that’s right.
An alternative approach would be to do the reversion in main and then backport that PR to 3.13 and 3.14.
If the code has not been in any release, your individual news file should still exist. Simply deleting it with your revert/rollback is enough - there is no need for a followup news entry at that point.
If it has been in a release build, adding a mention in a new news file is a good idea. If the news entry was rolled up into a larger news file as happens at release time, you can edit the entry in that to mention “(oops, we had to revert this change, sorry)”. I don’t remember when in which release process news files get rolled up (it’s RM automation :magic:) into a single one and mostly just go by what I find in the repo when I’m doing the thing.
skip news as a label likely just keys off of a news file being in the PR diff anywhere. good enough for most purposes. It isn’t worth overthinking this PR check.
It’s with every release, and it’s done by running blurb release. If you look at the history of changes to individual NEWS.d files you’ll see they’re always created by a commit without a PR, with the message Python <version> (for example: Python 3.14.0b3 · python/cpython@26d485d · GitHub). Those commits always create the NEWS.d/<release>.rst file and delete all the individual blurb files, in one commit.
If the change you’re reverting has been released, I would create a new NEWS entry describing the revert but not edit the old NEWS.d file. The NEWS.d file is meant to describe the release, not future releases. If you think the revert is at all worth noting beyond its own blurb file, it should be mentioned in the What’s New document though.