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

[fix][client] Prevent embedding protobuf-java class files in pulsar-client-admin and pulsar-client-all #23468

Merged
merged 2 commits into from
Oct 17, 2024

Conversation

Shawyeok
Copy link
Contributor

@Shawyeok Shawyeok commented Oct 16, 2024

Fixes #22263

Motivation

Since version 3.0.0, com.google.protobuf:protobuf-java has been directly included in pulsar-client-admin or pulsar-client-all without relocation (i.e., the classes remain in their original package). This is considered bad practice as it may cause conflicts with the user’s application’s version of protobuf-java. For example, I encountered this issue in a program that consumes Pulsar messages and writes to a Parquet file using the protobuf schema.

By not shading protobuf-java, users can select their desired version of protobuf-java.

More details explained in #22263 (comment)

Modifications

Prevent shade protobuf-java, move it into transitive dependencies, keep consistency with pulsar-client.

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: Shawyeok#14

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Oct 16, 2024
@lhotari lhotari added this to the 4.1.0 milestone Oct 16, 2024
@Shawyeok Shawyeok changed the title [improve][client] Prevent shade protobuf-java in pulsar-client-admin [improve][client] Prevent shade protobuf-java in pulsar-client-admin and pulsar-client-all Oct 16, 2024
Copy link
Member

@lhotari lhotari left a comment

Choose a reason for hiding this comment

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

LGTM

@lhotari lhotari changed the title [improve][client] Prevent shade protobuf-java in pulsar-client-admin and pulsar-client-all [improve][client] Prevent including protobuf-java class files in pulsar-client-admin and pulsar-client-all Oct 16, 2024
@lhotari lhotari changed the title [improve][client] Prevent including protobuf-java class files in pulsar-client-admin and pulsar-client-all [improve][client] Prevent embedding protobuf-java class files in pulsar-client-admin and pulsar-client-all Oct 16, 2024
@lhotari lhotari changed the title [improve][client] Prevent embedding protobuf-java class files in pulsar-client-admin and pulsar-client-all [fix][client] Prevent embedding protobuf-java class files in pulsar-client-admin and pulsar-client-all Oct 16, 2024
@lhotari lhotari added the type/bug The PR fixed a bug or issue reported a bug label Oct 16, 2024
@lhotari lhotari closed this Oct 17, 2024
@lhotari lhotari reopened this Oct 17, 2024
@codecov-commenter
Copy link

codecov-commenter commented Oct 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.47%. Comparing base (bbc6224) to head (0bf5862).
Report is 686 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #23468      +/-   ##
============================================
- Coverage     73.57%   73.47%   -0.11%     
+ Complexity    32624     2642   -29982     
============================================
  Files          1877     1943      +66     
  Lines        139502   146973    +7471     
  Branches      15299    16191     +892     
============================================
+ Hits         102638   107985    +5347     
- Misses        28908    30539    +1631     
- Partials       7956     8449     +493     
Flag Coverage Δ
inttests 27.75% <ø> (+3.16%) ⬆️
systests 24.47% <ø> (+0.14%) ⬆️
unittests 72.77% <ø> (-0.07%) ⬇️

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

see 678 files with indirect coverage changes

@lhotari lhotari merged commit 63c6a25 into apache:master Oct 17, 2024
107 of 115 checks passed
lhotari pushed a commit that referenced this pull request Oct 21, 2024
…lient-admin and pulsar-client-all (#23468)

(cherry picked from commit 63c6a25)
lhotari pushed a commit that referenced this pull request Oct 21, 2024
…lient-admin and pulsar-client-all (#23468)

(cherry picked from commit 63c6a25)
lhotari pushed a commit that referenced this pull request Oct 22, 2024
…lient-admin and pulsar-client-all (#23468)

(cherry picked from commit 63c6a25)
nikhil-ctds pushed a commit to datastax/pulsar that referenced this pull request Oct 28, 2024
…lient-admin and pulsar-client-all (apache#23468)

(cherry picked from commit 63c6a25)
(cherry picked from commit 521b7b4)
nikhil-ctds pushed a commit to datastax/pulsar that referenced this pull request Nov 6, 2024
…lient-admin and pulsar-client-all (apache#23468)

(cherry picked from commit 63c6a25)
(cherry picked from commit 521b7b4)
nikhil-ctds pushed a commit to datastax/pulsar that referenced this pull request Nov 6, 2024
…lient-admin and pulsar-client-all (apache#23468)

(cherry picked from commit 63c6a25)
(cherry picked from commit 521b7b4)
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Nov 6, 2024
…lient-admin and pulsar-client-all (apache#23468)

(cherry picked from commit 63c6a25)
(cherry picked from commit 521b7b4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Version conflicts with the protobuf inside the pulsar client
4 participants