Skip to content

[improve][cli] Add --cleanupSubscription to pulsar-admin - #20028

Merged
tisonkun merged 3 commits into
apache:masterfrom
jiangpengcheng:add_cleanup_subscription
Apr 23, 2023
Merged

tisonkun merged 3 commits into
apache:masterfrom
jiangpengcheng:add_cleanup_subscription

Conversation

@jiangpengcheng

Copy link
Copy Markdown
Contributor

Fixes #20027

Master Issue: #xyz

PIP: #xyz

Motivation

pulsar-admin can't set cleanupSubscription for functions/sinks

Modifications

add a --cleanupSubscription parameter

Verifying this change

  • Make sure that the change passes the CI checks.

(Please pick either of the following options)

  • This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end deployment with large payloads (10MB)
  • Extended integration test for recovery after broker failure

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: jiangpengcheng#11

@github-actions github-actions Bot added the doc-required Your PR changes impact docs and you will update later. label Apr 6, 2023
@jiangpengcheng
jiangpengcheng force-pushed the add_cleanup_subscription branch from fa8c600 to 3f1e386 Compare April 11, 2023 07:16
sourceSpecBuilder.setNegativeAckRedeliveryDelayMs(sinkConfig.getNegativeAckRedeliveryDelayMs());
}

if (sinkConfig.getCleanupSubscription() != null) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Removals on this file seems breaking change?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's duplicated in lines 196~200

other deletions in this file also because of duplicate code

@tisonkun tisonkun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for your explanation! Running tests...

@codecov-commenter

codecov-commenter commented Apr 23, 2023 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.90%. Comparing base (6036dcc) to head (e35f427).
⚠️ Report is 2587 commits behind head on master.

Files with missing lines Patch % Lines
...java/org/apache/pulsar/admin/cli/CmdFunctions.java 0.00% 2 Missing and 1 partial ⚠️
...ain/java/org/apache/pulsar/admin/cli/CmdSinks.java 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #20028      +/-   ##
============================================
- Coverage     72.93%   72.90%   -0.03%     
- Complexity    31934    31943       +9     
============================================
  Files          1868     1868              
  Lines        138449   138457       +8     
  Branches      15235    15235              
============================================
- Hits         100978   100946      -32     
- Misses        29438    29475      +37     
- Partials       8033     8036       +3     
Flag Coverage Δ
inttests 24.20% <0.00%> (+0.09%) ⬆️
systests 24.75% <0.00%> (-0.18%) ⬇️
unittests 72.21% <0.00%> (-0.01%) ⬇️

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

Files with missing lines Coverage Δ
...apache/pulsar/functions/utils/SinkConfigUtils.java 72.74% <ø> (-0.39%) ⬇️
...ain/java/org/apache/pulsar/admin/cli/CmdSinks.java 43.18% <0.00%> (-0.29%) ⬇️
...java/org/apache/pulsar/admin/cli/CmdFunctions.java 46.71% <0.00%> (-0.25%) ⬇️

... and 60 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.

@tisonkun

Copy link
Copy Markdown
Member

Merging...

Thank you @jiangpengcheng!

@tisonkun
tisonkun merged commit 795d60a into apache:master Apr 23, 2023
@tisonkun

Copy link
Copy Markdown
Member

cc @nlu90 @cbornet for peer reviewing - although this patch changes CLI options, I think it reflects a former decision on adding the option in configs so that we can merge it as is.

@Anonymitaet

Copy link
Copy Markdown
Member

Hi @jiangpengcheng thanks for introducing this great improvement!

We're trying to align docs with code for each release and I have some questions as below. Can you please help answer? TIA!

  1. Which version does this improvement go in? Pulsar 3.0 or 3.1?

  2. Double-check: is this improvement only added to pulsar-admin (not to REST API and Java admin API)?

@poorbarcode poorbarcode added this to the 3.1.0 milestone May 7, 2023
@poorbarcode

Copy link
Copy Markdown
Contributor

@jiangpengcheng @Anonymitaet

If it should be cherry-picked into branch-3.0, please ping me

@Anonymitaet

Copy link
Copy Markdown
Member

Hi @jiangpengcheng thanks for introducing this great improvement!

We're trying to align docs with code for each release and I have some questions as below. Can you please help answer? TIA!

  1. Which version does this improvement go in? Pulsar 3.0 or 3.1?
  2. Double-check: is this improvement only added to pulsar-admin (not to REST API and Java admin API)?

ping @jiangpengcheng, can you answer the questions?

@Anonymitaet

Copy link
Copy Markdown
Member

@jiangpengcheng for the doc side, the flag has been shown on the Reference site, but language support info is missing.

Can you add that? Thanks!

image

@Anonymitaet

Copy link
Copy Markdown
Member

For the doc side, we need to add it to:

@jiangpengcheng

Copy link
Copy Markdown
Contributor Author

@Anonymitaet added here: #20836

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-required Your PR changes impact docs and you will update later.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add cleanupSubscription to CmdFunction and CmdSink

5 participants