-
-
Notifications
You must be signed in to change notification settings - Fork 199
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
feat(changelog): support count_tags option #599
Conversation
Thanks for opening this pull request! Please check out our contributing guidelines! ⛰️ |
Before:$ GITHUB_TOKEN=*** git cliff v0.7.0..v0.7.2
🚀 Features
🐛 Bug Fixes
🚜 Refactor
📚 Documentation
🧪 Testing
⚙️ Miscellaneous Tasks
Build
New ContributorsAll ContributorsWe would like to thank the following contributors from the GreptimeDB community: @CookiePieWw, @J0HN50N133, @MichaelScofield, @Taylor-lagrange, @WenyXu, @YCCDSZXH, @ZonaHex, @dimbtp, @discord9, @etolbakov, @evenyag, @fengjiachun, @killme2008, @niebayes, @shuiyisong, @sunng87, @tisonkun, @v0y4g3r, @waynexia, @xxxuuu, @zhongzc v0.7.1Release date: March 14, 2024 Breaking changes🚀 Features
🐛 Bug Fixes
🚜 Refactor
📚 Documentation⚡ Performance
🧪 Testing⚙️ Miscellaneous Tasks
BuildNew Contributors
All ContributorsWe would like to thank the following contributors from the GreptimeDB community: @MichaelScofield, @Taylor-lagrange, @WenyXu, @ZonaHex, @crwen, @discord9, @etolbakov, @evenyag, @fengjiachun, @gcmutator, @shuiyisong, @sunng87, @tisonkun, @v0y4g3r, @waynexia, @zhongzc After:$ GITHUB_TOKEN=*** /Users/tison/Brittani/git-cliff/target/debug/git-cliff v0.7.0..v0.7.2
🚀 Features
🐛 Bug Fixes
🚜 Refactor
📚 Documentation
⚡ Performance
🧪 Testing
⚙️ Miscellaneous Tasks
Build
New Contributors
All ContributorsWe would like to thank the following contributors from the GreptimeDB community: @CookiePieWw, @J0HN50N133, @MichaelScofield, @Taylor-lagrange, @WenyXu, @YCCDSZXH, @ZonaHex, @crwen, @dimbtp, @discord9, @etolbakov, @evenyag, @fengjiachun, @gcmutator, @killme2008, @niebayes, @shuiyisong, @sunng87, @tisonkun, @v0y4g3r, @waynexia, @xxxuuu, @zhongzc |
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #599 +/- ##
==========================================
- Coverage 39.80% 39.54% -0.26%
==========================================
Files 20 20
Lines 1598 1606 +8
==========================================
- Hits 636 635 -1
- Misses 962 971 +9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: tison <wander4096@gmail.com>
47d4ef3
to
63cffa7
Compare
Hey, thanks for the PR! 🐻 This option is pretty confusing to me right now, due to the fact that we have a couple of Can you remind me (with an example) in which use case this new option will come in handy? We should also mention this in the documentation as well. I'm happy to move on with this PR, or have a simpler solution based on what your use case is. |
@orhun Please take a look at #599 (comment). This is an example. Mainly, when the range selected contains multiple tags, instead of |
Sure. Where is the doc file? Also I'd like to know if it's automatically add a cli arg or I should modify other source code as well. |
@orhun as a reminder. Any further thoughts here? |
Sorry for the delay! I just took a look at this again and I think I understood your use case. But just to verify: do you want to include a tag in the changelog even if it is skipped or in the given range?
What do you mean by "breaking" the changelog here? Do you mean splitting it into two? It sounds like a very edge-case use-case though, so I'm not sure how to make this option intuitive for regular users. First step would be renaming Btw I didn't fully get the example you shared, since there were many commits and it makes it hard to read. Can you maybe share it again with minimal git history, such as git-cliff-readme-example? I just want to make sure everything is clear before moving on with this 🐻 |
I think the most understandable description is: It's hard to write reverse matches with ignore_tags, count_tags is the reverse version.
Yes. |
This is the simplified example: Before:$ GITHUB_TOKEN=*** git cliff v0.7.0..v0.7.2
v0.7.1Release date: March 14, 2024 Breaking changesAfter:$ GITHUB_TOKEN=*** /Users/tison/Brittani/git-cliff/target/debug/git-cliff v0.7.0..v0.7.2 |
@orhun do you still need extra information? |
Yes, it is more clear now. If this new option is going act as a reverse match to How about adding a special case to [git]
ignore_tags = "!v0.7.2" Feels a bit hacky but I think it's more clean. What do you think? |
@orhun Yeah. I can understand this alternative and it can resolve my issue. Could you write a patch in this way? I don't know how to tune the revert rules in details. A downside can be, when you'd actually like to combine include and exclude rules, with override and "OR" logic, it may run into a super complex scenarios if we patching on an option instead of make each action a single option. But we may not reach there. |
Sure, I'm happy to work on it! I need to come up with an example case for testing this feature though. Can you help me with that? More specifically, I would like to add a test fixture for making sure that we have the correct functionality. For that, I need a list of commits as follows, example configuration and expected output. git commit --allow-empty -m "Initial commit"
git commit --allow-empty -m "feat: add feature 1"
git commit --allow-empty -m "fix: fix feature 1"
git tag v0.1.0
git commit --allow-empty -m "feat(gui): add feature 2"
git commit --allow-empty -m "fix(gui): fix feature 2"
git tag v0.2.0
git commit --allow-empty -m "test: add tests" You can check out this commit to see how to add new test fixtures. |
@orhun fixture cases pushed. You can view the expected result and do refactor as in your mind :D |
Signed-off-by: tison <wander4096@gmail.com>
beef585
to
f219ebd
Compare
@orhun let's give this patch another time slice? |
Sorry for the delay 😓
Yes, you are right. My initial assumption was Btw I also realized another thing, you can also get the same result with the following config (w/o [git]
# regex for skipping tags
skip_tags = "v0.1.0-beta.1"
# regex for ignoring tags
ignore_tags = "v.*-beta.*|v0.1.0" # Changelog
All notable changes to this project will be documented in this file.
## [0.2.0] - 2021-01-22
### Feat
- Add feature 1
- Fix feature 1
- Add feature 2
- Add feature 3
<!-- generated by git-cliff --> Have you considered using it like this? |
This is a good workaround, unless we have too many tags to exclude or the straightforward expression of the intention is "include". I can live with current options, but it's not quite straightforward :O |
What do you say if we document the usage of this option better in this PR and merge it along with the fixtures? I'm not sure having I can always come back to it if more people want this 🐻 (I resisted to adding GitHub integration for a long time until I saw people really needed it. It happens ⚔️ ) |
@orhun Your suggestion sounds good. Let me try to update the document for |
I come back that GreptimeTeam/greptimedb#4379 shows invert the logics and trying to exclude tags is hard. It's quite straightforward that I'd "include" only one tag. Let me update this patch a little bit. And @orhun I'd like to know how to specify these tags from command line. Because my use case would be:
The tag varies each time so it's even unnecessary to check in the cliff.toml file. |
I found |
Signed-off-by: tison <wander4096@gmail.com>
@orhun Updated. Please take a look. |
Signed-off-by: tison <wander4096@gmail.com>
I don't know why "Check NodeJS tarball" failed. Doesn't seem like related to this patch. |
Yup, CI failure is not related. I will come back to this PR soon, sorry for the wait 🐒 |
Signed-off-by: tison <wander4096@gmail.com>
@orhun master conflict. I merge and resolve that. Hopefully we can get a review in time to avoid further conflict. |
Signed-off-by: tison <wander4096@gmail.com>
https://github.com/orhun/git-cliff/actions/runs/10313078397/job/28549294078?pr=599 Seems unrelated? Or some integration tests setup issue I'm unfamiliar with. |
ping @orhun any estimate this patch gets another review? |
All looks good, will get to merging this today probably 👍🏼 |
Only thing left is I would like to mention #599 (comment) (alternative) in the docs very shortly. I can do it before merging or feel free to do it if you have time :) |
Yeah. I don't get it very clear. Please go ahead and I'll learn what you mean :D |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the contribution (and your patience!)
Congrats on merging your first pull request! ⛰️ |
@orhun Thanks for your review and knowledge on the software! I wonder if there is an estimate of a new release including this feature or where I can subscribe for the new release. |
Ah, I can probably get to it next week (- there is a conference coming up so I will be travelling). You can watch the repo for new releases or join the Discord for announcements :) |
Cool! Thank you. |
Description
@orhun I found a patch is more expressive than issue.
This is tested locally that with
count_tags = "v0.7.2"
I can select commits fromv0.7.0..v0.7.2
and thev0.7.1
tag doesn't break changelog.I wonder how we can support pass this option from command line and if we can add some tests.
Motivation and Context
See GreptimeTeam/greptimedb#3650 (comment).
How Has This Been Tested?
Manually tested.
Screenshots / Logs (if applicable)
Types of Changes
Checklist: