From 54536a17819c725d467973f0b3c8e79a0fa8546a Mon Sep 17 00:00:00 2001 From: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Date: Tue, 11 Aug 2026 03:51:43 -0700 Subject: [PATCH 1/3] fix: clarify trashbin expiration CLI help Fixes #45418 --- .../lib/Command/ExpireTrash.php | 5 +++-- .../tests/Command/ExpireTrashTest.php | 22 +++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/apps/files_trashbin/lib/Command/ExpireTrash.php b/apps/files_trashbin/lib/Command/ExpireTrash.php index 1dc7bfc06893d..8fa4b5a23656d 100644 --- a/apps/files_trashbin/lib/Command/ExpireTrash.php +++ b/apps/files_trashbin/lib/Command/ExpireTrash.php @@ -37,11 +37,12 @@ protected function configure(): void { parent::configure(); $this ->setName('trashbin:expire') - ->setDescription('Expires the users trashbin') + ->setDescription('Delete eligible trashbin entries according to the configured retention and space policy') + ->setHelp('Processes deleted files according to the configured trashbin retention and space policy. This does not disable the trashbin or unconditionally empty it.') ->addArgument( 'user_id', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, - 'expires the trashbin of the given user(s), if no user is given the trash for all users will be expired' + 'Limit processing to the given user ID(s); if no user ID is given, all users are processed' ); } diff --git a/apps/files_trashbin/tests/Command/ExpireTrashTest.php b/apps/files_trashbin/tests/Command/ExpireTrashTest.php index 6318be2450496..295a6d991f83f 100644 --- a/apps/files_trashbin/tests/Command/ExpireTrashTest.php +++ b/apps/files_trashbin/tests/Command/ExpireTrashTest.php @@ -67,6 +67,28 @@ protected function tearDown(): void { parent::tearDown(); } + public function testCommandMetadata(): void { + $command = new ExpireTrash( + Server::get(IUserManager::class), + $this->expiration, + Server::get(SetupManager::class), + Server::get(IRootFolder::class), + ); + + $this->assertSame( + 'Delete eligible trashbin entries according to the configured retention and space policy', + $command->getDescription(), + ); + $this->assertSame( + 'Processes deleted files according to the configured trashbin retention and space policy. This does not disable the trashbin or unconditionally empty it.', + $command->getHelp(), + ); + $this->assertSame( + 'Limit processing to the given user ID(s); if no user ID is given, all users are processed', + $command->getDefinition()->getArgument('user_id')->getDescription(), + ); + } + #[DataProvider(methodName: 'retentionObligationProvider')] public function testRetentionObligation(string $obligation, string $quota, int $elapsed, int $fileSize, bool $shouldExpire): void { $this->config->setSystemValues(['trashbin_retention_obligation' => $obligation]); From a170ee6912dc5b4ae80a56d62df592fd05c266fd Mon Sep 17 00:00:00 2001 From: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Date: Tue, 11 Aug 2026 21:50:12 -0700 Subject: [PATCH 2/3] fix: reword trashbin:expire help and drop the metadata assertion test Per review: "Processes deleted files" was confusing since the command deletes expired files rather than processing them. Description and help now say so directly, and the test that pinned the exact wording is removed. --- .../lib/Command/ExpireTrash.php | 4 ++-- .../tests/Command/ExpireTrashTest.php | 22 ------------------- 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/apps/files_trashbin/lib/Command/ExpireTrash.php b/apps/files_trashbin/lib/Command/ExpireTrash.php index 8fa4b5a23656d..348e6e55d5964 100644 --- a/apps/files_trashbin/lib/Command/ExpireTrash.php +++ b/apps/files_trashbin/lib/Command/ExpireTrash.php @@ -37,8 +37,8 @@ protected function configure(): void { parent::configure(); $this ->setName('trashbin:expire') - ->setDescription('Delete eligible trashbin entries according to the configured retention and space policy') - ->setHelp('Processes deleted files according to the configured trashbin retention and space policy. This does not disable the trashbin or unconditionally empty it.') + ->setDescription('Delete expired files from the trashbin') + ->setHelp('Deletes expired files from the trashbin according to the configured retention and space policy. This does not disable the trashbin or unconditionally empty it.') ->addArgument( 'user_id', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, diff --git a/apps/files_trashbin/tests/Command/ExpireTrashTest.php b/apps/files_trashbin/tests/Command/ExpireTrashTest.php index 295a6d991f83f..6318be2450496 100644 --- a/apps/files_trashbin/tests/Command/ExpireTrashTest.php +++ b/apps/files_trashbin/tests/Command/ExpireTrashTest.php @@ -67,28 +67,6 @@ protected function tearDown(): void { parent::tearDown(); } - public function testCommandMetadata(): void { - $command = new ExpireTrash( - Server::get(IUserManager::class), - $this->expiration, - Server::get(SetupManager::class), - Server::get(IRootFolder::class), - ); - - $this->assertSame( - 'Delete eligible trashbin entries according to the configured retention and space policy', - $command->getDescription(), - ); - $this->assertSame( - 'Processes deleted files according to the configured trashbin retention and space policy. This does not disable the trashbin or unconditionally empty it.', - $command->getHelp(), - ); - $this->assertSame( - 'Limit processing to the given user ID(s); if no user ID is given, all users are processed', - $command->getDefinition()->getArgument('user_id')->getDescription(), - ); - } - #[DataProvider(methodName: 'retentionObligationProvider')] public function testRetentionObligation(string $obligation, string $quota, int $elapsed, int $fileSize, bool $shouldExpire): void { $this->config->setSystemValues(['trashbin_retention_obligation' => $obligation]); From d378c14eb14d1ab1ca3b8226ca3629d41fd45aa0 Mon Sep 17 00:00:00 2001 From: Matt Van Horn Date: Thu, 20 Aug 2026 07:23:02 -0700 Subject: [PATCH 3/3] fix(trashbin): drop the negative clause from expire help Per @come-nc: the help should describe what the command does, not enumerate what it does not do. --- apps/files_trashbin/lib/Command/ExpireTrash.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/files_trashbin/lib/Command/ExpireTrash.php b/apps/files_trashbin/lib/Command/ExpireTrash.php index 348e6e55d5964..d905d623d3154 100644 --- a/apps/files_trashbin/lib/Command/ExpireTrash.php +++ b/apps/files_trashbin/lib/Command/ExpireTrash.php @@ -38,7 +38,7 @@ protected function configure(): void { $this ->setName('trashbin:expire') ->setDescription('Delete expired files from the trashbin') - ->setHelp('Deletes expired files from the trashbin according to the configured retention and space policy. This does not disable the trashbin or unconditionally empty it.') + ->setHelp('Deletes expired files from the trashbin according to the configured retention and space policy.') ->addArgument( 'user_id', InputArgument::OPTIONAL | InputArgument::IS_ARRAY,