-
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
Trashbin skip list #38704
Trashbin skip list #38704
Conversation
originated from https://github.com/owncloud/files_backup/pull/39 |
Just a couple of things so far:
|
@jvillafanez what do you think about the current solution? |
bbe8685
to
8f3d681
Compare
8f3d681
to
ac42613
Compare
I still think it's better to move the checks to a dedicated class. We'll need to add unit tests, and it should be easy to add them in a dedicated class. It should also be easier to include an initialization phase to clean the config input and make the actual action easier to read. Also note that there could be filenames with "*" in the path (I don't think we're doing anything special), so there could be a "*abc" folder in the root. |
@jvillafanez No Thing, we can move it |
Note that we should include an option to skip the trashbin by filesize, which will probably be the main use case for this feature. Taking this into account, maybe having "trashbin.skip.extensions", "trashbin.skip.directories" and "trashbin.skip.sizes" as config options might be a better choice |
I think so. The code seems complex at first sight, probably because the PHP string functions aren't easy to handle, and it also has some edge cases we need to take care. I don't mind having the wildcard logic if it easy to follow though. |
@jvillafanez can you have a second look, this is not quite final, tests need to be added. |
For the config.sample file, I prefer to use the default values if any. If it isn't possible (the defaults in this case will likely be empty lists, which doesn't add any value), some sane defaults is a better choice, so it's easy to copy and paste them. You might also want to clarify whether there is a default value in use or not (mainly to clarify that 1GB files will still reach the trashbin by default, for example). You can add additional examples in the comments to clarify things.
|
@jvillafanez I updated the PR with some general improvements and your suggestions. Also added tests for the new class. I'm not a 100% sure about the ´config.sample´ yet. At least it should now be more clear how to use these config params. Thanks for your help here btw 👍 |
Warning messages seem harsh. I understand that we might want that message for the "skip directories" configuration as a deterrent, but the ones for the extension and file size... I expect the skip by file size to be widely used. |
TBD:
|
@janackermann @jvillafanez |
03f8709
to
9ed6442
Compare
I think those will be the last changes for me. |
For some strange reasons, already committed text suggestions for config.php got corrupted. EDIT: fixed |
04592bd
to
6a18869
Compare
08a5b95
to
481200a
Compare
aa58dce
to
5154722
Compare
This has been fixed by @janackermann, no changes in the file. |
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.
OK from the config.php POV
Code not tested
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.
Tiny detail, maybe for the next time.
5154722
to
76b8551
Compare
Kudos, SonarCloud Quality Gate passed! |
Description
With this change new config parameters has been introduced.
Admins can now decide, based on file extensions, directory names and size,
if a resource should not be observed by the trashbin and deleted immediately.
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: