Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add validation of generation and metageneration to upload functions #98

Closed
wants to merge 2 commits into from

Conversation

HollayHorvath
Copy link

@HollayHorvath HollayHorvath commented Apr 3, 2020

  • An issue was already open for this problem, linked below
  • Ensure the tests and linter pass
  • Code coverage does not decrease - I'm not quite sure about this
  • Appropriate docs were updated - I have updated the comments by adding the new parameters, if there are other places to update please let me know

Fixes #16 馃

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

馃摑 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

鈩癸笍 Googlers: Go here for more info.

@googlebot googlebot added the cla: no This human has *not* signed the Contributor License Agreement. label Apr 3, 2020
@HollayHorvath
Copy link
Author

@googlebot I signed it!

@googlebot
Copy link

CLAs look good, thanks!

鈩癸笍 Googlers: Go here for more info.

@googlebot googlebot added cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels Apr 3, 2020
@frankyn frankyn added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 3, 2020
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 3, 2020
@frankyn frankyn self-requested a review April 3, 2020 17:56
Copy link
Member

@frankyn frankyn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have one nit, but overall LGTM, thanks for picking this up @HollayHorvath!

size,
num_retries,
predefined_acl,
generation_match,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you update the name with expected prefix of if_ to follow the API spec?

@@ -1785,6 +1897,10 @@ def _upload_from_file_helper(self, side_effect=None, **kwargs):
content_type = u"font/woff"
client = mock.sentinel.client
predefined_acl = kwargs.get("predefined_acl", None)
generation_match = kwargs.get("generation_match", None)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more request, could you add system tests that exercise these new parameters?

@frankyn
Copy link
Member

frankyn commented Apr 21, 2020

Thanks for your support @HollayHorvath, you helped get this ball moving and will have it out in the library soon.

@IlyaFaer is taking the work you've done and making necessary changes to get into the library. I'm closing out this PR and continuing the remaining discussions in #111.

@frankyn frankyn closed this Apr 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Storage: upload_from_string() with ifGenerationMatch=0
4 participants