Repository navigation
Cleanup ext storage CRUD code, introduce storage config id - #11884
Conversation
There was a problem hiding this comment.
Can you please kill the usage of classpath here? we should really rely on the class loader - THX
There was a problem hiding this comment.
Maybe another time, I need to focus on the essential 😄
using an 'id' is key to build up any future api - we need to introduce this everywhere ... some day .. |
|
@DeepDiver1975 don't bother reviewing this. I won't continue working on this until a proper storage id is introduced. |
no worries - I'm already done 🙈 |
|
Not possible until we have the storage id: #12793 Unless I simply remove every route I added. What you need is probably just the container ? |
ok - thx - I'll add my controller and related pieces to my pr - we need to sync your code later then. |
There was a problem hiding this comment.
You can do the automatic DI for that nowadays. – Either take a look at our docs (it's somewhere documented there) or ping me in IRC ;-)
There was a problem hiding this comment.
=> We can even get rid of that file
There was a problem hiding this comment.
Ah yes, automatic DI. I completely forgot that (spent too much time away from the app framework lately...)
|
@DeepDiver1975 some app framework pieces are available on master, in case you're still interested. I'll continue this PR with the focus on mountpoint management (add/update/delete) based on the new storage_id setting that was introduced in 8.0. This would be to fix: #14058 (prerequisite for storage options) |
5b99ab4 to
4ca8fc5
Compare
|
Just done a major cleanup of the JS side part. Tasks
Unit tests
Regression TestingSystem mount
Personal mount
|
|
It's already looking good 😄 |
There was a problem hiding this comment.
@LukasReschke @DeepDiver1975 @icewind1991 do you think we should use separate endpoints for "system-wide" mounts and "personal" mounts ?
There was a problem hiding this comment.
I'd be in favour of that if it does not lead to too much duplication as we then can do the security checks via annotations and don't have to do those ugly "is user is admin then this otherwise that" stuff :)
|
BAD NEWS: due to the flexibility we offered before like putting value like "/somedir/$user/" in config fields, this would cause a single config entry to produce multiple entries in the "oc_storages" table. It looks like we'll need to introduce yet another id, call it "external_storage_config_id" (or shorter) which would match every entry visible in the config in the admin pageWeb UI. |
|
In principle this also means that we need a 1-N mapping table that maps "external_storage_config_id" to "oc_storages.numeric_id". Without this we cannot reliably delete the matching "oc_storages" entries on deletion in such situations where the "$user" field is used (#11544) |
|
and as long as we don't have "mount.json" in the database, we cannot reliably generate incremental "external_storage_config_id" because concurrency could make it generate twice the same. Unless "external_storage_config_id" is a hash of the config... ARGHH I'll leave this task aside for now until I find new ideas that does not involve moving mount.json to the database (which is a big task, especially regarding the migration + import scripts) |
8103da2 to
4d5bd1e
Compare
|
Well status checking is now mostly implemented. I'm still bringing over changes from #13515, like the async ability. It current lies a bit about the storage status, since when creating the storage there is no ID available and the storage status cannot be determined. But when IDs are implemented that will clear itself up. Also, we now have the structure available for multiple error types. So after the troubles of this PR are sorted out (I'm in favour of moving |
|
Thanks a lot @Xenopathic. I think I wasn't done completely with the case "has no idea yet at creation time" because that's where I bumped into the issue on how to generate the storage_id, and that's when I realized that it wasn't unique/consistent... so for that part we need to sort out what to do. For now I suggest to ignore concurrency and either use max(id) + 1 based on the existing config, or use a config based hash as a string id (like we kind of had before to detect how to group configs). This would be the temp solution until we can move to the DB. |
|
@PVince81 only problem with using a hash of the config as the config ID is that the hash will change any time the config changes, so there is no point to the 'update' action. Given that we don't want to move completely to the database just yet, my vote goes for the max(id) + 1 option. |
|
Ok, thanks for your input 😄 The problem with moving with the DB is that it will take a lot of coding, but also will require migration + import script (to import mount.json into the DB), which is quite a big task. |
|
I split the controller and service into two set of classes, one for global storages and one for user storages (aka personal mounts). Personal mount part is still broken at the moment, will look into that next. |
|
What about the Now accessing |
|
I can add an index route but it won't be used by anything yet, until we port the UI too (hopefully in a future PR) |
Then let's not add them for now :) |
Fix various PHPDoc issues in external storage app. Added missing NoAdminRequired tag
|
Fixed the PHPdoc and added the missing NoAdminRequired tag |
|
@owncloud-bot retest this please |
|
Refer to this link for build results (access rights to CI server needed): |
|
Looks good, basic testing works fine 👍 |
|
Needs a second reviewer @Xenopathic @DeepDiver1975 @LukasReschke |
|
A new inspection was created. |
|
Eek, I forgot to pull across async status checking from #13515. That last commit implements that - very simple, the framework was already there. Please review @icewind1991 ? Thanks |
|
Refer to this link for build results (access rights to CI server needed): Build result: FAILURE[...truncated 14 lines...] > git config remote.origin.url https://github.com/owncloud/core.git # timeout=10 > git config --add remote.origin.fetch +refs/heads/:refs/remotes/origin/ # timeout=10 > git config remote.origin.url https://github.com/owncloud/core.git # timeout=10Fetching upstream changes from https://github.com/owncloud/core.gitusing GIT_SSH to set credentials using .gitcredentials to set credentials > git config --local credential.helper store --file=/tmp/git190121534847429875.credentials # timeout=10 > git -c core.askpass=true fetch --tags --progress https://github.com/owncloud/core.git +refs/pull/:refs/remotes/origin/pr/ > git config --local --remove-section credential # timeout=10 > git rev-parse refs/remotes/origin/pr/11884/merge^{commit} # timeout=10 > git rev-parse refs/remotes/origin/origin/pr/11884/merge^{commit} # timeout=10Checking out Revision a08e23a083d05b37a96763d062bb8711f4889a36 (refs/remotes/origin/pr/11884/merge) > git config core.sparsecheckout # timeout=10 > git checkout -f a08e23a083d05b37a96763d062bb8711f4889a36 > git rev-list ee6a3217a047f08d3766d927c20b61fab1f3ee37 # timeout=10First time build. Skipping changelog. > git remote # timeout=10 > git submodule init # timeout=10 > git submodule sync # timeout=10 > git config --get remote.origin.url # timeout=10 > git submodule update --init --recursiveTriggering pull-request-analyser-ng-simple » SLAVEpull-request-analyser-ng-simple » SLAVE completed with result FAILURESetting status of c37913b to FAILURE with url https://ci.owncloud.org/job/pull-request-analyser-ng-simple/10656/ and message: Merged build finished.Test FAILed. |
|
Tested @Xenopathic's async check, works. This 👍 counts for the commit c37913b Will raise a Jenkins PR... |
|
Likewise, I've tested (and developed on) the rest of this PR done by @PVince81, so 👍 from me. I'd suggest one more independent reviewer though. @icewind1991 already reviewed all but that last commit, so all we really need is one final review... |
|
It'd be great to get #13641 merged at the same time, so that we get full support for downed storages. |
|
👍 for the async check |
Cleanup ext storage CRUD code, introduce storage config id
|
Thanks a lot guys. |
|
Now starts the process of rebasing every other PR that so much as looks at files_external code 😆 |
Tried to make the external storage app code more meaningful.
But I hit against hard blocks like this: https://github.com/owncloud/core/blob/master/apps/files_external/js/settings.js#L136
Calling "removeMountPoint.php" for EVERY user ?
Also the lack of "id" makes it impossible to continue.
Will try and introduce a proper id in a separate PR first...