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

impl(generator): add Start and Await overloads to clients #14370

Merged
merged 6 commits into from
Jun 26, 2024

Conversation

scotthart
Copy link
Member

@scotthart scotthart commented Jun 25, 2024

part of the work for #7658

Adds the "Start" and "Await" overloads for each method_signature defined for the rpc to the Client class.

PR is split into multiple commits to separate changes, tests, and generated code.


This change is Reviewable

// clang-format off
" Status\n",
" StatusOr<$longrunning_operation_type$>\n"},
{" $method_name$(google::cloud::ExperimentalTag, "
Copy link
Member

Choose a reason for hiding this comment

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

same nit about: google::cloud::

@@ -20,6 +20,7 @@
#define GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_V1_GOLDEN_KITCHEN_SINK_CLIENT_H

#include "generator/integration_tests/golden/v1/golden_kitchen_sink_connection.h"
#include "google/cloud/experimental_tag.h"
Copy link
Member

Choose a reason for hiding this comment

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

unused?

@@ -20,6 +20,7 @@
#define GOOGLE_CLOUD_CPP_GENERATOR_INTEGRATION_TESTS_GOLDEN_V1_GOLDEN_REST_ONLY_CLIENT_H

#include "generator/integration_tests/golden/v1/golden_rest_only_rest_connection.h"
#include "google/cloud/experimental_tag.h"
Copy link
Member

Choose a reason for hiding this comment

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

unused?

@@ -57,12 +57,33 @@ GoldenThingAdminClient::CreateDatabase(std::string const& parent, std::string co
return connection_->CreateDatabase(request);
}

StatusOr<google::longrunning::Operation>
GoldenThingAdminClient::CreateDatabase(ExperimentalTag, NoAwaitTag, std::string const& parent, std::string const& create_statement, Options opts) {
Copy link
Member

Choose a reason for hiding this comment

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

silly nit: should we name these tags and std::move them into the connection call?

@@ -405,6 +419,12 @@ class GoldenThingAdminClient {
future<StatusOr<google::test::admin::database::v1::UpdateDatabaseDdlMetadata>>
UpdateDatabaseDdl(google::test::admin::database::v1::UpdateDatabaseDdlRequest const& request, Options opts = {});

StatusOr<google::longrunning::Operation>
Copy link
Member

Choose a reason for hiding this comment

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

We need to document the client methods.

And the documentation should probably mention that the NoAwaitTag overload is for advanced use cases.

Copy link

codecov bot commented Jun 25, 2024

Codecov Report

Attention: Patch coverage is 61.40351% with 66 lines in your changes missing coverage. Please review.

Project coverage is 93.55%. Comparing base (c91821e) to head (d89fc52).
Report is 2 commits behind head on main.

Current head d89fc52 differs from pull request most recent head eefae17

Please upload reports for the commit eefae17 to get more accurate results.

Files Patch % Lines
...ation_tests/golden/v1/golden_thing_admin_client.cc 20.96% 49 Missing ⚠️
...r/integration_tests/golden/v1/request_id_client.cc 0.00% 13 Missing ⚠️
generator/internal/client_generator.cc 20.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #14370      +/-   ##
==========================================
+ Coverage   93.09%   93.55%   +0.46%     
==========================================
  Files        2191     2280      +89     
  Lines      193032   204164   +11132     
==========================================
+ Hits       179707   191012   +11305     
+ Misses      13325    13152     -173     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member Author

@scotthart scotthart 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 705 files reviewed, 5 unresolved discussions (waiting on @dbolduc)

a discussion (no related file):

Previously, dbolduc (Darren Bolduc) wrote…

(Reviewable was unable to map this GitHub inline comment thread to the right spot — sorry!)

same nit about: google::cloud::

Thought I fixed that, must have lost it in a merge/rebase.


a discussion (no related file):

Previously, dbolduc (Darren Bolduc) wrote…

(Reviewable was unable to map this GitHub inline comment thread to the right spot — sorry!)

unused?

Done.


a discussion (no related file):

Previously, dbolduc (Darren Bolduc) wrote…

(Reviewable was unable to map this GitHub inline comment thread to the right spot — sorry!)

unused?

Done.


a discussion (no related file):

Previously, dbolduc (Darren Bolduc) wrote…

(Reviewable was unable to map this GitHub inline comment thread to the right spot — sorry!)

silly nit: should we name these tags and std::move them into the connection call?

Possibly, it will require changes to the connection generation as well. If we decide we want this, I'll do it in a separate PR.


a discussion (no related file):

Previously, dbolduc (Darren Bolduc) wrote…

(Reviewable was unable to map this GitHub inline comment thread to the right spot — sorry!)

We need to document the client methods.

And the documentation should probably mention that the NoAwaitTag overload is for advanced use cases.

The documentation PR is next. I need to document the client functions, add the EXPECT_CALL comments on the preexisting connection functions, as well as the blurb in the CHANGELOG detailing the change in testing behavior.


@scotthart scotthart enabled auto-merge (squash) June 26, 2024 15:57
@scotthart scotthart merged commit 42336db into googleapis:main Jun 26, 2024
66 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants