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

feat: support count_tags option #599

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tisonkun
Copy link

@tisonkun tisonkun commented Apr 9, 2024

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 from v0.7.0..v0.7.2 and the v0.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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (no code change)
  • Refactor (refactoring production code)
  • Other

Checklist:

  • My code follows the code style of this project.
  • I have updated the documentation accordingly.
  • I have formatted the code with rustfmt.
  • I checked the lints with clippy.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@tisonkun tisonkun requested a review from orhun as a code owner April 9, 2024 23:10
Copy link

welcome bot commented Apr 9, 2024

Thanks for opening this pull request! Please check out our contributing guidelines! ⛰️

@tisonkun
Copy link
Author

tisonkun commented Apr 9, 2024

Before:
$ GITHUB_TOKEN=*** git cliff v0.7.0..v0.7.2

v0.7.2

Release date: April 08, 2024

Breaking changes

  • refactor!: Renames the new memtable to PartitionTreeMemtable by @evenyag in #3547
  • fix!: columns table in information_schema misses some columns by @killme2008 in #3639

🚀 Features

🐛 Bug Fixes

  • fix: clone data instead of moving it - homemade future is dangerous by @waynexia in #3542
  • fix: performance degradation caused by config change by @v0y4g3r in #3556
  • fix(flow): Arrange get range with batch unaligned by @discord9 in #3552
  • fix: set http response chartset to utf-8 when using table format by @xxxuuu in #3571
  • fix: update pk_cache in compat reader by @waynexia in #3576
  • fix: incorrect version info in by @waynexia in #3586
  • fix: canonicalize catalog and schema names by @killme2008 in #3600
  • fix: adjust status code to http error code map by @waynexia in #3601
  • fix: run purge jobs in another scheduler by @evenyag in #3621
  • fix: mistakely removes compaction inputs on failure by @v0y4g3r in #3635
  • fix: move object store read/write timer into inner by @dimbtp in #3627
  • fix: construct correct pk list with pre-existing pk by @waynexia in #3614

🚜 Refactor

📚 Documentation

🧪 Testing

  • test: add a parameter type mismatch test case to sql integration test by @xxxuuu in #3568
  • test: add tests for drop databases by @WenyXu in #3594
  • test: add more integration test for kafka wal by @niebayes in #3190
  • test(sqlness): release databases after tests by @WenyXu in #3648

⚙️ Miscellaneous Tasks

Build

New Contributors

All Contributors

We 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.1

Release date: March 14, 2024

Breaking changes

  • fix!: remove error message from http header to avoid panic by @sunng87 in #3506

🚀 Features

🐛 Bug Fixes

🚜 Refactor

  • refactor: separate the quote char and value by @WenyXu in #3455
  • refactor: introduce new Output with OutputMeta by @shuiyisong in #3466
  • refactor: make http api returns non-200 status code by @crwen in #3473
  • refactor: validate constraints eagerly by @tisonkun in #3472

📚 Documentation

⚡ Performance

  • perf: Reduce decode overhead during pruning keys in the memtable by @evenyag in #3415
  • perf: more benchmarks for memtables by @evenyag in #3491

🧪 Testing

⚙️ Miscellaneous Tasks

Build

New Contributors

All Contributors

We 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

v0.7.2

Release date: April 08, 2024

Breaking changes

  • fix!: remove error message from http header to avoid panic by @sunng87 in #3506
  • refactor!: Renames the new memtable to PartitionTreeMemtable by @evenyag in #3547
  • fix!: columns table in information_schema misses some columns by @killme2008 in #3639

🚀 Features

🐛 Bug Fixes

🚜 Refactor

📚 Documentation

⚡ Performance

  • perf: Reduce decode overhead during pruning keys in the memtable by @evenyag in #3415
  • perf: more benchmarks for memtables by @evenyag in #3491

🧪 Testing

  • test: add fuzz test for create table by @WenyXu in #3441
  • test: add a parameter type mismatch test case to sql integration test by @xxxuuu in #3568
  • test: add tests for drop databases by @WenyXu in #3594
  • test: add more integration test for kafka wal by @niebayes in #3190
  • test(sqlness): release databases after tests by @WenyXu in #3648

