-
Notifications
You must be signed in to change notification settings - Fork 592
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
Convert gRPC APIs to use GAPIC #1859
Comments
/bump after the big week last week :) Some things are @callmehiphop questions, others are @jmuk questions. Please let me know if you need any clarity. |
AFAIK we will not need any of the common stuff you mentioned if a library uses GAX, but code changes will be required to return whatever the GAPIC layer returns to the user from the handwritten. |
@jmuk is it possible to generate the Bigtable and Datastore GAX layer? |
Datastore will be ready soon. The bigtable API -- it seems we don't have its admin API support yet. You need both normal bigtable and its admin APIs, is that right? Also cc @lukesneeringer |
Correct, both are needed. Thanks for getting Datastore ready! |
This issue didn't have enough labels, so I marked it as blocked to reflect the changes we need from |
I propose we remove the API labels for the APIs that have already been implemented fully. We don't need this issue coming up in Vision, etc. queries, since it's already done for them. |
I'm actually fine with it (in this case!) because it would help us map back to this change (and its goals and discussion), which is helpful in the case we someday find a bug and can track it to this event. |
SGTM |
I've updated this issue with the task of supporting automatic project ID insertion. This functionality was inadvertently lost when we switched to GAX, and each API that was considered complete will need re-working to support it. |
@lukesneeringer @swcloud Friendly reminder to prioritize GAPIC porting work. |
@swcloud Ping. I'd like to keep making progress in Q2 on porting manual layers onto GAPIC code, as long as it doesn't interfere with our API deliverables. Stephen and Dave need priorities for that. |
To do a re-cap on what this issue is about, each API in the opening post has 4 tasks (defined below): Generated files are in repo Handwritten API is using generated API Passing through Automatic projectId insertion works -- The issue for this subject is here: googleapis/gax-nodejs#134 |
Thanks for explaining the current context for this issue @stephenplusplus. IIUC, the automatic projectId insertion is bound up with this issue raised by @ofrobots: #1891. Correct? FYI @lukesneeringer |
I am worried about automatic text insertion as it could do data corruption if the user data happens to contain strings that happen to match the pattern. Could we use promises to deal with async initialization, something like: function promiseOfTopic(topicName) {
return promiseOfProjectId
.then(projectId => `projects/${projectId}/topics/${topicName}`);
} |
Yes, we can do that, however two things to consider:
|
I am still fairly strongly opposed to string replacement patterns - even with more randomization. We ought to be able to guarantee that we will not clobber user data under any conditions. |
Two APIs remain, Bigtable and Datastore.
|
Datastore has made the transition, leaving only Bigtable. Issue opened on the Bigtable tracker: googleapis/nodejs-bigtable#23 |
gaxOptions
is available on all requestsgaxOptions
is available on all requests (will be complete when https://github.com/googleapis/nodejs-datastore is live)gaxOptions
is available on all requestsgaxOptions
is available on all requestsgaxOptions
is available on all requestsgaxOptions
is available on all requestsgaxOptions
is available on all requestsAutomatic projectId insertion works(Not applicable)gaxOptions
is available on all requestsAutomatic projectId insertion works(Not applicable)Cursoring Options
options.autoPaginate
Since the generated API accepts this option, I don't believe we'll need
common/paginator
. We will simply decorate whatever our callback to gax executes with.options.maxApiCalls
All API calls come with a cost, and
autoPaginate: true
leaves that out of the user's control. We added this option to give that control back. Is this supported in the generated layer?options.maxResults
We support this currently, though I don't know if this is supported in the generated layer. It will simply cut off making further requests after this amount has been reached. So a user can effectively say "autopaginate up until 58 results".
Common Methods
Since each resource will still have some or all of a shared set of methods:
delete
getMetadata
setMetadata
and we can still wrap them with helpers like:
create
exists
get
I believe it will require only a small bit of re-factoring to support, but GrpcService & GrpcServiceObject will likely continue to have a use. Alternatively, it might be possible to use the generic
Service
andServiceObject
if we can find an acceptable amount of convention/configuration.common/paginator
&common/streamify
Will we need these?
common/util.promisify
Will we need this?
Others
Is there anything else I could be missing?
I came up with this list by trying to migrate the Logging handwritten API to use the generated one. I quickly ran into these bumps, and figured we should resolve these and others up front. Ideally, our repo will remain clean of any artifacts of past implementations, so this will involve a thorough review of the utilities we have in
common
. @callmehiphop feel free to try a similar migration (pick an API) and see if you uncover any other issues.// cc @callmehiphop @jmuk @bjwatson
The text was updated successfully, but these errors were encountered: