Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Refactor] Unification of buses#12602

Merged
GSadee merged 8 commits into
Sylius:masterfrom
SirDomin:buses-unification
May 14, 2021
Merged

[Refactor] Unification of buses#12602
GSadee merged 8 commits into
Sylius:masterfrom
SirDomin:buses-unification

Conversation

@SirDomin
Copy link
Copy Markdown
Contributor

@SirDomin SirDomin commented May 5, 2021

Q A
Branch? master
Bug fix? no
New feature? no
BC breaks? no
Deprecations? yes
Related tickets
License MIT

@SirDomin SirDomin requested a review from a team as a code owner May 5, 2021 22:46
@probot-autolabeler probot-autolabeler Bot added API APIs related issues and PRs. Maintenance CI configurations, READMEs, releases, etc. labels May 5, 2021
Comment thread src/Sylius/Bundle/ApiBundle/Resources/config/app/config.yaml Outdated
Comment thread src/Sylius/Bundle/ApiBundle/Resources/config/app/config.yaml Outdated
Comment thread adr/2021_05_06_command_bus_unification.md Outdated
@SirDomin SirDomin force-pushed the buses-unification branch from 0403e07 to ac38028 Compare May 6, 2021 06:22
Copy link
Copy Markdown
Member

@GSadee GSadee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about changes in CoreBundle: https://github.com/Sylius/Sylius/blob/master/src/Sylius/Bundle/CoreBundle/Resources/config/app/messenger.yaml#L16:L18 ?

The sylius_default.bus is configured in Core as a default bus, but in ApiBundle it is marked as deprecated

Comment thread adr/2021_05_06_command_bus_unification.md Outdated
@stloyd
Copy link
Copy Markdown
Contributor

stloyd commented May 6, 2021

This still is broken when your existing application has own bus declared, see #12561.

Comment thread src/Sylius/Bundle/ApiBundle/Resources/config/app/config.yaml Outdated
@SirDomin SirDomin force-pushed the buses-unification branch 7 times, most recently from f9fd215 to 2cc8ced Compare May 10, 2021 13:47
@lchrusciel
Copy link
Copy Markdown
Contributor

Hey Joseph,

that would be awesome to have it fixed, but we need to declare default bus anyway, due to Symfony constraints. Your proposal has some solution for that, but if we would remove the default bus from the end-users app, it will throw an exception. Therefore, I think we will stay with the current solution, but I may propose docs about changing the default bus. Perhaps, we should wire up Api Platform usage to our busses as well, so the app will not collapse once one will change the default one.

@SirDomin SirDomin force-pushed the buses-unification branch from 2cc8ced to b0044ea Compare May 10, 2021 14:16
Comment thread src/Sylius/Bundle/ApiBundle/Resources/config/app/config.yaml
Comment thread config/services.yaml Outdated
Comment thread src/Sylius/Bundle/ApiBundle/Resources/config/app/config.yaml Outdated
sylius.command_bus: &command_bus
default_middleware: allow_no_handlers
sylius.event_bus: &event_bus
default_middleware: allow_no_handlers
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any issue with the following notation?

Suggested change
default_middleware: allow_no_handlers
middleware:
- 'allow_no_handlers'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, application crashes with middleware notation

Comment thread src/Sylius/Bundle/ApiBundle/Resources/config/app/config.yaml Outdated
Comment thread src/Sylius/Bundle/CoreBundle/Resources/config/app/config.yml Outdated
Comment thread src/Sylius/Bundle/ApiBundle/Resources/config/services.xml Outdated
Comment on lines +24 to +25
sylius_default.bus: *command_bus
sylius_event.bus: *event_bus
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if these aliases work properly, did you check that? It looks like new buses are creating here

@SirDomin SirDomin force-pushed the buses-unification branch 2 times, most recently from 2282a01 to c1d9a10 Compare May 12, 2021 08:04
Comment on lines -202 to -205
<service id="sylius.listener.api_authentication_success_listener" class="Sylius\Bundle\ApiBundle\EventListener\AuthenticationSuccessListener">
<argument type="service" id="api_platform.iri_converter" />
<tag name="kernel.event_listener" event="lexik_jwt_authentication.on_authentication_success" method="onAuthenticationSuccessResponse" />
</service>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove this listener?

@SirDomin SirDomin force-pushed the buses-unification branch 2 times, most recently from 722fb55 to 1943b9e Compare May 12, 2021 13:49
@SirDomin SirDomin force-pushed the buses-unification branch 3 times, most recently from afdd62b to c80e63a Compare May 13, 2021 08:51
Comment thread composer.json Outdated
"symfony/property-info": "4.4.22 || 5.2.7",
"symfony/serializer": "4.4.19 || 5.2.2"
"symfony/serializer": "4.4.19 || 5.2.2",
"symfony/security-core": "^5.2.6 || ^4.4.21"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be reverted

@SirDomin SirDomin force-pushed the buses-unification branch 2 times, most recently from 0eb8eca to 17be3c5 Compare May 13, 2021 18:22
@SirDomin SirDomin force-pushed the buses-unification branch from 17be3c5 to 19b7cb6 Compare May 13, 2021 18:26
@GSadee GSadee merged commit 2ea9298 into Sylius:master May 14, 2021
@GSadee
Copy link
Copy Markdown
Member

GSadee commented May 14, 2021

Thanks, @SirDomin! 🥇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API APIs related issues and PRs. Maintenance CI configurations, READMEs, releases, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants