fix(storage): Omit auto checksum in final request when MD5 is given#14024
Conversation
There was a problem hiding this comment.
Code Review
This pull request aims to prevent sending an auto-calculated CRC32C checksum when a user provides an MD5 checksum for gRPC uploads. However, the implementation appears to be incomplete. While the change ensures the user's MD5 checksum is included in the request, it doesn't prevent an auto-calculated CRC32C from also being added, which contradicts the PR's stated goal. Additionally, a minor bug in the test setup was found where a new context is initialized incorrectly, discarding previous context modifications.
|
|
||
| func TestIntegration_WriterCRC32CValidation(t *testing.T) { | ||
| ctx := skipZonalBucket(context.Background(), "Test for resumable and oneshot writers") | ||
| ctx = skipExtraReadAPIs(context.Background(), "Test for uploads") |
There was a problem hiding this comment.
This line re-initializes the context using context.Background(), which discards the context configured by skipZonalBucket on the previous line. To chain the context modifications, you should pass the existing ctx variable instead.
| ctx = skipExtraReadAPIs(context.Background(), "Test for uploads") | |
| ctx = skipExtraReadAPIs(ctx, "Test for uploads") |
PR created by the Librarian CLI to initialize a release. Merging this PR will auto trigger a release. Librarian Version: v0.8.3 Language Image: us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/librarian-go@sha256:19bb93e8f1f916c61b597db2bad65dc432f79baaabb210499d7d0e4ad1dffe29 <details><summary>storage: v1.61.0</summary> ## [v1.61.0](storage/v1.60.0...storage/v1.61.0) (2026-03-10) ### Features * add bucket encryption enforcement configuration (#13874) ([245c8d7](245c8d76)) * add multistream options to MRD (#13758) ([4557675](4557675e)) * add a DeleteFolderRecursive API definition (PiperOrigin-RevId: 866471251) ([6f31019](6f310199)) * add multistream support to MRD (#13792) ([ffa7268](ffa7268c)) ### Bug Fixes * Fix TM download dir corner case (#14142) ([87cdcc9](87cdcc9f)) * Omit auto checksum in final request when MD5 is given (#14024) ([d404777](d4047774)) * optimize gRPC writer with zero-copy and lazy allocation (#13481) ([df64147](df641476)) </details>
No description provided.