twisted / towncrier

Manage the release notes for your project.

Home Page:https://towncrier.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

pawelad opened this issue · comments

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.

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 :)

@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 😎