Skip to content

Conversation

@shubhangi-google
Copy link
Contributor

@shubhangi-google shubhangi-google commented Aug 21, 2025

This change sets Checksum CRC32C as default when we are uploading a file to bucket

@shubhangi-google shubhangi-google marked this pull request as ready for review August 21, 2025 12:55
@shubhangi-google shubhangi-google changed the title feat: setting default checksum feat(storage): setting default checksum Aug 26, 2025
@aandreassa aandreassa added the api: storage Issues related to the Cloud Storage API. label Nov 21, 2025
@shubhangi-google
Copy link
Contributor Author

FYI: @cpriti-os the KOKORO failures is not related to changes done by us

Choose a reason for hiding this comment

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

I think we need to modify this documentation for the new default checksumming, make appropriate changes here, to the method summary and examples

Copy link
Contributor Author

Choose a reason for hiding this comment

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

made changes for doc but not sure what example to add for elaborating a default functionality

@@ -1640,10 +1640,7 @@ def file path,
# * `crc32c` - Calculate and provide a checksum using the CRC32c hash.
# * `all` - Calculate and provide checksums for all available verifications.
#
# Optional. The default is `nil`. Do not provide if also providing a
# corresponding `crc32c` or `md5` argument. See
# [Validation](https://cloud.google.com/storage/docs/hashes-etags)

Choose a reason for hiding this comment

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

Why are we removing this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updates the doc again

Clarify the default checksum behavior in documentation.
@@ -1805,6 +1804,8 @@ def create_file file,
path ||= file.path if file.respond_to? :path
path ||= file if file.is_a? String
raise ArgumentError, "must provide path" if path.nil?
# setting crc32c as default checksum algorithm if none provided for integrity check
checksum = :crc32c if checksum.nil? && crc32c.nil? && md5.nil?

Choose a reason for hiding this comment

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

how can a customer disable checksumming all together, earlier the option was do not send anything and we will consider it nil but now if the customer doesn't send anything or sends nil, we will overwrite with crc32c right? I dont think this is ideal.

Main concern: There's no way to distinguish between customer not sending anything and sending nil explicitly.

Copy link
Contributor Author

@shubhangi-google shubhangi-google Jan 27, 2026

Choose a reason for hiding this comment

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

if customer is not sending anything the default will be nil
and here we are setting CRC32c in case of nil

Choose a reason for hiding this comment

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

yes, and that is the problem, we are not providing the user with the option to disable all kinds of checksumming.

# corresponding `crc32c` or `md5` argument. See
# [Validation](https://cloud.google.com/storage/docs/hashes-etags)
# for more information.
#

Choose a reason for hiding this comment

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

Revert this.

@shubhangi-google
Copy link
Contributor Author

closing this PR as its getting corrupted after merging main opening new PR
cc: @cpriti-os

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.

4 participants