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

News entry file name incorrectly formatted when moving a news entry #642

Open
nineteendo opened this issue Jun 21, 2024 · 6 comments
Open

Comments

@nineteendo
Copy link

If a news entry is moved to a different category, you get News entry file name incorrectly formatted as an error message.

if FILENAME_RE.match(file_path.name) and len(file["patch"]) >= 1:

if not in_next_dir:
description = (
f'No news entry in {util.NEWS_NEXT_DIR} or "skip news" label found'
)
elif not file_found:
description = "News entry not in an appropriate directory"
else:
description = "News entry file name incorrectly formatted"

I spent way too long trying to figure this out.

@hugovk
Copy link
Member

hugovk commented Jun 23, 2024

If a news entry is moved to a different category,

How does this happen?

Please can you share steps to reproduce?

@nineteendo
Copy link
Author

I manually moved an existing news entry because it was in the wrong category.

@hugovk
Copy link
Member

hugovk commented Jun 23, 2024

Please can you give explicit steps of what you did/ran, what happened and what you expected?

@nineteendo
Copy link
Author

nineteendo commented Jun 23, 2024

The relevant pull request is here: python/cpython#120735

  1. I moved Misc/NEWS.d/next/Core and Builtins/2024-04-28-19-51-00.gh-issue-118263.Gaap3S.rst to Misc/NEWS.d/next/Library/2024-04-28-19-51-00.gh-issue-118263.Gaap3S.rst.
  2. I got this error: bedevere/news — News entry file name incorrectly formatted.
  3. I thought I had maybe broken the formatting in Misc/NEWS.d/3.13.0a6.rst or Misc/NEWS.d/3.13.0b1.rst, so I checked if I had modified the file correctly, which I did.
  4. I then went to this repository to look for the error message, which is only printed if in_next_dir and file_found.
  5. I checked the filename of the news entries against the regex, but they were correctly formatted.
  6. 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.

@nineteendo
Copy link
Author

nineteendo commented Jun 23, 2024

We should probably move it to this check:

if not util.is_news_dir(file["file_name"]):
continue

if not util.is_news_dir(file["file_name"]) or len(file["patch"]) == 0:
    continue

@rhansen
Copy link

rhansen commented Oct 10, 2024

I also saw this error after renaming a blurb file to fix the referenced issue number in PR python/cpython#125285

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants