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

feat(pubsub): introduce PublisherOptionList (g::c::Options) #7308

Merged
merged 5 commits into from
Sep 14, 2021

Conversation

dbolduc
Copy link
Member

@dbolduc dbolduc commented Sep 13, 2021

(Continuation of #7273) I think I was supposed to reopen the closed PR then push to it, instead of force-pushing when it was closed.


This change is Reviewable

@dbolduc dbolduc requested a review from a team as a code owner September 13, 2021 16:41
@product-auto-label product-auto-label bot added the api: pubsub Issues related to the Pub/Sub API. label Sep 13, 2021
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Sep 13, 2021
@dbolduc dbolduc requested a review from coryan September 13, 2021 16:41
@google-cloud-cpp-bot
Copy link
Collaborator

Google Cloud Build Logs
For commit: cafc2f52f9d907b600089d75cac3a74c6e7ba28f

ℹ️ NOTE: Kokoro logs are linked from "Details" below.

@codecov
Copy link

codecov bot commented Sep 13, 2021

Codecov Report

Merging #7308 (71ec7ee) into main (1920c0f) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #7308      +/-   ##
==========================================
+ Coverage   93.67%   93.69%   +0.02%     
==========================================
  Files        1344     1347       +3     
  Lines      116443   116537      +94     
==========================================
+ Hits       109074   109189     +115     
+ Misses       7369     7348      -21     
Impacted Files Coverage Δ
google/cloud/pubsub/publisher.h 100.00% <ø> (ø)
google/cloud/pubsub/internal/defaults.cc 100.00% <100.00%> (ø)
google/cloud/pubsub/internal/defaults_test.cc 100.00% <100.00%> (ø)
...ernal/flow_controlled_publisher_connection_test.cc 100.00% <100.00%> (+1.51%) ⬆️
google/cloud/pubsub/publisher.cc 100.00% <100.00%> (ø)
google/cloud/pubsub/publisher_options.cc 100.00% <100.00%> (ø)
google/cloud/pubsub/publisher_options.h 100.00% <100.00%> (ø)
google/cloud/pubsub/publisher_options_test.cc 100.00% <100.00%> (+2.22%) ⬆️
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1920c0f...71ec7ee. Read the comment docs.

Copy link
Member Author

@dbolduc dbolduc left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 12 files reviewed, 6 unresolved discussions (waiting on @coryan and @devbww)


google/cloud/pubsub/options.h, line 44 at r1 (raw file):

Previously, devbww (Bradley White) wrote…

Unused?

Done.


google/cloud/pubsub/options.h, line 54 at r1 (raw file):

Previously, devbww (Bradley White) wrote…

Nit: Some notes have initial caps, and some don't.

Fixed in this PR. And: #7310


google/cloud/pubsub/publisher.cc, line 24 at r1 (raw file):

Previously, devbww (Bradley White) wrote…

I assume that at some point in the future these will be moved somewhere?

I am not sure I follow what you are asking.

I assume that there is currently a PublisherOptions param for backwards compatibility, which is now ignored because the PublisherOptions have already been used to configure the PublisherConnection.

I think at some point in the future PublisherOptions will be deprecated, and we will just make a new constructor that only accepts a std::shared_ptr<PublisherConnection> connection.

did that answer your question?


google/cloud/pubsub/publisher_options.h, line 269 at r1 (raw file):

Previously, devbww (Bradley White) wrote…

Is return by rref needed, or even good?

It is definitely not needed. Based on the types of the options, I don't think it adds anything. Fixed.


google/cloud/pubsub/internal/defaults.h, line 26 at r1 (raw file):

Previously, devbww (Bradley White) wrote…

If the only place you envisage defaulting the argument is in the test, then I'd remove the default.

Fixed.


google/cloud/pubsub/internal/defaults.cc, line 37 at r1 (raw file):

Previously, devbww (Bradley White) wrote…

#include <limits>

Done.

@google-cloud-cpp-bot
Copy link
Collaborator

Google Cloud Build Logs
For commit: 688e298a7965f177f79aead7582e7c72ff27ce6c

ℹ️ NOTE: Kokoro logs are linked from "Details" below.

Copy link
Contributor

@devbww devbww left a comment

Choose a reason for hiding this comment

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

Reviewed 6 of 12 files at r1, 6 of 6 files at r2, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @coryan and @dbolduc)


google/cloud/pubsub/publisher.cc, line 24 at r1 (raw file):

Previously, dbolduc (Darren Bolduc) wrote…

I am not sure I follow what you are asking.

I assume that there is currently a PublisherOptions param for backwards compatibility, which is now ignored because the PublisherOptions have already been used to configure the PublisherConnection.

I think at some point in the future PublisherOptions will be deprecated, and we will just make a new constructor that only accepts a std::shared_ptr<PublisherConnection> connection.

did that answer your question?

If the parameter is unused, can we just make it a const& and avoid a copy and a NOLINT?


google/cloud/pubsub/publisher_options_test.cc, line 113 at r2 (raw file):

               .enable_message_ordering();

  auto opts = pubsub_internal::MakeOptions(b);

It seems like it is still a benefit to move these PublisherOptions into the argument if the local variable is otherwise dead.

@google-cloud-cpp-bot
Copy link
Collaborator

Google Cloud Build Logs
For commit: 71ec7eea4f3e708ed617ec63cda58bf19f137397

ℹ️ NOTE: Kokoro logs are linked from "Details" below.

Copy link
Member Author

@dbolduc dbolduc left a comment

Choose a reason for hiding this comment

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

Reviewable status: 10 of 13 files reviewed, 2 unresolved discussions (waiting on @coryan and @devbww)


google/cloud/pubsub/publisher.cc, line 24 at r1 (raw file):

Previously, devbww (Bradley White) wrote…

If the parameter is unused, can we just make it a const& and avoid a copy and a NOLINT?

Done.


google/cloud/pubsub/publisher_options_test.cc, line 113 at r2 (raw file):

Previously, devbww (Bradley White) wrote…

It seems like it is still a benefit to move these PublisherOptions into the argument if the local variable is otherwise dead.

Done.

Copy link
Contributor

@devbww devbww left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 3 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @coryan)

@dbolduc dbolduc removed the request for review from coryan September 14, 2021 16:22
@dbolduc dbolduc merged commit 480cd16 into googleapis:main Sep 14, 2021
@dbolduc dbolduc deleted the pubsub-publisher-options-as-options branch September 14, 2021 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsub Issues related to the Pub/Sub API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants