-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
Finish implementation of Spaces API #140
Comments
I think it makes sense to include all of them |
I sat down to get a lay of this and everything looks very reasonable. I wrote a See this example with an invalid bucket name, purposely run: > rawToChar(space_get_object("welcome.html", "test-analogseas"))
[1] "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Error><Code>NoSuchBucket</Code><BucketName>test-analogseas</BucketName><RequestId>tx000000000000002f5f59e-0059ffb7c0-3f970-nyc3a</RequestId><HostId>3f970-nyc3a-nyc</HostId></Error>" It returns the raw response and throws away the underlying HTTP request's status code so there appears to be no way to know if this is the file I have stored at Looking at the source I can see why. Looking at the open Issues on the repo, I see that the function isn't really written to handle errors see this issue. If it's the case that the Thoughts? |
@amoeba thanks for your work on this! I've been AFK due to illness but I want to jump back in to help out. I'll add notes on which features I would like to tackle this week. Regarding the error handling with |
Thanks for raising the issue with erroring. I definitely value failing well, so I'd strongly prefer to make sure users get useful errors - and DigitalOcean, at least with the Droplet API (and I assume with the spaces API) fails well and correctly making it easy to give users appropriate errors We currently still use For now I think it's okay to stick with |
Sounds good, thanks for weighing in @sckott. If/when the @Thercast Sorry to hear you were out! Looking forward to your notes. |
any thoughts on this? anything I can help with? |
I'm still down to help PR this addition but wanted to let @Thercast take lead since it was his idea. Hopefully he'll pop in here and we can get this done soon? |
Hi @sckott and @amoeba, sorry for the delay (an urgent shiny app came up at work and then the kids got sick) but I would like to tackle the listing of bucket contents and deletion of a bucket (these tasks should help shake off the cobwebs of being away for a bit). @amoeba I'd be glad if you'd like to start on the fundamental operations for objects in a space (i.e. downloading, uploading, deleting). Does that sound like a good plan? |
Sounds good to me! |
First half of the Object calls implemented in #146. Went pretty well. Regarding the calls I didn't implement,
General questions:
I'll look into the delete operation issue above later this week. |
Regarding the PR, I assume you're adding more to it? Or do you want it to be handled as is?
|
I should've made that more clear, sorry: I'm planning on adding more commits but needed the intermediate review (thanks!). Once I'm done, do you mind a messy PR or would you rather I squash the PR into a single commit once I'm happy? Re: Your comments:
Sold!
Sounds great.
Great, this is new to me so I'll look that up and take a stab at it.
Good suggestion!
I like this a lot. Will do.
Great, will do. |
Okay, figured out the Roxygen template functionality to DRY up the common
|
Figured out the problem with deleting objects. Totally just due to a bug in |
not sure on the multipart thing. to make separate functions, how many more fxns does that add? for xml, like idea of putting |
It'd be five new functions which have a 1:1 mapping with their Spaces API calls. I think the main reason to do this is so we can claim this package implements the Spaces API with 1:1 mappings between API routes and R functions. I don't think this would be commonly used by this package's users. For the user to upload a multi-part file, they would have to write their own routine to start, upload each piece, and complete the upload (which seems less-than-fun and error-prone). The functionality that would be provided by the five separate functions is almost entirely wrapped up in I'd lobby for not doing these calls now and adding docs to |
Okay, If you're okay with not implementing the multi-part API with 1:1 functions, then the Object API is done. |
Oh, and a note on how I did that: I noticed that |
Agree to just put Sounds good on the
so PR #146 is ready to go from your side? |
Almost. I decided to verify the |
Found two blocking bugs in the |
hugh - i guess move ahead here and add to docs that multipart doesn't work now, but will work later? |
Filed an upstream issue for Space creation not working cloudyr/aws.s3#199 |
aws.s3 is getting some fixes as we speak [1] so I'll plan to re-visit some of the existing issues with the Spaces implementation that are waiting on upstream changes this week. |
Sat down with this a bit yesterday and today and ran into more upstream issues. @leeper added support for non-AWS S3-compatible storages but I'm getting signature mismatch errors no matter what I try now: cloudyr/aws.s3#189. I think I'll wait to see what @leeper says in case this is a quick fix on either my end or aws.s3's. |
Okay, will also take a look soon |
Thanks! I haven't been able to devote enough debugging time. I'm at a point where my next step is to take |
okay |
hey @amoeba - thinking about this a bit, I played around with trying to fix bucket creation, but go nowhere. Okay with you if we move on with next cran submission with what spaces stuff works for now? With functions that don't work yet, we could just not export them, or export and document as not working yet, and add a stop() inside them with message? seems like at least these don't work for me:
|
That sounds good to me. Thanks a million for trying to fix the issue. Releasing a partial implementation of the Spaces API seems useful in its own right if those are the only two functions that aren't working so let's do that. I'll test to see which functions work to see if my list matches yours. @sckott wrote:
Do you have a preference here? I'd lean towards not exporting but I'd like to do the least surprising thing. I'll get to this tonight or tomorrow. |
not exporting is probably best, and good to document that they'll come along later |
I get the same list of non-working functions. I'll start with the changes now. Other notes that just came up:
> spaces_object_put("~/Downloads/test.txt", space = "analogsea-test")
[1] TRUE This function just returns exactly what
> spaces_object_copy("test.txt", "test2.txt", "analogsea-test", "analogsea-test")
$LastModified
[1] "2018-06-12T04:45:49.357Z"
$ETag
[1] "00f7d50ab4278a7899d7499481c9603a"
attr(,"x-amz-request-id")
[1] "tx0000000000000076436a6-005b1f4ffd-8abd1d-nyc3a"
attr(,"content-type")
[1] "application/xml"
attr(,"content-length")
[1] "183"
attr(,"date")
[1] "Tue, 12 Jun 2018 04:45:49 GMT"
attr(,"strict-transport-security")
[1] "max-age=15552000; includeSubDomains; preload" Would it also be better to |
I just checked |
As per pachadotdev#140: - Remove export tags from space_create and spaces_object_delete - Add notes to the roxygen docstrings - Add `stops` with a hopefully helpful error message that the fns are not implemented yet - Re-document package
Cool, thanks for the PR. If nothing else on this for now. i'll push to cran in the next few days. i'll see if any problems pop up in checking before then |
Great, I'm satisfied for now if you are. Thanks for all the help. |
still not pushed yet, sorry, getting there soon hopefully |
NP! |
Okay, so @thosjleeper worked some magic on aws.s3 and everything works now. PR incoming. The checklist at the top of this Issue is accurate AFAIK. |
@amoeba we need to push a new version soon (this milestone) - should we close this issue or keep it open and move to next milestone? |
Sounds good, I think we should submit by 28 Jan - just in case need to resubmit a few times - don't want to risk missing 31 Jan deadline |
Okay, I can do that. |
I sat down for a few hours tonight to finish up the remaining Spaces functions and ended up getting stumped with what looks like more After getting stumped, I spent a bit of time stripping out the What do you think makes the most sense as a next step? Sorry I haven't been able to devote more time. |
Thanks for the update. I think the additional Spaces work can wait until next version. I'd like to submit by Wed. Do you think the work of replacing |
oh right, you already did that work -> #189 |
@amoeba do you think you can finish this today? or should I go ahead and submit? |
No, sorry. Please go ahead and submit. I'll have to carve out some time this quarter. |
okay, will do |
#138 added support for part of the Spaces API and we decided in #136 to start a fresh issue to help divvy up the tasks of completing the API. Below is a checklist with items transcribed from the Spaces API docs:
Let me know if the organization of this list doesn't make sense or isn't useful for tackling this.
The text was updated successfully, but these errors were encountered: