-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Messenger] Add --class-filter
option to the messenger:failed:remove
command
#59978
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
[Messenger] Add --class-filter
option to the messenger:failed:remove
command
#59978
Conversation
15bd310
to
8557685
Compare
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 👍
class-filter sounds to much technical to me. What about message-filter ? |
src/Symfony/Component/Messenger/Command/FailedMessagesRemoveCommand.php
Outdated
Show resolved
Hide resolved
@OskarStark |
be6573e
to
fae8ce5
Compare
throw new RuntimeException('No failed messages were found with this filter.'); | ||
} | ||
|
||
if (!$io->confirm(\sprintf('There is %d message%s to remove. Do you want to continue?', $idsCount, $idsCount > 1 ? 's' : ''))) { |
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.
To avoid using is
or are
depending on the number of messages, let's rewrite it to something like:
if (!$io->confirm(\sprintf('There is %d message%s to remove. Do you want to continue?', $idsCount, $idsCount > 1 ? 's' : ''))) { | |
if (!$io->confirm(\sprintf('Can you confirm you want to remove %d message%s?', $idsCount, 1 === $idsCount ? '' : 's'))) { |
fae8ce5
to
1924719
Compare
Thank you @arnaud-deabreu. |
This PR was merged into the 7.3 branch. Discussion ---------- [Messenger] fix test | Q | A | ------------- | --- | Branch? | 7.3 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | related to #59978 (comment) | License | MIT Commits ------- 0ec778b fix test
…ger:failed:remove` command (arnaud-deabreu) This PR was squashed before being merged into the 7.3 branch. Discussion ---------- [Messenger] Add `--class-filter` option to the `messenger:failed:remove` command | Q | A | ------------- | --- | Feature PR | symfony/symfony#59978 | PR author(s) | `@arnaud`-deabreu | Merged in | 7.3 | Doc issue | Fix #20805 The `--class-filter` was added in the `messenger:failed:remove` command in this [PR](symfony/symfony#59978). As the option already exists in the `messenger:failed:show` I'm wondering if only adding this example could be enough ? Commits ------- bdca4e9 [Messenger] Add `--class-filter` option to the `messenger:failed:remove` command
This PR adds the
--class-filter
to themessenger:failed:remove
command which is already available onmessenger:failed:show
command.It will yield the message ids that match the given class and use it as if it were passed as the
id
argument in the command so the--force
and--show-messages
can work with this filter.When using the filter, the command will prompt for confirmation before removing the messages.
Example output: