Repository navigation
yandex: Major rewrite - #2695
Conversation
That is looking very nice, using the rest module with pacer - all very modern! I haven't given it a thorough going over, but it is looking good :-)
What would you like me to do - run the integration tests and spot problems? I can have a go with that if you want. |
|
I managed to work around my integration test problem by running them myself from a remote server and I have them passing now. Depending on how much time I find I'll have this PR done within the next few days. |
Super! Let me know if you need any help :-) |
cc6afe7 to
c20f2d2
Compare
|
Copy, Move, DirMove, PublicLink and About are now implemented and everything should be working as expected now. So if anyone wants to do testings now is the right time. It is expected that the Copy, Move, Purge and especially DirMove integration tests may fail. These operations need some time to complete on Yandex and my not be reflected in List when checked in tests. In my local tests i fixed this by adding delays of up to 5 seconds on these operations but I've left those out for now. The Yandex documentation says you are supposed to track the status of these operations until they are complete but i consider this pretty unnecessary because in all my testing I've never seen one of those operations fail. The code still still needs some cleanup and especially the error handling needs a few more improvements. |
Dry run upload (copy from local to remote)
|
|
Oh yeah you have to run config again. This PR changes how authorization works. |
Can stable and beta work simultaneously with their tokens in different config files? |
|
Sure just name the remote different. |
|
While creating new remote [yantest] got error in the log: |
|
This is part of the auth workaround. For now you can ignore this it should work anyway. |
|
v1.44-029-g1e47b247-beta
Failed (not implemented yet?)
|
Can you tell if the user is using the old Auth? If so a helpful message like this one would be great |
|
@ncw I'm not sure if the OAuth changes are final. Maybe you know a better solution. See review. @Snousmoumryk I cannot reproduce your issue with delete it works fine for me. Can you please send me log? |
Checked test scripts with fresh eyes
Sorry, my fault, copy-paste catch - no errors found, test Passed.
According to rclone delete doc page /tmpdir content is expected to be deleted. Log file rclone-subdir-delete-failed.zip |
|
I‘m not sure about this and I don‘t see any error from the Yandex backend in the log. |
|
|
I consider the code now ready for review. Only minor changes left. I'll update the docs once the code is 100% finished. |
Great news @buengese! 👍
@ncw Maybe it makes sense to add these two sentences to the help/online docs of the It took me a while to accept the logic of when an object attribute (a path in terms of file system) remains after the object itself is deleted. I guess I'm not the only one confused. |
Yes more docs are better I'll add them.
|
|
@ncw Don't want to annoy you. Just a reminder the main thing this PR is waiting for is a review from you. I'd like to get this done during next week or so because I won't have much time after that. |
|
No worries! I've got it on my to-do list for this weekend. Things have been a bit hectic recently! |
|
I have had a look through the code - it looks great :-) Nothing I particularly think we should change. Some things to discuss:
and I think we are very close - excellent work :-) |
|
Thanks for the Review.
I'll definetly have another look at the OAuth Stuff.
The Test failures are somewhat expected because certain operations just take some time to complete on Yandex (but they will complete eventually). The tests can be fixed by adding something like
ListR has the same problem as the operations above with changes taking some time to be reflected in the file list. With ListR this may also extend to operations like upload or deleting a single file which should be reflected instantly in the normal Listing. I can bring it back if you want.
Updating the docs is still on my todo list. |
I think just checking the value of "token" in the
Ah! It looks like DirMove is the only troublesome one. We should implement the polling of the URL because
I'm not too bothered either way!
:-) |
Ah ok in this case I'll implement it. It actually DirMove and Purge that need this. The Error in the Sync test is actually related to mkDirs. I'm going to revert mkDirs to the way it was in the original implementation where it pretty much ignores all errors. I'm really not happy with that because this means mkDirs will fail silently but the Yandex docs don't provide a comprehensive list of all Errors and when they're expected to occur. |
|
Sorry for the delay. This should finally be done now. |
ncw
left a comment
There was a problem hiding this comment.
I gave this a thorough test with the integration tests and a bit of hand rolled torture test and it worked very well! All the integration tests passed as did my hand rolled tests.
However I noticed a file descriptor leak though when doing uploads - one of the calls to f.srv.Call() isn't closing the body so needs a NoResponse: true in the opts. I tried to mark the places I think needs them, but it was probably the one in upload causing the problem I noticed.
I spotted a typo in the docs also!
Other than those very minor tweaks this is ready to go - thank you :-)
|
Found the leak diff --git a/backend/yandex/yandex.go b/backend/yandex/yandex.go
index 73767a107..f237d6834 100644
--- a/backend/yandex/yandex.go
+++ b/backend/yandex/yandex.go
@@ -979,6 +979,7 @@ func (o *Object) setCustomProperty(property string, value string) (err error) {
Method: "PATCH",
Path: "/resources",
Parameters: url.Values{},
+ NoResponse: true,
}
opts.Parameters.Set("path", o.filePath())That is what is probably a mis-feature in the rest library // CallJSON runs Call and decodes the body as a JSON object into response (if not nil)
//
// If request is not nil then it will be JSON encoded as the body of the request
//
// If response is not nil then the response will be JSON decoded into
// it and resp.Body will be closed.
//
// If response is nil then the resp.Body will be closed only if
// opts.NoResponse is set.So if response is |
Get rid of the api client and use rest/pacer for all API calls Add Copy, Move, DirMove, PublicLink, About optional interfaces Improve general error handling Remove ListR for now due to inconsitent behaviour fixes rclone#2586, progress on rclone#2740 and rclone#2178
|
Second time I forgot about this. Thanks would've probably taken me quite some time to notice. It's fixed now. |
|
@buengese, thank you for improving compatibility with Yandex. |
|
Thank looks great now - thank you very much :-) I'll merge it now. Check out https://pub.rclone.org/integration-tests/current/ to see how the integration tests fared tomorrow morning! |

This is a very WIP version of my Yandex rewrite. This aims to fix #2586 and make Yandex more maintainable by rewriting it using rclone rest implementation. The optional interfaces asked for in #2586 are not yet implemented however I will do so in the next days. The basic functionality should be working by now.
The main reason for opening the PR this early is that I definitely need help with testing this one.
Due to some weirdness with my ISP my connections to Yandex is absolutely abysmal and I cannot even run the integration tests without them constantly timing out or failing for other connection related reasons.Checklist