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

Add ability to automatically detect duplicates #81

Open
thanethomson opened this issue May 16, 2023 · 0 comments
Open

Add ability to automatically detect duplicates #81

thanethomson opened this issue May 16, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@thanethomson
Copy link
Contributor

As part of the release workflow, it'd be great to know whether any duplicate entries have snuck into a particular branch. With CometBFT, we often have this situation where we submit a PR to the main branch and then backport it to other release branches. But then the changelog entry/entries shouldn't actually exist directly on main in the .changelog/unreleased directory.

Suggested workflow:

# First stash/commit any local changes

# Search for any entries from the local .changelog/unreleased folder that also appear in any specific
# releases' changelogs. When searching locally, it should only check for duplicates of whatever's in
# the local ".changelog/unreleased" folder, otherwise it could incorrectly flag entries that were backported
# across multiple releases.
> unclog find-duplicates
# File in local unreleased          File in release changelog log
.changelog/unreleased/123-issue.md  .changelog/v0.34.27/123-issue.md

# Search for entries in the local .changelog/unreleased folder that also exist on the "v0.38.x" branch
> unclog find-duplicates v0.38.x
# File in local unreleased          File on other branch                Other branch
.changelog/unreleased/123-issue.md  .changelog/unreleased/123-issue.md  v0.38.x

# Search for entries in the local .changelog/unreleased folder that also exist on the "v0.38.x",
# "v0.37.x" or "v0.34.x" branches
> unclog find-duplicates v0.38.x v0.37.x v0.34.x
# File in local unreleased          File on other branch                Other branch
.changelog/unreleased/123-issue.md  .changelog/unreleased/123-issue.md  v0.38.x
.changelog/unreleased/123-issue.md  .changelog/v0.37.1/123-issue.md  v0.37.x

This functionality would require that unclog be capable of temporarily checking out the given branch(es), when supplied, to be able to check for duplicates. The output on stdout should be able to be parsed by other BASH tooling so as to facilitate automation.

Whether or not a file is a duplicate should depend on:

  1. The file name
  2. The file contents
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant