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

chore(storage): generate GAPIC under internal subdir #4018

Merged
merged 11 commits into from Jun 29, 2021

Conversation

noahdietz
Copy link
Contributor

@noahdietz noahdietz commented Apr 27, 2021

Add a gRPC Go GAPIC for the Storage API under an internal subdirectory of the submodule to ensure no one can import it.

This GAPIC is being added for proof of concept development and should not be used in production or by any other client library.

Generated with the following:

$ cd google-cloud-go
$ export GOOGLE_CLOUD_GO=$(pwd)
$ cd internal/gapicgen
$ go run cloud.google.com/go/internal/gapicgen/cmd/genbot \
  -local \
  -regen-only \
  -only-gapics \
  -gapic=cloud.google.com/go/storage/internal/apiv1 \
  -gocloud-dir=$GOOGLE_CLOUD_GO

@noahdietz noahdietz requested a review from a team as a code owner April 27, 2021 23:57
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Apr 27, 2021
@noahdietz noahdietz marked this pull request as draft April 27, 2021 23:58
@noahdietz noahdietz force-pushed the gcs-gapic-poc branch 2 times, most recently from b1353a9 to 0b47db8 Compare June 22, 2021 18:23
@noahdietz noahdietz requested review from tritone and removed request for frankyn June 24, 2021 20:06
@noahdietz noahdietz changed the title DO NOT MERGE: GCS GAPIC PoC chore(storage): generate GAPIC under internal subdir Jun 24, 2021
@noahdietz noahdietz marked this pull request as ready for review June 24, 2021 23:48
@noahdietz noahdietz requested a review from a team June 24, 2021 23:48

// CallOptions contains the retry settings for each method of Client.
type CallOptions struct {
DeleteBucketAccessControl []gax.CallOption
Copy link
Contributor

Choose a reason for hiding this comment

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

I assume it's fine to include everything in the surface (not just media ops) because we are keeping this under internal?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's fine to include everything in the surface...because we are keeping this under internal

Yep! Also, the generator doesn't support generating bits of a proto :)

gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.DeadlineExceeded,
codes.Unavailable,
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these retryers all just entirely defaults, or are they defined in service proto?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They are defined in the grpc_service_config.json in googleapis by the AP team.

They are pretty basic. And retry doesn't apply to streaming methods after the stream has been created (i.e. resumption).

return c.internalClient.GetObjectMedia(ctx, req, opts...)
}

// InsertObject stores a new object and metadata.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice detailed docs here, has this been updated at all based on your investigations into resumable uploads @noahdietz ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

has this been updated at all based on your investigations into resumable uploads

Nope, this is actually just the documentation from the proto itself! I agree, its quite solid.

_ = c
}

func ExampleClient_DeleteBucketAccessControl() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Out of curiosity, have these examples actually proven useful and/or been published in docs for any product?

Copy link
Contributor Author

@noahdietz noahdietz Jun 28, 2021

Choose a reason for hiding this comment

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

They GoDoc examples so they are included in the package examples and with each method doc. I'm not sure if they've been determined useful, but they seem like table stakes for having GoDoc documentation imo.

The snippetgen project generates stuff for the cloud site and tbp@ would be your PoC there.

@noahdietz noahdietz added the automerge Merge the pull request once unit tests and other checks pass. label Jun 29, 2021
@gcf-merge-on-green gcf-merge-on-green bot merged commit 63fdb2e into googleapis:master Jun 29, 2021
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Jun 29, 2021
@noahdietz noahdietz deleted the gcs-gapic-poc branch June 29, 2021 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants