Skip to content

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

Merged
tisonkun merged 23 commits intoapache:masterfrom
JooHyukKim:pip280-separate-module
Aug 23, 2023
Merged

[refactor][cli][PIP-280] Create new pulsar-cli-utils module #20782
tisonkun merged 23 commits intoapache:masterfrom
JooHyukKim:pip280-separate-module

Conversation

@JooHyukKim
Copy link
Copy Markdown
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
Copy Markdown

codecov-commenter commented Jul 12, 2023

Codecov Report

❌ Patch coverage is 92.70833% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.14%. Comparing base (d6734b7) to head (b4b0ba7).
⚠️ Report is 1724 commits behind head on master.

Files with missing lines Patch % Lines
...lsar/cli/converters/TimeUnitToMillisConverter.java 71.42% 2 Missing ⚠️
...sar/cli/converters/TimeUnitToSecondsConverter.java 71.42% 2 Missing ⚠️
...ava/org/apache/pulsar/cli/ValueValidationUtil.java 93.75% 1 Missing ⚠️
...org/apache/pulsar/cli/converters/ByteUnitUtil.java 94.73% 1 Missing ⚠️
...apache/pulsar/cli/converters/RelativeTimeUtil.java 95.23% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##             master   #20782       +/-   ##
=============================================
+ Coverage     36.84%   73.14%   +36.30%     
- Complexity    12195    32204    +20009     
=============================================
  Files          1698     1887      +189     
  Lines        129852   139539     +9687     
  Branches      14161    15337     +1176     
=============================================
+ Hits          47843   102067    +54224     
+ Misses        75680    29406    -46274     
- Partials       6329     8066     +1737     
Flag Coverage Δ
inttests 24.10% <ø> (-0.03%) ⬇️
systests 25.11% <ø> (+0.01%) ⬆️
unittests 72.43% <92.70%> (+40.37%) ⬆️

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

Files with missing lines Coverage Δ
...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%> (ø)
...pulsar/cli/validators/MinNegativeOneValidator.java 100.00% <100.00%> (ø)
...lsar/cli/validators/NonNegativeValueValidator.java 100.00% <100.00%> (ø)
.../cli/validators/PositiveIntegerValueValidator.java 100.00% <100.00%> (ø)
...sar/cli/validators/PositiveLongValueValidator.java 100.00% <100.00%> (ø)
...ava/org/apache/pulsar/cli/ValueValidationUtil.java 93.75% <93.75%> (ø)
...org/apache/pulsar/cli/converters/ByteUnitUtil.java 94.73% <94.73%> (ø)
...apache/pulsar/cli/converters/RelativeTimeUtil.java 95.23% <95.23%> (ø)
... and 2 more

... and 1438 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JooHyukKim
Copy link
Copy Markdown
Contributor Author

/pulsarbot rerun-failure-checks

@JooHyukKim
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

JooHyukKim commented Jul 13, 2023

Need #20792 to resolve the OWASP blocker

@JooHyukKim
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

/pulsarbot rerun-failure-checks

@JooHyukKim
Copy link
Copy Markdown
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
Copy Markdown
Member

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

Comment thread pulsar-cli-utils/pom.xml Outdated
@Technoboy- Technoboy- added this to the 3.2.0 milestone Jul 31, 2023
Copy link
Copy Markdown
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

Co-authored-by: ran <gaoran_10@126.com>
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

/pulsarbot rerun-failure-checks

1 similar comment
@JooHyukKim
Copy link
Copy Markdown
Contributor Author

/pulsarbot rerun-failure-checks

Copy link
Copy Markdown
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
@tisonkun
Copy link
Copy Markdown
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
Copy Markdown
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
…20782)

Co-authored-by: ran <gaoran_10@126.com>
(cherry picked from commit 4f9b199)
thetumbled pushed a commit to thetumbled/pulsar that referenced this pull request Feb 28, 2024
…20782)

Co-authored-by: ran <gaoran_10@126.com>
(cherry picked from commit 4f9b199)
thetumbled pushed a commit to thetumbled/pulsar that referenced this pull request Feb 28, 2024
…20782)

Co-authored-by: ran <gaoran_10@126.com>
(cherry picked from commit 4f9b199)
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