Closed jsocolar closed 2 years ago
Hi @jsocolar, thank you for helping us solve this. I just made some minor changes to your code. I added a cat rather than having to run googleCloudStorageR::gcs_upload
again :). I can ensure that the changes work great in Windows and Ubuntu :)
https://github.com/r-spatial/rgee/blob/128014c34c6776b62547f9c5d200be4ec7632771/R/utils-upload.R#L67
Can close #202, but a bit of attention is required prior to merging (see below)
This PR adds a
predefinedAcl
argument that is passed through*_as_ee
, thoughlocal_to_gcs
, and then togoogleCloudStorageR::gcs_upload
.It additionally updates tests to cover this case. Some of these tests rely on a bucket with uniform access, currently hardcoded in
testthat.R
asPrior to merging @csaybar might want to either delete the above function and the new tests in
test-upload.R
or (preferably?) set up this bucket in your own testing infrastructure so that these tests can run. I thought it would be a good idea to get test coverage here so that CRAN will helpgoogleCloudStorageR
to avoid changes in thepredefinedAcl
argument that could break things forrgee
.I have not verified that the contents of this new uniform-access bucket will get properly deleted when the tests finish. This needs to be verified and updated if necessary.
I've bumped the version number of
googleCloudStorageR
in Suggests from5.1
to6.0
because I'm too lazy to verify which version number first included thepredefinedAcl
argument.I've also tweaked
local_to_gcs
so that ifquiet = FALSE
andgoogleCloudStorageR::gcs_upload
errors repeatedly, the user will see the error returned on the final try (seeing this error will help the user recognize if they need to change thepredefinedAcl
argument).