-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Move files external to core #25422
Move files external to core #25422
Conversation
@PVince81, thanks for your PR! By analyzing the annotation information on this pull request, we identified @Xenopathic, @icewind1991 and @LukasReschke to be potential reviewers |
Fixed some tests. Looking good so far but there is more to go to have core being able to work without files_external enabled. |
|
|
|
Moved storage services classes to core, still WIP/incomplete. Not tested. |
Conflicting |
aee765f
to
815d018
Compare
Rebased, added more fixes for the tests etc. Seems to work so far, few tests will fail. I think we should also move the commands and the UI to core. |
I'd say the first main goal is to make external apps like "files_external_ftp" work even when files_external is disabled. Once this works, it's already a big step forward even if a lot of things still need to be moved like the UI and CLI commands. |
815d018
to
e3c278c
Compare
Some people disable files _external even though they have storages configured, to disable them.
|
|
e3c278c
to
4502170
Compare
Good news! It is now possible to run this FTP branch owncloud/files_external_ftp#9 with this PR here and have the "files_external" app disabled ! You'll still need to enable "files_external" first to configure the storage but then can disable it again. The storage will stay available. There is still a lot of work to do to make sure everything still works. And also review whether each class I picked for the public or private namespace makes sense. |
Weird, I don't get these locally... Maybe related to PHP version. |
Aha! Indeed I see these errors with PHP 7.0.11 |
|
|
|
@DeepDiver1975 @jvillafanez should we get rid of the ability to import old style "mount.json" using the "Import" command ? This would make it possible to clear a lot of legacy cruft and reduce testing overhead. The only use case I can think of is admins who provision their OC using mount.json files automatically and haven't taken the time to convert these configs to the new json export format. As for existing mount.json files inside the install, these should already be migrated to the DB format. |
Needs retesting:
|
=> no more legacy auth needed |
|
some performance concerns: after merging this every setupFS call will have to read the ext storage tables even if there is nothing there. So even people who don't use ext storage would get a perf decrease. Possible long-term solution here in the fstab discussion: #26190 |
Failure possibly due to array expectation order:
|
4a3ac48
to
1812d87
Compare
will fix #22641 |
Raised #26538 to handle missing backends more gracefully. |
e975083
to
ca7bf05
Compare
This is tricky... I tried enabling the WND app and making it work without any modifications to the app. And the WND app also provides some additional auth providers which need to be adjusted to use |
absolutly |
Tested updating from OC 8.0 with SFTP_Key, SMB_OC, Dropbox and others up to this branch, all worked fine. This means that getting rid of the legacy stuff did not break those, which is great news. |
b8fe1d9
to
9f66e45
Compare
What sound does it make when squashing 21 commits ? Not sure, but that's what I did here. Hopefully a single commit will make all the renames more apparent. |
Went through my test steps and it's looking good so far ! Apart from this little bug #25422 (comment) I think this could be merged. However once this is merge we should work on making it fail gracefully in case a third party ext storage app gets disabled during update, this would be handled through an approach like this: #26539 |
122a276
to
269f6f6
Compare
We should make the Backend class abstract with an abstract method "initializeBackend". Something like:
This way we can force the Backend class to not be instanciated (it doesn't make any sense), and also point out to the subclasses what is the method that they should implement. If the subclasses choose to redefine the constructor, they should call the parent constructor first (which is common practice anyway) |
@@ -42,7 +40,6 @@ public function __construct(IL10N $l, RSA $legacyAuth, SFTP $sftpBackend) { | |||
->setFlag(DefinitionParameter::FLAG_OPTIONAL), | |||
]) | |||
->addAuthScheme(AuthMechanism::SCHEME_PUBLICKEY) | |||
->setLegacyAuthMechanism($legacyAuth) | |||
->deprecateTo($sftpBackend) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not finding this method... 😕
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's in IdentifierTrait
While I agree with the base idea there are some issues:
@jvillafanez what do you think ? Is what I mentionned in 3) also what you hoped by making the init lazy ? |
For me it doesn't make any sense that we can create instances of the Backend class when we have specific implementations. That's the reason to make the Backend class abstract. I didn't think about lazy initialization... I completely agree we should go that way. The only we should take care is that we'll need to make this completely transparent to the implementations: if we consider that the subclasses must implement an "initBackend" method for example, checking if the backend is initialized or "deinitialize" the backend should be done transparently in the parent class. |
@jvillafanez ok, now I understand. I'm fine making the Backend class abstract. Not sure if |
I don't think it's worthy to initialize lazily the backend. Too much trouble for a small benefit in this case since most of the things the backend does are assigments. Let's just make the class abstract. |
Here, they're abstract now: e33028c Let's hope the tests still pass, if they do, merge ? @jvillafanez @DeepDiver1975 |
👍 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
For #18160
There's more to come.