Skip to content

feat(storage): Migrate async client to unified checksum options#16261

Merged
v-pratap merged 13 commits into
googleapis:mainfrom
v-pratap:unified-checksum-options-pr2
Jul 20, 2026
Merged

feat(storage): Migrate async client to unified checksum options#16261
v-pratap merged 13 commits into
googleapis:mainfrom
v-pratap:unified-checksum-options-pr2

Conversation

@v-pratap

Copy link
Copy Markdown
Contributor

Migrates the Async client (connection_impl.cc, object_descriptor_impl.cc) to use the newly introduced unified checksum options. Also includes the necessary fallback logic to support users who are still using the deprecated options.

Note: This PR is stacked on top of #16260 and includes its commit. It should be merged after #16260.

@v-pratap
v-pratap requested review from a team as code owners July 15, 2026 09:25

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

Copy link
Copy Markdown

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 introduces UploadChecksumValidationOption and DownloadChecksumValidationOption to configure checksum algorithms for uploads and downloads, deprecating the older EnableCrc32cValidationOption and EnableMD5ValidationOption. It updates the internal connection and reader implementations to respect these new options with fallback support, adds corresponding unit and integration tests, and provides a code sample. The reviewer feedback highlights that the fallback logic for download checksum validation is duplicated three times across non-test files and suggests refactoring it into a shared helper function in accordance with the repository style guide.

Comment thread google/cloud/storage/internal/async/connection_impl.cc Outdated
Comment thread google/cloud/storage/internal/async/object_descriptor_impl.cc Outdated
Comment thread google/cloud/storage/internal/async/object_descriptor_impl.cc Outdated
@v-pratap
v-pratap force-pushed the unified-checksum-options-pr2 branch 5 times, most recently from 67305d6 to 8bd3544 Compare July 15, 2026 10:56
@v-pratap v-pratap added the do not review Indicates a PR is not ready for review label Jul 15, 2026
@v-pratap
v-pratap force-pushed the unified-checksum-options-pr2 branch from 8bd3544 to 1268c7f Compare July 15, 2026 11:27
@v-pratap v-pratap changed the title Migrate async client to unified checksum options feat(storage): Migrate async client to unified checksum options Jul 15, 2026
@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.27%. Comparing base (d26d929) to head (c419f36).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16261      +/-   ##
==========================================
- Coverage   92.27%   92.27%   -0.01%     
==========================================
  Files        2217     2218       +1     
  Lines      206628   206654      +26     
==========================================
+ Hits       190672   190687      +15     
- Misses      15956    15967      +11     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@product-auto-label product-auto-label Bot added the api: storage Issues related to the Cloud Storage API. label Jul 16, 2026
@v-pratap v-pratap removed the do not review Indicates a PR is not ready for review label Jul 16, 2026
@v-pratap
v-pratap force-pushed the unified-checksum-options-pr2 branch from dc5fbb5 to 39c4a25 Compare July 17, 2026 05:56

@kalragauri kalragauri 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.

Looks like you'll need to modify some more tests which are using the deprecated options:

Step #2 - "build.sh": /workspace/google/cloud/storage/internal/object_write_streambuf_test.cc:690:22: warning: 'DisableCrc32cChecksum' is deprecated: Use UploadChecksumValidationOption and DownloadChecksumValidationOption instead [-Wdeprecated-declarations]
Step #2 - "build.sh":   690 |   request.set_option(DisableCrc32cChecksum(false));
Step #2 - "build.sh":       |                      ^
Step #2 - "build.sh": /workspace/google/cloud/storage/hashing_options.h:149:10: note: 'DisableCrc32cChecksum' has been explicitly marked deprecated here
Step #2 - "build.sh":   149 | struct [[deprecated(
Step #2 - "build.sh":       |          ^
Step #2 - "build.sh": /workspace/google/cloud/storage/internal/object_write_streambuf_test.cc:691:22: warning: 'DisableMD5Hash' is deprecated: Use UploadChecksumValidationOption and DownloadChecksumValidationOption instead [-Wdeprecated-declarations]
Step #2 - "build.sh":   691 |   request.set_option(DisableMD5Hash(false));
Step #2 - "build.sh":       |                      ^
Step #2 - "build.sh": /workspace/google/cloud/storage/hashing_options.h:79:10: note: 'DisableMD5Hash' has been explicitly marked deprecated here
Step #2 - "build.sh":    79 | struct [[deprecated(
Step #2 - "build.sh":       |          ^
Step #2 - "build.sh": /workspace/google/cloud/storage/internal/object_write_streambuf_test.cc:695:49: warning: 'DisableCrc32cChecksum' is deprecated: Use UploadChecksumValidationOption and DownloadChecksumValidationOption instead [-Wdeprecated-declarations]
Step #2 - "build.sh":   695 |       CreateHashFunction(Crc32cChecksumValue(), DisableCrc32cChecksum(false),
Step #2 - "build.sh":       |                                                 ^
Step #2 - "build.sh": /workspace/google/cloud/storage/hashing_options.h:149:10: note: 'DisableCrc32cChecksum' has been explicitly marked deprecated here
Step #2 - "build.sh":   149 | struct [[deprecated(
Step #2 - "build.sh":       |          ^
Step #2 - "build.sh": /workspace/google/cloud/storage/internal/object_write_streambuf_test.cc:696:42: warning: 'DisableMD5Hash' is deprecated: Use UploadChecksumValidationOption and DownloadChecksumValidationOption instead [-Wdeprecated-declarations]
Step #2 - "build.sh":   696 |                          MD5HashValue(), DisableMD5Hash(false)),
Step #2 - "build.sh":       |                                          ^
Step #2 - "build.sh": /workspace/google/cloud/storage/hashing_options.h:79:10: note: 'DisableMD5Hash' has been explicitly marked deprecated here
Step #2 - "build.sh":    79 | struct [[deprecated(

@v-pratap
v-pratap force-pushed the unified-checksum-options-pr2 branch from 59e1bf1 to c0cf77b Compare July 17, 2026 09:17
@v-pratap
v-pratap requested a review from kalragauri July 17, 2026 11:06
@v-pratap
v-pratap merged commit fd956fb into googleapis:main Jul 20, 2026
61 of 63 checks passed
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