-
Notifications
You must be signed in to change notification settings - Fork 0
making crc32c as default #33
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
base: main
Are you sure you want to change the base?
Conversation
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.
Summary of Changes
Hello @shubhangi-google, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request updates the google-cloud-storage library to make CRC32C the default checksum algorithm for file uploads when no specific checksum is provided. This change simplifies file creation by automatically ensuring data integrity verification. The update includes modifications to the create_file method in the Bucket class and corresponding additions and adjustments to the test suite to validate the new default behavior across different file input types.
Highlights
- Default CRC32C Checksum: The
create_filemethod ingoogle-cloud-storage/lib/google/cloud/storage/bucket.rbnow defaults to usingcrc32cas the checksum mechanism when no other checksum (CRC32C or MD5) is explicitly specified. - Expanded Test Coverage: New test cases have been added to
google-cloud-storage/test/google/cloud/storage/bucket_test.rbto validate that thecreate_filemethod correctly applies thecrc32cdefault for various file types, includingTempfileandStringIO. - Test Helper Alignment: The
empty_file_gapihelper method within the test suite has been updated to reflect the new defaultcrc32cbehavior, ensuring consistency between the production code and test expectations.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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.
Code Review
This pull request successfully implements crc32c as the default checksum for file uploads. The core logic change is correct. However, the accompanying test modifications introduce some fragility. Specifically, a test helper has been updated with a hardcoded value that may not be appropriate for all tests using it. I've provided suggestions to improve the robustness and maintainability of the tests by using a more sensible default and adjusting the tests accordingly. I've also included a minor style suggestion for the main implementation file.
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
bundle exec rake ciin the gem subdirectory.closes: #<issue_number_goes_here>