⚙️ Miscellaneous Tasks

Build

New Contributors

All Contributors

We 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-commenter
Copy link

codecov-commenter commented Apr 9, 2024

Codecov Report

Attention: Patch coverage is 0% with 9 lines in your changes are missing coverage. Please review.

Project coverage is 40.97%. Comparing base (3b74254) to head (63cffa7).
Report is 1 commits behind head on main.

Files Patch % Lines
git-cliff/src/lib.rs 0.00% 9 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #599      +/-   ##
==========================================
- Coverage   41.27%   40.97%   -0.30%     
==========================================
  Files          15       15              
  Lines        1071     1079       +8     
==========================================
  Hits          442      442              
- Misses        629      637       +8     
Flag Coverage Δ
unit-tests 40.97% <0.00%> (-0.30%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -109,6 +109,9 @@ pub struct GitConfig {
/// Regex to ignore matched tags.
#[serde(with = "serde_regex", default)]
pub ignore_tags: Option<Regex>,
/// Regex to count matched tags.
#[serde(with = "serde_regex", default)]
pub count_tags: Option<Regex>,
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Naming is hard. I name it "count" because it's if "counted".

"include" may be an alternative, but .. we have two aspects here: (1) whether count the commit (2) whether count the tag.

@@ -109,6 +109,9 @@ pub struct GitConfig {
/// Regex to ignore matched tags.
#[serde(with = "serde_regex", default)]
pub ignore_tags: Option<Regex>,
/// Regex to count matched tags.
#[serde(with = "serde_regex", default)]
pub count_tags: Option<Regex>,
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, how we can support pass this option from command line?

@orhun
Copy link
Owner

orhun commented Apr 13, 2024

Hey, thanks for the PR! 🐻

This option is pretty confusing to me right now, due to the fact that we have a couple of *_tags options in the config and each time I need to remember what they were doing 😅

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.

@tisonkun
Copy link
Author

@orhun Please take a look at #599 (comment). This is an example.

Mainly, when the range selected contains multiple tags, instead of ignore_tags, we use an inverted condition to choose which retains, without skipping any commits.

@tisonkun
Copy link
Author

We should also mention this in the documentation as well.

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.

@tisonkun
Copy link
Author

@orhun as a reminder. Any further thoughts here?

@orhun
Copy link
Owner

orhun commented Apr 30, 2024

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?

This is tested locally that with count_tags = "v0.7.2" I can select commits from v0.7.0..v0.7.2 and the v0.7.1 tag doesn't break changelog.

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 count_tags to include_tags but I then we will have skip_tags, ignore_tags and include_tags and things might get even more complicated in the future. I would rather find a solution that does not require adding a new config option, if possible.

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 🐻

@tisonkun
Copy link
Author

tisonkun commented May 3, 2024

include a tag in the changelog even if it is skipped or in the given range

I think the most understandable description is:

It's hard to write reverse matches with ignore_tags, count_tags is the reverse version.

What do you mean by "breaking" the changelog here? Do you mean splitting it into two?

Yes.

@tisonkun
Copy link
Author

tisonkun commented May 3, 2024

This is the simplified example:

Before:
$ GITHUB_TOKEN=*** git cliff v0.7.0..v0.7.2

v0.7.2

Release date: April 08, 2024

Breaking changes

  • refactor!: Renames the new memtable to PartitionTreeMemtable by @evenyag in #3547
  • fix!: columns table in information_schema misses some columns by @killme2008 in #3639

v0.7.1

Release date: March 14, 2024

Breaking changes

  • fix!: remove error message from http header to avoid panic by @sunng87 in #3506
After:
$ GITHUB_TOKEN=*** /Users/tison/Brittani/git-cliff/target/debug/git-cliff v0.7.0..v0.7.2

v0.7.2

Release date: April 08, 2024

Breaking changes

  • fix!: remove error message from http header to avoid panic by @sunng87 in #3506
  • refactor!: Renames the new memtable to PartitionTreeMemtable by @evenyag in #3547
  • fix!: columns table in information_schema misses some columns by @killme2008 in #3639

@tisonkun
Copy link
Author

@orhun do you still need extra information?

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

Successfully merging this pull request may close these issues.

None yet

3 participants