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
[FrameworkBundle][Notifier] Allow to configure or disable the message bus to use #39353
base: 6.2
Are you sure you want to change the base?
Conversation
4e9a72c
to
d7f207a
Compare
Anything left todo here @jschaedl ? |
Hi @OskarStark |
Can you please rebase and see if it's still failing ? Thanks |
0952835
to
13a1266
Compare
@jschaedl can you please check the failing tests? Thanks |
fe8b2ac
to
2e8cd93
Compare
@OskarStark I rebased the branch. Tests are still failing on PHP 8.0 but this seems to be unrelated with my changes. |
The failures are related I believe. |
61acd5c
to
3e800b6
Compare
1667610
to
804185f
Compare
804185f
to
63a5546
Compare
Rebased and ready for another review :-) |
Ready to merge @nicolas-grekas ? |
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
Outdated
Show resolved
Hide resolved
Please rebase to get rid of Travis, thanks |
728afd7
to
616cdd6
Compare
@OskarStark Rebase done. |
if ($container->hasDefinition($serviceId)) { | ||
$container->getDefinition($serviceId) | ||
->setArgument(0, null) | ||
->replaceArgument(1, $messageBus ? new Reference($messageBus) : new Reference('messenger.default_bus', ContainerInterface::NULL_ON_INVALID_REFERENCE)) |
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.
$messageBus ? ...
can be removed because we are in the else
part.
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
Outdated
Show resolved
Hide resolved
Some tests are failing |
@@ -2390,6 +2390,24 @@ private function registerNotifierConfiguration(array $config, ContainerBuilder $ | |||
$container->removeDefinition('notifier.channel.email'); | |||
} | |||
|
|||
$servicesWithBusArgument = ['texter', 'chatter', 'notifier.channel.chat', 'notifier.channel.email', 'notifier.channel.sms']; | |||
if (false === $messageBus = $config['message_bus']) { |
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.
should we throw an exception if one tries to configure message_bus
while messenger is not installed/enabled?
@jschaedl Can you have a look at the failing tests? |
77db22d
to
95718bb
Compare
@jschaedl I've rebased on current 6.2 and fixed the tests. Can you review my commit before I merge? |
foreach ($servicesWithBusArgument as $serviceId) { | ||
if ($container->hasDefinition($serviceId)) { | ||
$container->getDefinition($serviceId) | ||
->setArgument(0, null) |
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.
I don't get why you are removing the transports here. We do need the transports in all cases.
For the mailer integration there is already a possibility to disable or configure the
message_bus
to use. See: #34633 and #34648This PR introduces a similar config option
notifier.message_bus
for the notifier integration.Things done:
notifier.message_bus
for the notifier configurationmessage_bus
config option