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

allow specifying fragment types to consider as "valid" for towncrier check #617

Closed
bentheiii opened this issue Jun 19, 2024 · 4 comments · Fixed by #618
Closed

allow specifying fragment types to consider as "valid" for towncrier check #617

bentheiii opened this issue Jun 19, 2024 · 4 comments · Fixed by #618

Comments

@bentheiii
Copy link
Contributor

bentheiii commented Jun 19, 2024

Hello, it would be helpful to us to be able to specify within towncrier check which fragment types it should look for or not look for.

Background on why this would be useful: We have automatic processes that create a newsfragment of a special type (dependency_bump) whenever a version of one of dependency libraries is updated. Even though these are real changes that we'd like to be noted in the changelog, we'd like towncrier check to assert that there are real human-readable newsfragments that explain the actual change, if any.

I propose an additional, optional key to configured sections ([[tool.towncrier.type]]): ignore_on_check. if this key is configured to True, towncrier check will ignore all newsfragments of this type

@adiroiban
Copy link
Member

Hi Ben.

Thanks for the report.

I don't think I understand what is the request here. Sorry.

Can you please give a step by step example with the current behaviour/result of towncrier vs the expected behaviour / expected result ?

Cheers

@bentheiii
Copy link
Contributor Author

Hi Adi.

What I want is for towncrier check, which checks for new newsfragments (and exits with an error if none are found), to ignore newsfragemnts of certain types. So for example, if our pyproject.toml looks like this:

...
[[tool.towncrier.type]]
directory = "feature"
name = "Features"

[[tool.towncrier.type]]
directory = "dbump"
name = "Dependency Bumps"
ignore_on_check = true  # <-- the new flag propose to add
...

Then towncrier check will only pass if there are newsfragments of a non-dbump type

Also, I realized that the original issue incorrectly referenced the [[tool.towncrier.section]], I edited it to be correct

@adiroiban
Copy link
Member

adiroiban commented Jun 20, 2024

Let me see if I got this right.

For example you have a branch called 313-update-cryptography

And on that branch you might have the following newsfragments

  • newsfragments/313.security -> generated by a person for example to add info about the embedded OpenSSL version update
  • newsfragments/313.dump -> generated by your deps update tool

So with with just newsfragments/313.dump on the branch, towncrier check should fail.

Is that correct ?

Feel free to send a PR.

As long as the PR has documentation and automated tests, we can have it merged.

@bentheiii
Copy link
Contributor Author

Yes, that's right, I will work on a PR

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

Successfully merging a pull request may close this issue.

2 participants