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

Enforce fragment name structure #649

Closed
dorschw opened this issue Aug 4, 2024 · 3 comments · Fixed by #650
Closed

Enforce fragment name structure #649

dorschw opened this issue Aug 4, 2024 · 3 comments · Fixed by #650

Comments

@dorschw
Copy link
Contributor

dorschw commented Aug 4, 2024

We're using Jira, and want all fragments to be named according to the issue numbering format (e.g. ABCD-12345.feature.md).
Is there any way to configure towncrier to enforce the fragment file name somehow? (e.g. supplying a regex)

If there isn't one, I may be able to contribute it.

@adiroiban
Copy link
Member

Thanks for the report

which towncrier command do you want to enforce the format create, build, or check ?

There is only support to check that .feature is one of the configured fragment types.

Happy to review and approve a PR that adds this functionality.

As long as it has documentation, tests and it does't break the existing tests, it should be good to merge.

@dorschw
Copy link
Contributor Author

dorschw commented Aug 4, 2024 via email

@adiroiban
Copy link
Member

I think that towncrier check is the high priority part ... and maybe we can keep it simple and add validation only there.

We do some validation in towncrier build and that validation is reused in towncrier check

You can give it a go and see what option is best for you.


I can image that in the future we can go crazy and allow towncrier to call a project specific python method that will check that the ticket actually exists and is not already closed :) ... but that is for another time.


Most of my errors with ticket ID is messing up the digits ... for example using 5634 instead of 5643 ... but I have no idea how you can validate this, as in most cases both issues were opened.
I only observed that I messed the tiket ID, when merging the PR and ending up with the wrong issue automatically closed.


We can keep it simple and add a regex.

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