-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Storage: Update Blob.update_storage_class to support rewrite tokens #6527
Storage: Update Blob.update_storage_class to support rewrite tokens #6527
Conversation
Added test plan to original message |
@erikwebb this could potentially be baked into the request and handled for the developer. It will reduce complexity of surface design. WDYT? |
@frankyn IIUC this can't actually be fixed by the developer without using |
Apologies, what I meant is handling the token management within the method when a developer calls it instead of exposing the token back to the developer. The client library method would instead take care of handling the rewrite token and use it to continue the rewrite operation. |
@frankyn Oh okay, I see what you mean now. That's definitely another way to solve this. I have 2 different thoughts on that -
I'm not sure I have a strong opinion. If we choose this path, then we need to call out the potential long execution of the function in docs or maybe adding an additional helper function that allows users to choose their behavior. |
I vote for internalizing the token handling. I think a method taking a while for a large file is expected enough for a user. The greatest benefit of the approach @frankyn is suggesting is we can address the issue while keeping the public interface in tact. |
Let's move forward with moving in rewrite token handling into the method. To address the concern of the blocking call, could you add documentation stating it will block until the operation is complete with a short explanation? Additionally, it should have a link to the rewrite method if the user wants more control of the rewrite token. |
Works for me! I'll try to get on this tomorrow, otherwise next week.
…On Thu, Nov 29, 2018 at 2:08 PM Frank Natividad ***@***.***> wrote:
Let's move forward with moving in rewrite token handling into the method.
To address the concern of the blocking call, could you add documentation
stating it will block until the operation is complete with a short
explanation? Additionally, add link to the rewrite method if the user wants
more control of the rewrite token.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#6527 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAWt4owZLgDKznycR3xP8t5jT_3N66-uks5u0FragaJpZM4Ye2CC>
.
--
Erik Webb | Strategic Cloud Engineer | [email protected] | +1 650-667-4927
|
@erikwebb FYI: The linting for this recently changed and we formatted all of the code using |
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the |
4a7c750
to
e6a795a
Compare
CLAs look good, thanks! |
Adjusted diff to comments, resuming testing now. |
I tagged this as In addition to new / updated unit tests, the PR probably needs a new system test as well (I don't think we exercise |
Thanks @tseaver I missed that. |
Yep, the tests need to be updated to match / exercise the new implementation. |
I'll add a new system test (both for a small and large file) while I'm working on this. Thanks for the guidance! |
Quick question - I don't see any methods that check the metadata of an uploaded blob. I'd like to reinitialize a If not, I'll add it for the benefit of my test in one of two ways - class method that returns a fully populated |
@erikwebb I think |
e6a795a
to
7b4fbee
Compare
7b4fbee
to
a3cecc9
Compare
a3cecc9
to
915ee59
Compare
storage/google/cloud/storage/blob.py
Outdated
while True: | ||
token, _, _ = self.rewrite(self, token=token) | ||
if token is None: | ||
break |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
915ee59
to
108f733
Compare
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.
This is ready to merge once CI is green (I had to kick Kokoro just now).
Fixes #6524
Test Plan
Test code (
test_6524.py
) -Create a 5GB file
big_file.bin
in thetest_pr6524
bucket -Test using
google-cloud-storage==1.13.0
-Reset object storage class to be safe -
Test using PR #6527 -