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): add idempotency header #7602

Merged
merged 4 commits into from
Mar 21, 2023

Conversation

tritone
Copy link
Contributor

@tritone tritone commented Mar 20, 2023

This additional header will allow idempotent retries on certain requests which are non-idempotent currently.

This additional header will allow idempotent retries on certain
requests which are non-idempotent currently.
@tritone tritone requested review from a team as code owners March 20, 2023 20:38
@product-auto-label product-auto-label bot added size: s Pull request size is small. api: storage Issues related to the Cloud Storage API. labels Mar 20, 2023
s.Errorf("X-Goog-Api-Client header has wrong format\ngot %v\nwant regex matching %v", gotHeader, wantHeaderFormat)
s.Errorf("X-Goog-Api-Client header has wrong format\ngot %v\nwant regex matching %v", gotClientHeader, wantClientHeaderFormat)
}
if gotIdempotencyHeader != initialIdempotencyHeader {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: consider using cmp.Diff and reporting the diff in the error message.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looked into this, but unfortunately it doesn't work because x-goog-api-client also contains library & Go version information. We search for a substring regex for the added components rather than looking for an exact match for the whole thing. I guess we could reconstruct those components as well but it will make the test brittle to non-breaking changes in apiary, which I'd rather not do.

@tritone tritone added the automerge Merge the pull request once unit tests and other checks pass. label Mar 21, 2023
@gcf-merge-on-green gcf-merge-on-green bot merged commit 75e992d into googleapis:main Mar 21, 2023
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Mar 21, 2023
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. size: s Pull request size is small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants