Skip to content
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

Introduce client specific events #284

Merged
merged 11 commits into from
Dec 29, 2019
Merged

Conversation

rpkamp
Copy link
Contributor

@rpkamp rpkamp commented Dec 7, 2019

Q A
Bug fix no
New feature yes
BC breaks no
Deprecations yes
Tests pass yes
Fixed tickets #283
License MIT

There will be a lot of tests added to this class over the following
commits, and it would benefit the readability of the class as a whole if
it is cleaned up a bit.
Instead of listening to all pre transaction events and
filtering for a desired service name, clients can not also listen for
events from specific clients.
Instead of listening to all post transaction events and
filtering for a desired service name, clients can not also listen for
events from specific clients.
That we way we get BC support in the EventDisptachMiddleware for free
@rpkamp rpkamp changed the title Client specific events Introduce client specific events Dec 7, 2019
@gregurco gregurco self-requested a review December 8, 2019 17:50
@gregurco
Copy link
Member

gregurco commented Dec 8, 2019

Hello @rpkamp

First, thanks for PR :) but, let's do some small changes. You mixed here deprecations and new way of events, but in master we accumulate changes just for v8. These changes will not enter in v7. I propose to create 2 PRs:

  • first PR should be created from v7 branch (https://github.com/8p/EightPointsGuzzleBundle/tree/v7). In that PR only deprecation messaged will be added, to notify the user that events system will be changed in v8. After that commit I will create version v7.6.1.
  • secund PR is the current one, created on master. Here you can remove all deprecation, old interface and add just new code, as it will be in v8.

Is it ok for you?

Thanks, Vlad.

@rpkamp
Copy link
Contributor Author

rpkamp commented Dec 9, 2019

I think Symfony normally already adds the new way of doing something, while deprecating the old thing, and then remove the old thing in the new major. The nice thing about this is that you can already update the new thing in the current major and then for the new major you don't have to do anything anymore.

For this example this would mean that this PR goes against v7, and then in another PR the deprecations will be removed for v8. The advantage is that there is a clean upgrade path from v7 to v8. If we only deprecate in v7, then once you upgrade to v8 your code is temporarily broken until you fix it. If v7 already supports the new way you can get rid of deprecations there and know it will work in v8.

Up to you of course, just offering an alternative 🙂

@gregurco
Copy link
Member

@rpkamp I got your idea. If you want this PR to appear in v7, then change PR to be for v7 branch and not for master branch. All what we have on master will be released as v8.

@rpkamp rpkamp changed the base branch from master to v7 December 20, 2019 08:19
@rpkamp rpkamp changed the base branch from v7 to master December 20, 2019 08:19
@rpkamp
Copy link
Contributor Author

rpkamp commented Dec 20, 2019

@gregurco I've completely removed the CompilerPass from this PR, so it ready to be merged into master. Next I will create a PR against v7 with the same changes plus a deprecation of the old behaviour.

@rpkamp rpkamp mentioned this pull request Dec 20, 2019
@rpkamp
Copy link
Contributor Author

rpkamp commented Dec 28, 2019

All done @gregurco

Copy link
Member

@gregurco gregurco left a comment

Choose a reason for hiding this comment

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

Great 👍

@gregurco gregurco added this to the v8 milestone Dec 28, 2019
Copy link
Member

@florianpreusner florianpreusner left a comment

Choose a reason for hiding this comment

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

Very nice!

@gregurco gregurco merged commit d13fb73 into 8p:master Dec 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants