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

[refactor][cli][PIP-280] Create new pulsar-cli-utils module #20782

Merged
merged 23 commits into from
Aug 23, 2023
Merged

[refactor][cli][PIP-280] Create new pulsar-cli-utils module #20782

merged 23 commits into from
Aug 23, 2023

Conversation

JooHyukKim
Copy link
Contributor

@JooHyukKim JooHyukKim commented Jul 11, 2023

PIP: #20691

Motivation

As PIP-280 #20691 may span cross module, we need a module to provide CLI related (though mostly JCommander atm) isolation. Note that pulsar-common was not considered because it's common (too broad).

Modifications

  • Add new module pulsar-cli-utils
  • Implement Converters for meaurement unit (time,byte) conversion
  • Implement Validators for

Note

Verifying this change

  • Make sure that the change passes the CI checks.

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository: https://github.com/JooHyukKim/pulsar/pull/19

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Jul 11, 2023
@codecov-commenter
Copy link

codecov-commenter commented Jul 12, 2023

Codecov Report

Merging #20782 (d9d2194) into master (9b6a123) will increase coverage by 0.52%.
The diff coverage is 75.86%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #20782      +/-   ##
============================================
+ Coverage     72.61%   73.14%   +0.52%     
- Complexity    31966    32240     +274     
============================================
  Files          1868     1880      +12     
  Lines        139185   139300     +115     
  Branches      15315    15323       +8     
============================================
+ Hits         101071   101891     +820     
+ Misses        30052    29353     -699     
+ Partials       8062     8056       -6     
Flag Coverage Δ
inttests 24.12% <77.27%> (?)
systests 25.29% <77.27%> (+0.13%) ⬆️
unittests 72.43% <75.86%> (+0.45%) ⬆️

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

Impacted Files Coverage Δ
...apache/pulsar/cli/converters/RelativeTimeUtil.java 28.57% <28.57%> (ø)
...org/apache/pulsar/cli/converters/ByteUnitUtil.java 58.82% <58.82%> (ø)
...lsar/cli/converters/TimeUnitToMillisConverter.java 71.42% <71.42%> (ø)
...sar/cli/converters/TimeUnitToSecondsConverter.java 71.42% <71.42%> (ø)
...va/org/apache/pulsar/cli/ValueValidationUtils.java 93.75% <93.75%> (ø)
.../apache/pulsar/broker/resources/BaseResources.java 72.72% <95.23%> (+5.31%) ⬆️
...he/pulsar/broker/resources/NamespaceResources.java 81.42% <100.00%> (ø)
...ulsar/cli/converters/ByteUnitIntegerConverter.java 100.00% <100.00%> (ø)
...pulsar/cli/converters/ByteUnitToLongConverter.java 100.00% <100.00%> (ø)
...r/cli/validators/IntegerMaxValueLongValidator.java 100.00% <100.00%> (ø)
... and 4 more

... and 122 files with indirect coverage changes

@JooHyukKim
Copy link
Contributor Author

/pulsarbot rerun-failure-checks

@JooHyukKim
Copy link
Contributor Author

JooHyukKim commented Jul 12, 2023

Re-running the following failed checks

  • OWASP dependency check : seems like it has to with rate limiting.
  • Pulsar IO - Oracle Browser just freezes, maybe too much log? (I will check other completed Actions to verify)

EDIT : Made a PR in to cover OWASP check #20792

@JooHyukKim
Copy link
Contributor Author

JooHyukKim commented Jul 13, 2023

Need #20792 to resolve the OWASP blocker

@JooHyukKim
Copy link
Contributor Author

May I ask for a review when you have time 😆, @tisonkun @BewareMyPower @mattisonchao ? thanks 🙏🏼

@tisonkun tisonkun self-requested a review July 17, 2023 06:13
@JooHyukKim
Copy link
Contributor Author

/pulsarbot rerun-failure-checks

@JooHyukKim
Copy link
Contributor Author

JooHyukKim commented Jul 19, 2023

#20792 should fixs the OWASP check currently failing, but the suppression turns out to be more difficult than it seems. Any help will be welcome

@tisonkun
Copy link
Member

@JooHyukKim you can now rebase this branch on the fixed master :D

@JooHyukKim JooHyukKim requested a review from gaoran10 July 31, 2023 00:11
@Technoboy- Technoboy- added this to the 3.2.0 milestone Jul 31, 2023
Copy link
Contributor

@gaoran10 gaoran10 left a comment

Choose a reason for hiding this comment

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

Great work! LGTM

Copy link
Contributor

@BewareMyPower BewareMyPower left a comment

Choose a reason for hiding this comment

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

Overall LGTM. Just a few comments about the naming.

You use Util for RelativeTimeUtil and ByteUnitUtil and Utils for ValueValidationUtils. Should we use a consistent naming style?

@JooHyukKim
Copy link
Contributor Author

/pulsarbot rerun-failure-checks

1 similar comment
@JooHyukKim
Copy link
Contributor Author

/pulsarbot rerun-failure-checks

Copy link
Member

@tisonkun tisonkun left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for your contribution!

@tisonkun tisonkun merged commit 4f9b199 into apache:master Aug 23, 2023
44 of 45 checks passed
@tisonkun
Copy link
Member

@JooHyukKim Maybe you can open a tracking issue to list out the subtasks and finish them one by one. In this way, we can share the same page what is remaining and maybe offer some helps.

@JooHyukKim JooHyukKim deleted the pip280-separate-module branch August 23, 2023 12:16
@JooHyukKim
Copy link
Contributor Author

@tisonkun Oh yes sounds like a good idea. Will do 👍🏻

thetumbled pushed a commit to thetumbled/pulsar that referenced this pull request Feb 28, 2024
thetumbled pushed a commit to thetumbled/pulsar that referenced this pull request Feb 28, 2024
thetumbled pushed a commit to thetumbled/pulsar that referenced this pull request Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-not-needed Your PR changes do not impact docs ready-to-test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants