Skip to content

Files External: allow dynamic backend registration (cont'd) - #3548

Closed
Crazyphil wants to merge 10 commits into
owncloud:masterfrom
Crazyphil:master
Closed

Crazyphil wants to merge 10 commits into
owncloud:masterfrom
Crazyphil:master

Conversation

@Crazyphil

Copy link
Copy Markdown
Contributor

Original pull request: #2618, now with clean commits.

Also, the dependency messages are now notices instead of warnings and duplicate messages are filtered by comparing their first sentences.

…them

Moved dependency check to the individual backends instead of the config
…them

Moved dependency check to the individual backends instead of the config
Added check for backend's checkDependencies method to OC_Mount_Config::getBackends() when backend is configured to have some instead of blindly calling it and crashing
Added check for duplicate dependency check messages to display only the first
@karlitschek

Copy link
Copy Markdown
Contributor

@MTGap What do you think?

@MTGap

MTGap commented May 31, 2013

Copy link
Copy Markdown
Contributor

Amazon S3, Dropbox, and SWIFT also depend on cURL.

@Crazyphil

Copy link
Copy Markdown
Contributor Author

Done. Anything else?

@butonic

butonic commented Jun 3, 2013

Copy link
Copy Markdown
Contributor

tested with webdav and demo.owncloud.org, 👍

@MTGap

MTGap commented Jun 4, 2013

Copy link
Copy Markdown
Contributor

I actually wanted it to list all of the backends that aren't possible to mount if it's the same dependency. That's what I meant by the dependency shown only once. It might be best to rethink this so we can do this easily while considering translations.

What about checkDependencies only returns the name of the dependency, the message is pretty much the same afterwards anyways? Then it would be easier to match them up.

Also, the checkDependencies function should be at the end of the storage files, not at the beginning.

And does anyone know what dependencies SFTP has? Is it the same as FTP?

@Crazyphil

Copy link
Copy Markdown
Contributor Author

In my opinion, there are disadvantages either way: If you just return the name of the dependency, you lose the ability to show any backend-specific information (e.g. installation instructions) in the message, which basically means that you can't really check for any other than the already defined dependencies. On the other hand, if you return a full message, there is no easy way to merge these messages into a single one. If you just merge them for specific dependencies, there is again the possibility that two different backends depend on another module and you have duplicate messages all over again.

There has to be a tradeoff between flexibility and "beauty".

@jancborchardt

Copy link
Copy Markdown
Contributor

If we’re discussing a tradeoff, let’s go for the simple thing first, we can always refine. And I think that »simple« first thing is what you call »beauty« (combining the messages into one per dependecy, as @MTGap said).

@DeepDiver1975

Copy link
Copy Markdown
Contributor

And does anyone know what dependencies SFTP has? Is it the same as FTP?

sftp has dependencies to https://github.com/owncloud/core/tree/master/apps/files_external/3rdparty/phpseclib

@MTGap

MTGap commented Jun 11, 2013

Copy link
Copy Markdown
Contributor

@MTGap

MTGap commented Jun 11, 2013

Copy link
Copy Markdown
Contributor

@Crazyphil stuff to do before I want to merge it in:

  • Move checkDependencies to end of files
  • Move dependency notices below the configuration inputs, I think it looks better this way. What do you think?
  • Just keep it simple and show each notice individually, sorry! Unless you still want to improve it...

@Crazyphil

Copy link
Copy Markdown
Contributor Author

@MTGap: Unfortunately, I don't have much time for coding in the next few weeks (exams and stuff). If you finally want to get rid of this pull request, I could, however, do the things in your list so you can merge it before further changes to the app are made and have to be included again.

Moving the notices below the configuration has its advantages, because it doesn't distract from the configuration task. However, this might also cause administrators to skip the messages accidentially when they don't read further. Tricky...

Apart from that, I might have found a solution for the multiple messages that should also enhance translatability in comparison to the current solution: What if checkDependency would, as you suggested, return the name(s) of the missing dependencies and, optionally, a message to display. If a message is given, it is displayed as-is. If no message is given, all backends with the same missing dependency are included in a single system-defined message that reads

<b>Note:</b> $dependency is not enabled or installed. Mounting of $backend1, $backend2, ... and $backendN is not possible. Please ask your system administrator to install it.

checkDependency would therefore do something like

return array('cURL', 'foo' => 'Download foo at http://www.example.com/');

@MTGap

MTGap commented Jun 14, 2013

Copy link
Copy Markdown
Contributor

I like your idea for checkDependency.

There is no rush at this time, don't do anything until your exams are done.

Dependency messages now appear below the configuration options instead of above
Reworked dependency check method to support consolidated messages for multiple backends
@Crazyphil

Copy link
Copy Markdown
Contributor Author

@MTGap: All changes done. Any comments?
Also, I've messed up the merge with the master branch again. I seem to be unable to get Git to do what I want it to do... sorry for that.

@ghost

ghost commented Aug 2, 2013

Copy link
Copy Markdown

@MTGap

MTGap commented Aug 2, 2013

Copy link
Copy Markdown
Contributor

@Crazyphil You should follow this git tutorial: http://try.github.io/

I'm not sure how to fix this pull request at this moment. I also can't test it because of 3rdparty changes it seems.

@Crazyphil

Copy link
Copy Markdown
Contributor Author

I, too, have noticed while testing that the Google API fails when cURL is disabled, such that the settings page is not displayed anymore. I simply commented the Google backend registration and just tested the remaining backends. Obviously, this doesn't work if you want to test everything...

Thanks for the link!

@jancborchardt

Copy link
Copy Markdown
Contributor

Can someone take this over? @butonic can you check this out?

@butonic

butonic commented Dec 13, 2013

Copy link
Copy Markdown
Contributor

@Crazyphil care to rebase this? Will help, review and merge asap.

@Crazyphil

Copy link
Copy Markdown
Contributor Author

@butonic I'd try, even if it didn't work out the last two times.

@PVince81

Copy link
Copy Markdown
Contributor

Did something go wrong with the rebasing ? 777 files changes seem to be a bit big.

If this PR really changes that much, I'd suggest making incremental changes instead, splitting this into smaller PRs that are easier to review and test.

@jancborchardt

Copy link
Copy Markdown
Contributor

I’m closing this pull request for now because of inactivity and because it’s just too big.

@Crazyphil we can always reopen it though! :) Better would be to make small steps, as mentioned above. Several small pull requests are easier to review than one big one, which is in danger of not getting fully reviewed or accepted, as here.
If you need help with that, please join our developer mailing list and IRC channel #owncloud-dev.

@DeepDiver1975

Copy link
Copy Markdown
Contributor

@jancborchardt I'm reopening this because I'd love to see the funtionality to dynamically register file backends

@Crazyphil if you agree - I'll hijack your code and continue - any objections?

@PVince81 this it the pull request I've been talking about in #7897 (comment)

@karlitschek

Copy link
Copy Markdown
Contributor

agreed. This would be a very helpful thing to have

@ghost

ghost commented Apr 2, 2014

Copy link
Copy Markdown

@Crazyphil

Copy link
Copy Markdown
Contributor Author

@DeepDiver1975 No objections at all, I'm glad if my code helps in any way.
@PVince81 I didn't modify 777 files, but rebasing went wrong (again, there is another closed pull request for this with the same issue)

Unfortunately, I currently don't have time to fix that. Just ignore 0e848b1, c4d5688 and 48836f7 (the commits with "Merge ..." and you should get the changes that matter.

@DeepDiver1975

Copy link
Copy Markdown
Contributor

@Crazyphil thanks a lot! I'll take care

@DeepDiver1975

Copy link
Copy Markdown
Contributor

will continue to live here: #8032

@lock lock Bot locked as resolved and limited conversation to collaborators Aug 23, 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.

7 participants