-
Notifications
You must be signed in to change notification settings - Fork 567
feat(storage): setting default checksum #30878
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(storage): setting default checksum #30878
Conversation
google-cloud-storage/test/google/cloud/storage/lazy/bucket_test.rb
Outdated
Show resolved
Hide resolved
|
FYI: @cpriti-os the KOKORO failures is not related to changes done by us |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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) | |||
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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? | |||
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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. | ||
| # |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert this.
|
closing this PR as its getting corrupted after merging main opening new PR |
This change sets Checksum CRC32C as default when we are uploading a file to bucket