Skip to content

[fix][client] Fix update response body text - #18794

Merged
tuteng merged 2 commits into
apache:masterfrom
AmateurEvents:fixed/update-response-body-text
Dec 15, 2022
Merged

[fix][client] Fix update response body text#18794
tuteng merged 2 commits into
apache:masterfrom
AmateurEvents:fixed/update-response-body-text

Conversation

@tuteng

@tuteng tuteng commented Dec 7, 2022

Copy link
Copy Markdown
Member

Fixes #xyz

Master Issue: #xyz

Motivation

When using pulsar-admin and encountering an exception, first check the body, then check the http text

Modifications

  • Update http response body check

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
  • Anything that affects deployment

Documentation

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

Matching PR in forked repository

PR in forked repository: AmateurEvents#31

@github-actions

github-actions Bot commented Dec 7, 2022

Copy link
Copy Markdown

@tuteng Please add the following content to your PR description and select a checkbox:

- [ ] `doc` <!-- Your PR contains doc changes -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
- [ ] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->

@github-actions github-actions Bot added doc-label-missing doc-not-needed Your PR changes do not impact docs and removed doc-label-missing labels Dec 7, 2022
@tuteng
tuteng requested review from Demogorgon314, Technoboy- and mattisonchao and removed request for Demogorgon314 December 7, 2022 07:06
@tuteng tuteng self-assigned this Dec 7, 2022
@tuteng tuteng added type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages area/client area/cli component/client-java labels Dec 7, 2022
@tuteng tuteng changed the title [Bug][pulsar-client]Fixed update response body text [Improve][pulsar-client]Fixed update response body text Dec 7, 2022
@tuteng tuteng changed the title [Improve][pulsar-client]Fixed update response body text [improve][pulsar-client]Fixed update response body text Dec 7, 2022
@tuteng tuteng changed the title [improve][pulsar-client]Fixed update response body text [fixed][client]Fixed update response body text Dec 12, 2022
@tuteng tuteng changed the title [fixed][client]Fixed update response body text [fix][client]Fixed update response body text Dec 12, 2022
@Technoboy- Technoboy- changed the title [fix][client]Fixed update response body text [fix][client] Fix update response body text Dec 12, 2022
@Technoboy- Technoboy- closed this Dec 12, 2022
@Technoboy- Technoboy- reopened this Dec 12, 2022
@Technoboy- Technoboy- closed this Dec 12, 2022
@Technoboy- Technoboy- reopened this Dec 12, 2022

@mattisonchao mattisonchao 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.

LGTM, We need to see if we break unit test.

@codecov-commenter

codecov-commenter commented Dec 12, 2022

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 37.78%. Comparing base (99e26f5) to head (63e4b48).
⚠️ Report is 3201 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #18794      +/-   ##
============================================
- Coverage     44.79%   37.78%   -7.02%     
+ Complexity    10026     8041    -1985     
============================================
  Files           703      703              
  Lines         68808    68851      +43     
  Branches       7375     7382       +7     
============================================
- Hits          30822    26014    -4808     
- Misses        34378    39428    +5050     
+ Partials       3608     3409     -199     
Flag Coverage Δ
unittests 37.78% <ø> (-7.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 178 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.

@Jason918

Copy link
Copy Markdown
Contributor

When using pulsar-admin and encountering an exception, first check the body, then check the http text

Can you give an actual case this PR is solving?

@tuteng

tuteng commented Dec 15, 2022

Copy link
Copy Markdown
Member Author

When using pulsar-admin and encountering an exception, first check the body, then check the http text

Can you give an actual case this PR is solving?

https://github.com/apache/pulsar/blob/master/pulsar-broker/src/main/java/org/apache/pulsar/broker/web/ExceptionHandler.java#L46

This needs an interceptor and then throws an exception with a custom message, using pulsar-admin to execute the corresponding command, which never gets the custom message @Jason918

@tuteng
tuteng merged commit 1107af2 into apache:master Dec 15, 2022
@mattisonchao

Copy link
Copy Markdown
Member

Oops. Could you help to take a look? I am not sure if it is a sensitive breaking change for users.

@codelipenghui @eolivelli @Technoboy- @Jason918

lifepuzzlefun pushed a commit to lifepuzzlefun/pulsar that referenced this pull request Jan 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/cli area/client doc-not-needed Your PR changes do not impact docs ready-to-test type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants