Skip to content

Conversation

@chandra-siri
Copy link
Collaborator

feat: send entire object checksum in the final api call of resumable upload

fixes b/461994245

@product-auto-label product-auto-label bot added size: s Pull request size is small. api: storage Issues related to the googleapis/python-storage API. labels Dec 8, 2025
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @chandra-siri, 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 enhances the resumable upload mechanism by ensuring that the complete object checksum is consistently included in the final API request. This modification is crucial for maintaining data integrity and verifying the successful transfer of the entire object, addressing a previously identified issue.

Highlights

  • Checksum Inclusion: The pull request introduces a change to include the entire object's checksum (MD5 or CRC32c) in the x-goog-hash header during the final API call of a resumable upload.
  • Bug Fix: This change specifically addresses and fixes an identified bug (b/461994245) where the full object checksum was not being sent as expected.
  • Unit Tests: New unit tests have been added to verify that the x-goog-hash header is correctly sent with both CRC32c and MD5 checksums for resumable uploads.
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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request 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

  1. 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.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 implements a valuable feature by sending the entire object checksum in the final API call of a resumable upload, enhancing data integrity verification. The implementation in google/cloud/storage/_media/_upload.py is correct and well-contained. The accompanying tests in tests/unit/test_blob.py are thorough, with new test cases for both md5 and crc32c checksums. I have one suggestion to make the test code more robust.

@product-auto-label product-auto-label bot added size: m Pull request size is medium. and removed size: s Pull request size is small. labels Dec 8, 2025
chandra-siri and others added 4 commits December 9, 2025 00:31
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@chandra-siri chandra-siri marked this pull request as ready for review December 8, 2025 19:45
@chandra-siri chandra-siri requested review from a team as code owners December 8, 2025 19:45
@chandra-siri chandra-siri assigned v-pratap and Pulkit0110 and unassigned v-pratap Dec 8, 2025
@chandra-siri chandra-siri merged commit ddce7e5 into googleapis:main Dec 9, 2025
14 checks passed
chandra-siri added a commit that referenced this pull request Dec 9, 2025
🤖 I have created a release *beep* *boop*
---


##
[3.7.0](v3.6.0...v3.7.0)
(2025-12-09)


### Features

* Auto enable mTLS when supported certificates are detected
([#1637](#1637))
([4e91c54](4e91c54))
* Send entire object checksum in the final api call of resumable upload
([#1654](#1654))
([ddce7e5](ddce7e5))
* Support urllib3 &gt;= 2.6.0
([#1658](#1658))
([57405e9](57405e9))


### Bug Fixes

* **bucket:** Move blob fails when the new blob name contains characters
that need to be url encoded
([#1605](#1605))
([ec470a2](ec470a2))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Chandra Shekhar Sirimala <[email protected]>
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 googleapis/python-storage API. size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants