-
Notifications
You must be signed in to change notification settings - Fork 166
fix(bucket): Move blob fails when the new blob name contains characters that need to be url encoded #1605
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
Conversation
There's no need to add a test when the name does not need urlencoding since that's already covered in the previous 2 tests for move_blob.
Summary of ChangesHello @rcleveng, 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 addresses a critical bug in the Google Cloud Storage client library's Highlights
Using Gemini Code AssistThe 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
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 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
|
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 correctly fixes a bug in Bucket.move_blob() where the new blob name was not being URL-encoded, causing failures for names containing special characters like '/'. The fix involves using the existing _quote helper to encode the new_name before constructing the API request path. A new unit test, test_move_blob_needs_url_encoding, has been added to verify this fix and prevent future regressions. The changes are correct, well-tested, and I approve of them.
|
Hey @chandra-siri is there anything else I need to do here on this one? |
chandra-siri
left a comment
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.
LGTM.
Thanks for fixing this issue. |
|
@rcleveng I've reviewed it now. Thanks for your patience and apologies for the delay. |
Sys test for move blob. Add System test for bukect.move_blob where blob name needs url encoding. The fix was done in #1605
fix(bucket): url encode new_name parameter in move_blob()
The move_blob() method was not URL encoding the new_name parameter
before passing it to the API call, unlike how the blob encodes its own
path. This caused failures when moving blobs to paths with special
characters.
Added URL encoding for new_name to match the blob path encoding, as
both names must fit in the API URL format: "{blob_path}/moveTo/o/{new_name}"
Here's an example of what fails:
Fixes #1523