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

towncrier create command doesn't support the (optional) fragment counter #474

Closed
pawelad opened this issue Feb 7, 2023 · 2 comments
Closed

Comments

@pawelad
Copy link

pawelad commented Feb 7, 2023

Hi,

I was looking for a "multiple news fragments of the same type linked to one issue" functionality, and I found it through #355 and #119, but unfortunately it doesn't seem to work with the towncrier create command:

$ towncrier create 2585.changed.1.md
Usage: towncrier create [OPTIONS] FILENAME
Try 'towncrier create --help' for help.

Error: Invalid value: Expected filename '2585.changed.1.md' to be of format '{name}.{type}', where '{name}' is an arbitrary slug and '{type}' is one of: feature, bugfix, doc, removal, misc

It does seem to work when I manually create the file 2585.changed.1.md though, so it might just be the problem with the command not supporting it?

Also, if this is a supported feature (which I think it is, based on https://github.com/twisted/towncrier/search?q=counter), it would be nice to mention it somewhere in the docs.

I'm happy to help with a PR if needed.

@adiroiban
Copy link
Member

Thanks for the report.

I think this is an important functionality that is missing.

I have no idea how to fix it in a clean way.

I am using a fork of towncrier in which I have hacked support for something like 2585-1.changed.md

.changes.md should always stay the same as this is the fragment type.

Maybe this can be implemented as 2585.1.changed.md

In theory for towncrier anything before .changed.md should be considered the unique fragment/issue ID.

But then, things get complicated when you try to extract the ticket ID to generate a link in the release notes.


One might argue that if 2 fragments are needed, then the PR should be split into 2 separate tickets/PRs... but I disagree :)

So looking forward to see how this can be solved in a smart way :)

SmileyChris added a commit to SmileyChris/towncrier that referenced this issue Feb 9, 2023
@SmileyChris
Copy link
Contributor

@adiroiban -- I'm not sure why you need a fork, this is built in functionality: the incremental counter goes after the change type.

This works for both 123.feature.1 and 123.feature.1.md

I remember thinking it was silly that towncrier create didn't do this for you. I got around to submitting a PR so it will 😎

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