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(storage): add retry config to the Client and HmacKey operations #5193

Merged
merged 15 commits into from Dec 20, 2021

Conversation

BrennaEpp
Copy link
Contributor

@BrennaEpp BrennaEpp commented Dec 6, 2021

No description provided.

@product-auto-label product-auto-label bot added the api: storage Issues related to the Cloud Storage API. label Dec 6, 2021
@BrennaEpp BrennaEpp marked this pull request as ready for review December 9, 2021 19:54
@BrennaEpp BrennaEpp requested review from a team as code owners December 9, 2021 19:54
Copy link
Contributor

@tritone tritone left a comment

Choose a reason for hiding this comment

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

Let me know if you'd like to discuss more about what surface makes sense here.

storage/storage.go Show resolved Hide resolved
storage/storage.go Outdated Show resolved Hide resolved
Copy link
Contributor

@tritone tritone left a comment

Choose a reason for hiding this comment

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

A couple small things, generally looks good.

storage/hmac.go Outdated
@@ -214,7 +215,12 @@ func (c *Client) CreateHMACKey(ctx context.Context, projectID, serviceAccountEma

setClientHeader(call.Header())

hkPb, err := call.Context(ctx).Do()
var hkPb *raw.HmacKey
var err error
Copy link
Contributor

Choose a reason for hiding this comment

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

Can inline this declaration

storage/hmac.go Outdated
metadata, err = call.Context(ctx).Do()
return err
})
}, h.retry, true)
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be conditionally idempotent based on whether the Etag is present in the metadata-- the user may pass it in HMACKeyAttrsToUpdate or not.

Are conformance tests catching this?

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 should be good now

storage/storage_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@tritone tritone left a comment

Choose a reason for hiding this comment

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

One more nit, otherwise LGTM

if err != nil {
return err
if preconditions {
k, err := key.Get(ctx)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can get Etag from fs.hmacKey rather than having another Get

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good note!

@BrennaEpp BrennaEpp enabled auto-merge (squash) December 20, 2021 21:38
@BrennaEpp BrennaEpp merged commit ce6e7a0 into googleapis:main Dec 20, 2021
BrennaEpp added a commit to BrennaEpp/google-cloud-go that referenced this pull request Dec 23, 2021
@BrennaEpp BrennaEpp deleted the c-retry branch February 8, 2023 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the Cloud Storage API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants