Avoid duplicate entries
Closed this issue · 2 comments
Is your feature request related to a problem? Please describe.
Say I want to add some hint about bumped dependencies to my changelogs.
Using dependabot and/or Renovate, it would be natural to automatically create such entries as part of some workflow.
Now, if I don't add
Describe the solution you'd like
When I run
❯ changie new --kind Fixed --body "Bump dependencies"
❯ changie new --kind Fixed --body "Bump dependencies"
then
❯ changie batch --dry-run auto | grep 'Bump dependencies' | wc -l
should output 1.
Describe alternatives you've considered
In the workflow that adds the changelog entry, I could check whether changie batch
already contains the desired line.
That feels clunky, though. Plus, I don't see a use case for ever including duplicate entries, so it seems more natural to solve this in changie.
One might also want to create an entry like
### Fixed
- Bump dependencies
- some-lib -> v1.2.3
- other-lib -> v3.2.1
and accumlate bumps across multiple PRs. Not sure how to add that to changie workflows in any sane way.
hmm, I see what you are trying to say here. A few things come to mind.
- I don't usually mention dependencies in my changelogs unless there is some downstream impact, like a new tool or a major upgrade that actually affects them.
- But, regardless of the bump dependencies the point of deduplicating multiple identical messages is valid.
- One method you can do is to set the fragment format to just be say
{{.Kind}}-{{.Body}}
which will then not generate random values and thus create file conflicts if two identical fragments were found. ( I think there is a -f that will force the file if one already exists ) - Other then that, I don't think there is anything already built.
But, I am not sure changie really has any business in dealing with things like duplicate values or any other sort of release notes processing.
It could be possible to create a version footer with all version bumps, it would require a script probably or something though.
Going to close this, ultimately changie really just has no proper support for dependency tracking which is where this problem is based. Personally I do not track dependencies in my changelogs but if that is something you would prefer doing, there is really no automatic method as of now. It is definitely something I want to consider but currently I do not have much time right now.