feat(GCS+gRPC): implement standard parameters#7272
Conversation
|
Google Cloud Build Logs
ℹ️ NOTE: Kokoro logs are linked from "Details" below. |
Codecov Report
@@ Coverage Diff @@
## main #7272 +/- ##
==========================================
- Coverage 93.79% 93.79% -0.01%
==========================================
Files 1339 1341 +2
Lines 115461 115550 +89
==========================================
+ Hits 108294 108376 +82
- Misses 7167 7174 +7
Continue to review full report at Codecov.
|
|
/FYI: @tritone @noahdietz I am not sure if you implemented the |
dbolduc
left a comment
There was a problem hiding this comment.
No blockers, but I have some questions
Reviewed 9 of 9 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @coryan)
google/cloud/storage/internal/grpc_client.cc, line 270 at r1 (raw file):
// extra prefix to ApplyQueryParameters sends the right filtering instructions // to the gRPC API. ApplyQueryParameters(*context, request, "resource");
I guess I don't understand why this is the only call that has the "resource" prefix.
e.g. the proto for QueryWriteStatusResponse has an Object resource.
google/cloud/storage/internal/grpc_configure_client_context.h, line 39 at r1 (raw file):
template <typename Request> void ApplyQueryParameters(grpc::ClientContext& context, Request const& request, std::string const& prefix = std::string{}) {
is the prefix ever anything other than "" or "resource"? Not saying we should, but it could be something like bool use_resource = false
google/cloud/storage/internal/grpc_configure_client_context.h, line 57 at r1 (raw file):
if (request.template HasOption<Fields>()) { auto field_mask = request.template GetOption<Fields>().value(); if (!prefix.empty()) field_mask = prefix + "(" + field_mask + ")";
This looks nicer, but absl::StrCat() is possible.
google/cloud/storage/internal/grpc_configure_client_context_test.cc, line 1 at r1 (raw file):
// Copyright 2019 Google LLC
2021
The REST API has a small number of "standard" query parameters which are not part of the gRPC requests. They are implemented using special `x-goog-*` "metadata" via the `grpc::ClientContext`. These are documented at: https://cloud.google.com/apis/docs/system-parameters With this change the GCS+gRPC plugin fills out those headers from the `*Request` object.
1b08227 to
6c19f4d
Compare
|
Google Cloud Build Logs
ℹ️ NOTE: Kokoro logs are linked from "Details" below. |
coryan
left a comment
There was a problem hiding this comment.
PTAL.
Reviewable status: 5 of 10 files reviewed, all discussions resolved (waiting on @dbolduc)
google/cloud/storage/internal/grpc_client.cc, line 270 at r1 (raw file):
Previously, dbolduc (Darren Bolduc) wrote…
I guess I don't understand why this is the only call that has the "resource" prefix.
e.g. the proto for
QueryWriteStatusResponsehas anObject resource.
Good question, fixed here and elsewhere. Actually I had to create a few additional PRs to fix this for REST too.
google/cloud/storage/internal/grpc_configure_client_context.h, line 39 at r1 (raw file):
Previously, dbolduc (Darren Bolduc) wrote…
is the prefix ever anything other than "" or "resource"? Not saying we should, but it could be something like
bool use_resource = false
For now that is it, but I expect that might change as we implement more APIs over gRPC.
google/cloud/storage/internal/grpc_configure_client_context.h, line 57 at r1 (raw file):
Previously, dbolduc (Darren Bolduc) wrote…
This looks nicer, but
absl::StrCat()is possible.
I am leaving as-is, it is readable enough for me.
google/cloud/storage/internal/grpc_configure_client_context_test.cc, line 1 at r1 (raw file):
Previously, dbolduc (Darren Bolduc) wrote…
2021
Fixed.
|
Google Cloud Build Logs
ℹ️ NOTE: Kokoro logs are linked from "Details" below. |
|
Google Cloud Build Logs
ℹ️ NOTE: Kokoro logs are linked from "Details" below. |
The REST API has a small number of "standard" query parameters which are
not part of the gRPC requests. They are implemented using special
x-goog-*"metadata" via thegrpc::ClientContext. These aredocumented at:
https://cloud.google.com/apis/docs/system-parameters
With this change the GCS+gRPC plugin fills out those headers from the
*Requestobject.Fixes #4215 and fixes #6982
This change is