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): implement GUAC for SchemaAdmin #7436

Merged

Conversation

coryan
Copy link
Contributor

@coryan coryan commented Oct 11, 2021

Part of the work for #6463


This change is Reviewable

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Oct 11, 2021
@product-auto-label product-auto-label bot added the api: pubsub Issues related to the Pub/Sub API. label Oct 11, 2021
@google-cloud-cpp-bot
Copy link
Collaborator

Google Cloud Build Logs
For commit: d6ad1b63ad0a927b778e435c02a00010857da45f

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

@codecov
Copy link

codecov bot commented Oct 11, 2021

Codecov Report

Merging #7436 (d6ad1b6) into main (1e29dce) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #7436      +/-   ##
==========================================
+ Coverage   93.63%   93.64%   +0.01%     
==========================================
  Files        1359     1362       +3     
  Lines      118082   118232     +150     
==========================================
+ Hits       110568   110721     +153     
+ Misses       7514     7511       -3     
Impacted Files Coverage Δ
google/cloud/pubsub/internal/schema_stub.h 100.00% <ø> (ø)
...integration_tests/schema_admin_integration_test.cc 100.00% <100.00%> (ø)
google/cloud/pubsub/internal/schema_auth.cc 100.00% <100.00%> (ø)
google/cloud/pubsub/internal/schema_auth.h 100.00% <100.00%> (ø)
google/cloud/pubsub/internal/schema_auth_test.cc 100.00% <100.00%> (ø)
google/cloud/pubsub/internal/schema_stub.cc 100.00% <100.00%> (ø)
google/cloud/pubsub/schema_admin_connection.cc 91.91% <100.00%> (+1.79%) ⬆️
google/cloud/pubsub/subscriber_connection_test.cc 97.18% <0.00%> (-0.71%) ⬇️
...le/cloud/storage/internal/curl_download_request.cc 89.62% <0.00%> (+0.37%) ⬆️
... and 2 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 1e29dce...d6ad1b6. Read the comment docs.

@coryan coryan marked this pull request as ready for review October 11, 2021 15:40
@coryan coryan requested a review from a team as a code owner October 11, 2021 15:40

} // namespace

std::shared_ptr<pubsub::SchemaAdminConnection> MakeSchemaAdminConnection(
Copy link
Member

@dbolduc dbolduc Oct 11, 2021

Choose a reason for hiding this comment

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

(Sorry this comment comes a little late (it applies to previous PR's). Also, feel free to ignore it. I'm just throwing an idea out there.)

There is something weird about this method, which is only used for testing. It is used in conjunction with:

std::shared_ptr<SchemaAdminConnection> MakeTestSchemaAdminConnection(
std::shared_ptr<pubsub_internal::SchemaStub> mock, Options opts = {}) {
opts = pubsub_internal::DefaultCommonOptions(
pubsub_testing::MakeTestOptions(std::move(opts)));
return pubsub_internal::MakeSchemaAdminConnection(std::move(opts),
std::move(mock));
}

We need it in order to make the SchemaAdminConnectionImpl, which is defined in an anonymous namespace. Part of me wants to combine the two functions, but we probably stay more flexible by leaving them separate.

I did get confused just now about where I was in the code. We could name it something like MakeTestSchemaAdminConnection and s/stub/mock/. Or potentially add a comment that says it is only used for testing, and that is why we use the insecure credentials.

Also, I am wondering if we should even be setting the unified credentials here. I actually think it makes more sense to set them in schema_admin_connection_test.cc. The thing that is testing decides that we are using test credentials. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See #7438, let's continue the discussion there.

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.

I am approving. If we think there is value in changing the test-only Make*Connection methods, we can do so in a future PR that updates them all at once.

@coryan coryan merged commit e38b7c1 into googleapis:main Oct 11, 2021
@coryan coryan deleted the feat-pubsub-implement-guac-for-schema-admin branch October 11, 2021 18:59
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.

4 participants