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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate custom JS external storage backends to new registration API [part 2] #18440

Merged
merged 4 commits into from
Aug 25, 2015

Conversation

RobinMcCorkell
Copy link
Member

This PR migrates the following external storage backends:

  • Amazon S3 (this should have been in the first PR, it's actually a simple migration)
  • Dropbox
  • Google

The JS changes are to enable cleaner custom JS that can respond better to events.

Please review @PVince81 @DeepDiver1975 @MorrisJobke @icewind1991

cc @jmaciasportela for an example of how registration works. These are quite simple, more advanced ones to come.

Replaces #18245

@PVince81
Copy link
Contributor

Tested all three backends: updating from 8.1 and creating from scratch.

  • BUG: Minor issue: the order of the fields for S3 have changed.
  • BUG: cannot mount Dropbox as personal mount, it works fine on stable8.1
{"reqId":"TCyCjUAYQeSq1ZkdL1T8","remoteAddr":"127.0.0.1","app":"files_external","message":"Exception: {\"Exception\":\"Exception\",\"Message\":\"Creating \\\\OC\\\\Files\\\\Storage\\\\Dropbox storage failed\",\"Code\":0,\"Trace\":\"
#0 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/apps\\\/files_external\\\/lib\\\/config.php(255): OC\\\\Files\\\\Storage\\\\Dropbox->__construct(Array)\\n
#1 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/apps\\\/files_external\\\/controller\\\/storagescontroller.php(201): OC_Mount_Config::getBackendStatus('\\\\\\\\OC\\\\\\\\Files\\\\\\\\Stora...', Array, false)\\n
#2 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/apps\\\/files_external\\\/controller\\\/userstoragescontroller.php(144): OCA\\\\Files_External\\\\Controller\\\\StoragesController->updateStorageStatus(Object(OCA\\\\Files_external\\\\Lib\\\\StorageConfig))\\n
#3 [internal function]: OCA\\\\Files_External\\\\Controller\\\\UserStoragesController->create('dropbox', 'dropbox', 'oauth1::oauth1', Array, NULL)\\n
#4 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/appframework\\\/http\\\/dispatcher.php(159): call_user_func_array(Array, Array)\\n
#5 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/appframework\\\/http\\\/dispatcher.php(89): OC\\\\AppFramework\\\\Http\\\\Dispatcher->executeController(Object(OCA\\\\Files_External\\\\Controller\\\\UserStoragesController), 'create')\\n
#6 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/appframework\\\/app.php(108): OC\\\\AppFramework\\\\Http\\\\Dispatcher->dispatch(Object(OCA\\\\Files_External\\\\Controller\\\\UserStoragesController), 'create')\\n
#7 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/appframework\\\/routing\\\/routeactionhandler.php(45): OC\\\\AppFramework\\\\App::main('UserStoragesCon...', 'create', Object(OC\\\\AppFramework\\\\DependencyInjection\\\\DIContainer), Array)\\n
#8 [internal function]: OC\\\\AppFramework\\\\routing\\\\RouteActionHandler->__invoke(Array)\\n
#9 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/route\\\/router.php(280): call_user_func(Object(OC\\\\AppFramework\\\\routing\\\\RouteActionHandler), Array)\\n
#10 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/base.php(879): OC\\\\Route\\\\Router->match('\\\/apps\\\/files_ext...')\\n
#11 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/index.php(40): OC::handleRequest()\\n
#12 {main}\",\"File\":\"\\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/apps\\\/files_external\\\/lib\\\/dropbox.php\",\"Line\":59}","level":4,"time":"2015-08-20T09:54:38+00:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files_external\/userstorages"}
{"reqId":"zOCpZqbHIQDvqtXuUFI7","remoteAddr":"127.0.0.1","app":"files_external","message":"Exception: {\"Exception\":\"Exception\",\"Message\":\"Creating \\\\OC\\\\Files\\\\Storage\\\\Dropbox storage failed\",\"Code\":0,\"Trace\":\"
#0 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/apps\\\/files_external\\\/lib\\\/config.php(255): OC\\\\Files\\\\Storage\\\\Dropbox->__construct(Array)\\n
#1 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/apps\\\/files_external\\\/controller\\\/storagescontroller.php(201): OC_Mount_Config::getBackendStatus('\\\\\\\\OC\\\\\\\\Files\\\\\\\\Stora...', Array, false)\\n
#2 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/apps\\\/files_external\\\/controller\\\/storagescontroller.php(221): OCA\\\\Files_External\\\\Controller\\\\StoragesController->updateStorageStatus(Object(OCA\\\\Files_external\\\\Lib\\\\StorageConfig))\\n
#3 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/apps\\\/files_external\\\/controller\\\/userstoragescontroller.php(104): OCA\\\\Files_External\\\\Controller\\\\StoragesController->show('1')\\n
#4 [internal function]: OCA\\\\Files_External\\\\Controller\\\\UserStoragesController->show('1')\\n
#5 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/appframework\\\/http\\\/dispatcher.php(159): call_user_func_array(Array, Array)\\n
#6 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/appframework\\\/http\\\/dispatcher.php(89): OC\\\\AppFramework\\\\Http\\\\Dispatcher->executeController(Object(OCA\\\\Files_External\\\\Controller\\\\UserStoragesController), 'show')\\n
#7 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/appframework\\\/app.php(108): OC\\\\AppFramework\\\\Http\\\\Dispatcher->dispatch(Object(OCA\\\\Files_External\\\\Controller\\\\UserStoragesController), 'show')\\n
#8 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/appframework\\\/routing\\\/routeactionhandler.php(45): OC\\\\AppFramework\\\\App::main('UserStoragesCon...', 'show', Object(OC\\\\AppFramework\\\\DependencyInjection\\\\DIContainer), Array)\\n
#9 [internal function]: OC\\\\AppFramework\\\\routing\\\\RouteActionHandler->__invoke(Array)\\n
#10 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/route\\\/router.php(280): call_user_func(Object(OC\\\\AppFramework\\\\routing\\\\RouteActionHandler), Array)\\n
#11 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/base.php(879): OC\\\\Route\\\\Router->match('\\\/apps\\\/files_ext...')\\n
#12 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/index.php(40): OC::handleRequest()\\n
#13 {main}\",\"File\":\"\\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/apps\\\/files_external\\\/lib\\\/dropbox.php\",\"Line\":59}","level":4,"time":"2015-08-20T09:54:41+00:00","method":"GET","url":"\/owncloud\/index.php\/apps\/files_external\/userstorages\/1"}

@RobinMcCorkell
Copy link
Member Author

Dropbox issue fixed, it was a minor JS problem.

As for the Amazon S3 'issue', is rearranging the fields that much of an issue? It allows us to keep all authentication parameters at the end of the config list.

@PVince81
Copy link
Contributor

As for the Amazon S3 'issue', is rearranging the fields that much of an issue? It allows us to keep all authentication parameters at the end of the config list.

Hmmm I see. So auth fields must always be at the end ?
Shouldn't be too problematic.

@PVince81
Copy link
Contributor

👍 Dropbox as personal ext storage works now

@PVince81
Copy link
Contributor

Failing SMB test ? Probably needs the other fix, rebase onto master ?

@scrutinizer-notifier
Copy link

A new inspection was created.

@RobinMcCorkell
Copy link
Member Author

Rebased. Hopefully all tests will be green now

@ghost
Copy link

ghost commented Aug 25, 2015

🚀 Test PASSed.🚀
chuck

@PVince81
Copy link
Contributor

Still 👍

@MorrisJobke
Copy link
Contributor

Looks good and works (Dropbox tested) 👍

MorrisJobke added a commit that referenced this pull request Aug 25, 2015
Migrate custom JS external storage backends to new registration API [part 2]
@MorrisJobke MorrisJobke merged commit 494c1d7 into master Aug 25, 2015
@MorrisJobke MorrisJobke deleted the ext-backends.customjs branch August 25, 2015 09:52
@MorrisJobke MorrisJobke added this to the 8.2-current milestone Aug 25, 2015
@lock lock bot locked as resolved and limited conversation to collaborators Aug 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants