Skip to content

fix(storage): Omit auto checksum in final request when MD5 is given#14024

Merged
krishnamd-jkp merged 3 commits into
googleapis:mainfrom
krishnamd-jkp:fix_checksum_bug
Mar 3, 2026
Merged

fix(storage): Omit auto checksum in final request when MD5 is given#14024
krishnamd-jkp merged 3 commits into
googleapis:mainfrom
krishnamd-jkp:fix_checksum_bug

Conversation

@krishnamd-jkp

Copy link
Copy Markdown
Contributor

No description provided.

@krishnamd-jkp krishnamd-jkp requested review from a team as code owners March 2, 2026 10:26
@product-auto-label product-auto-label Bot added the api: storage Issues related to the Cloud Storage API. label Mar 2, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread storage/grpc_writer.go
Comment thread storage/integration_test.go Outdated

func TestIntegration_WriterCRC32CValidation(t *testing.T) {
ctx := skipZonalBucket(context.Background(), "Test for resumable and oneshot writers")
ctx = skipExtraReadAPIs(context.Background(), "Test for uploads")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

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.

Suggested change
ctx = skipExtraReadAPIs(context.Background(), "Test for uploads")
ctx = skipExtraReadAPIs(ctx, "Test for uploads")

Comment thread storage/integration_test.go
@krishnamd-jkp krishnamd-jkp merged commit d404777 into googleapis:main Mar 3, 2026
10 checks passed
krishnamd-jkp added a commit that referenced this pull request Mar 10, 2026
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>
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.

2 participants