Add Google Cloud Storage support#59
Merged
jimhester merged 3 commits intor-lib:masterfrom Mar 19, 2018
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## master #59 +/- ##
===========================================
- Coverage 100% 57.86% -42.14%
===========================================
Files 4 5 +1
Lines 151 197 +46
===========================================
- Hits 151 114 -37
- Misses 0 83 +83
Continue to review full report at Codecov.
|
Member
|
Thanks! This looks fine, if you can just add a note to NEWS.md with the change and mentioning your GitHub username and this issue I can merge. |
Contributor
Author
|
Thanks @jimhester - added those bits now. |
Member
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I tried to keep to the same format as the S3 integration.
I made a bucket on GCS called
memoise-teststhat I can give you access to as well for the tests to work as is (after you add your own authentication file) - just let me know your Google email to add it to. The tests all work for me locally, for them to work for you too it would need these authentication environment arguments set:GCS_AUTH_FILE- pointing at the service account JSONGCS_DEFAULT_BUCKET- pointing at the GCS bucket you have pre created, either on the web UI or viagoogleCloudStorageR::gcs_create_bucket()GAR_CLIENT_JSONto set your own client_id and secret viagoogleAuthR::gar_set_client()in the tests. It also assumes you have activated Cloud platform scope (on by default on GCPs) This is also downloaded from a Google Cloud project, another JSON file. See the help. Or you can set it directly viaoptions(googleAuthR.client_id)andoptions(googleAuthR.client_secret)but I prefer the former.The last one is only due to running non-interactivly in the tests, usually it will get set when you load
library(googleCloudStorageR)but I didn't think that was a good idea in the tests.I did deviate a bit by not creating a new bucket each time like that is done in the S3 function, I don't think thats necessary and its a lot smoother with a pre-made one. I also don't create a new bucket if its not there, I'd prefer more control when that is done, but you may disagree, I'll defer to whatever you think best.
Thanks for the package, its really useful, I use it for caching API calls in other packages.