Skip to content

feat(storage): Introduce unified checksum options and deprecate old options#16260

Open
v-pratap wants to merge 1 commit into
googleapis:mainfrom
v-pratap:unified-checksum-options-pr1
Open

feat(storage): Introduce unified checksum options and deprecate old options#16260
v-pratap wants to merge 1 commit into
googleapis:mainfrom
v-pratap:unified-checksum-options-pr1

Conversation

@v-pratap

Copy link
Copy Markdown
Contributor

Introduces unified enum-based UploadChecksumValidationOption and DownloadChecksumValidationOption and deprecates the old bool-based EnableMD5ValidationOption and EnableCrc32cValidationOption.

@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, deprecating several older validation options. It also updates AsyncWriterConnectionImpl::Finalize to support manual expected checksums and adds corresponding unit tests and examples. The review feedback highlights a critical issue where non-appendable uploads only check current_options instead of merged options, which would cause pre-computed checksums specified at the start of the upload to be ignored during finalization.

Comment thread google/cloud/storage/internal/async/writer_connection_impl.cc
@v-pratap v-pratap force-pushed the unified-checksum-options-pr1 branch from 1264fa0 to 55ceb4c Compare July 15, 2026 09:28
@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 (e493b2d) to head (6c92722).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16260      +/-   ##
==========================================
- Coverage   92.27%   92.27%   -0.01%     
==========================================
  Files        2214     2214              
  Lines      206505   206518      +13     
==========================================
+ Hits       190556   190558       +2     
- Misses      15949    15960      +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.

@v-pratap v-pratap force-pushed the unified-checksum-options-pr1 branch from 55ceb4c to 6580fd9 Compare July 15, 2026 10:15
@v-pratap v-pratap changed the title Introduce unified checksum options and deprecate old options feat(storage): Introduce unified checksum options and deprecate old options Jul 15, 2026
@v-pratap v-pratap force-pushed the unified-checksum-options-pr1 branch from 6580fd9 to 6c92722 Compare July 15, 2026 10:52
*
* @ingroup storage-options
*/
enum class ChecksumAlgorithm {

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.

In the old boolean system, a user could theoretically have passed DisableCrc32cChecksum(false) and DisableMD5Hash(false) to force the client to compute and validate both hashes. If that use case is valid, we may need a kBoth enum member.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants