bedevere
bedevere copied to clipboard
`News entry file name incorrectly formatted` when moving a news entry
If a news entry is moved to a different category, you get News entry file name incorrectly formatted as an error message.
https://github.com/python/bedevere/blob/504dc34aee40478ddea8331ad090b63710974e7c/bedevere/news.py#L59
https://github.com/python/bedevere/blob/504dc34aee40478ddea8331ad090b63710974e7c/bedevere/news.py#L73-L80
I spent way too long trying to figure this out.
If a news entry is moved to a different category,
How does this happen?
Please can you share steps to reproduce?
I manually moved an existing news entry because it was in the wrong category.
Please can you give explicit steps of what you did/ran, what happened and what you expected?
The relevant pull request is here: https://github.com/python/cpython/pull/120735
- I moved
Misc/NEWS.d/next/Core and Builtins/2024-04-28-19-51-00.gh-issue-118263.Gaap3S.rsttoMisc/NEWS.d/next/Library/2024-04-28-19-51-00.gh-issue-118263.Gaap3S.rst. - I got this error: bedevere/news — News entry file name incorrectly formatted.
- I thought I had maybe broken the formatting in
Misc/NEWS.d/3.13.0a6.rstorMisc/NEWS.d/3.13.0b1.rst, so I checked if I had modified the file correctly, which I did. - I then went to this repository to look for the error message, which is only printed if
in_next_dir and file_found. - I checked the filename of the news entries against the regex, but they were correctly formatted.
- I then realised
len(file["patch"])had to be 0.
In this case the error message should simply be No news entry in Misc/NEWS.d/next/ or "skip news" label found.
We should probably move it to this check:
https://github.com/python/bedevere/blob/504dc34aee40478ddea8331ad090b63710974e7c/bedevere/news.py#L52-L53
if not util.is_news_dir(file["file_name"]) or len(file["patch"]) == 0:
continue
I also saw this error after renaming a blurb file to fix the referenced issue number in PR python/cpython#125285