-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Safe default behaviour when no users are specified on trashbin:cleanup #10041
Safe default behaviour when no users are specified on trashbin:cleanup #10041
Conversation
* Add option --all-users to explicitly clean all trashbins * Reject no users on commandline and no --all-users * Warn when --all-users and userids are specified Signed-off-by: Liam Dennehy <[email protected]>
} else { | ||
$output->writeln('Remove all deleted files'); | ||
} elseif ($input->getOption('all-users')) { | ||
$output->writeln('Remove deleted files for all users'); |
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.
Could you add following else
block to inform about the needed parameters:
} else {
throw new InvalidOptionException('Either specify a user_id or --all-users');
}
And don't forget to import the exception then as well:
use Symfony\Component\Console\Exception\InvalidOptionException;
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.
Done
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.
Looks good beside my little nitpick 👍
* throw on no parameters provided * throw on --all-users and userid provided Signed-off-by: Liam Dennehy <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #10041 +/- ##
=============================================
- Coverage 51.99% 31.71% -20.28%
- Complexity 26007 26010 +3
=============================================
Files 1661 1661
Lines 96132 96142 +10
Branches 1290 1290
=============================================
- Hits 49984 30494 -19490
- Misses 46148 65648 +19500
|
unit tests need to be adjusted |
Ref:
@liamdennehy If you need help, then reach out to us. Would be good to get this in today, as we have feature freeze today. |
Signed-off-by: Roeland Jago Douma <[email protected]>
I took the liberty of fixing the tests so we can merge it :) |
Failing tests are unrelated. |
Cool stuff @liamdennehy Feel free to keep joining IRC. |
Thanks @rullzer, I would have taken ages to figure out how to create those tests! |
Make trashbin:cleanup clean all users an explicit option not the default #10001
Signed-off-by: Liam Dennehy [email protected]