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(mixin): add manual changes for pubsub and generate mixin code #14756

Merged
merged 9 commits into from
Oct 3, 2024

Conversation

cuiy0006
Copy link
Collaborator

@cuiy0006 cuiy0006 commented Oct 2, 2024

This change is Reviewable

Copy link

codecov bot commented Oct 2, 2024

Codecov Report

Attention: Patch coverage is 6.68693% with 307 lines in your changes missing coverage. Please review.

Project coverage is 93.25%. Comparing base (a695357) to head (5a25f06).

Files with missing lines Patch % Lines
...min/internal/subscription_admin_connection_impl.cc 0.00% 27 Missing ⚠️
...bsub/admin/internal/topic_admin_connection_impl.cc 0.00% 27 Missing ⚠️
...d/pubsub/admin/internal/subscription_admin_stub.cc 0.00% 21 Missing ⚠️
.../admin/internal/subscription_admin_tracing_stub.cc 0.00% 21 Missing ⚠️
...le/cloud/pubsub/admin/internal/topic_admin_stub.cc 0.00% 21 Missing ⚠️
.../pubsub/admin/internal/topic_admin_tracing_stub.cc 0.00% 21 Missing ⚠️
.../internal/subscription_admin_tracing_connection.cc 0.00% 18 Missing ⚠️
...b/admin/internal/topic_admin_tracing_connection.cc 0.00% 16 Missing ⚠️
...dmin/internal/subscription_admin_auth_decorator.cc 0.00% 15 Missing ⚠️
...ubsub/admin/internal/topic_admin_auth_decorator.cc 0.00% 15 Missing ⚠️
... and 13 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #14756      +/-   ##
==========================================
- Coverage   93.39%   93.25%   -0.14%     
==========================================
  Files        2316     2316              
  Lines      207867   208185     +318     
==========================================
+ Hits       194139   194152      +13     
- Misses      13728    14033     +305     

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

@cuiy0006 cuiy0006 marked this pull request as ready for review October 3, 2024 15:58
@cuiy0006 cuiy0006 requested a review from a team as a code owner October 3, 2024 15:58
Copy link
Member

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

This all looks good. What is the testing plan though?

Unit testing

I think we want golden unit tests, at least in the stub that verifies that the mixin StubInterface is used, not the service's.

It looks like there is a way to define our own *.yaml for the golden files.

override_service_config_yaml_name: "generator/integration_tests/test_request_id.yaml"

Then we would add a unit test here:

https://github.com/googleapis/google-cloud-cpp/tree/main/generator/integration_tests/tests

Integration Testing

I think we also need an integration test that proves that these APIs work against production. We typically use spanner's admin APIs for integration testing the generator.

It looks like we can eventually have something for the LRO mixin.

https://github.com/googleapis/googleapis/blob/78d1fb208e4af3022a0aaf27bafa578ff326326e/google/spanner/admin/database/v1/spanner.yaml#L7


Also, this API is now obsolete:

/**
* Convenience function to initialize a
* `google::cloud::iam::IAMPolicyConnection`.
*
* To manage the IAM policies of Pub/Sub resources you need to configure the
* `google::cloud::IAMPolicyClient` to use `pubsub.googleapis.com` as the
* `google::cloud::EndpointOption` and `google::cloud::AuthorityOption`.
*
* This function returns an object that is initialized with these values, you
* can provide additional configuration, or override some of the values before
* passing the object to `google::cloud::iam::MakeIAMPolicyConnection`.
*
* @ingroup google-cloud-pubsub-options
*/
Options IAMPolicyOptions(Options opts = {});

We should deprecate it, and recommend that applications use the new mixed-in APIs. Can you open an issue?

generator/internal/make_generators.cc Show resolved Hide resolved
google/cloud/pubsub/BUILD.bazel Outdated Show resolved Hide resolved
google/cloud/pubsub/samples/samples.cc Show resolved Hide resolved
@cuiy0006
Copy link
Collaborator Author

cuiy0006 commented Oct 3, 2024

I created an issue for adding tests for mixin.

#14762

@cuiy0006 cuiy0006 merged commit 5acae1d into googleapis:main Oct 3, 2024
74 checks passed
@cuiy0006 cuiy0006 deleted the mixin-pubsub branch October 3, 2024 19:39
@cuiy0006 cuiy0006 linked an issue Oct 4, 2024 that may be closed by this pull request
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.

Support google.cloud.location.Locations and maybe other mixins
2 participants