Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Mailer] Extract transport factory and allow create custom transports#31946
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
src/Symfony/Component/Mailer/Transport/AbstractTransportFactory.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
…rom Component to Contracts (Koc)This PR was merged into the 4.4 branch.Discussion----------[Mailer] Changed EventDispatcherInterface dependency from Component to Contracts| Q | A| ------------- | ---| Branch? | 4.4| Bug fix? | no| New feature? | no| BC breaks? | yes| Deprecations? | no| Tests pass? | almost yes, see#31956 (comment)| Fixed tickets | -| License | MIT| Doc PR | -Follow up of#31946 (comment) . I hope this kind of changes are allowed for experimental components.BTW,@nicolas-grekas , why Psr14 interface is optional for Contract's `EventDispatcherInterfacehttps://github.com/symfony/symfony/blob/4.4/src/Symfony/Contracts/EventDispatcher/EventDispatcherInterface.php#L16 ?Commits-------bdb6217 Changed EventDispatcherInterface dependency from Component to Contracts
816f403 to9af7d94CompareUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
fabpot left a comment
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 promising. Can you finish the PR? We should probably remove the current way or at least deprecate it.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Koc commentedJun 30, 2019
@fabpot I've fixed comments from code review. Now working on adding tests (I've updated TODO list in PR header) |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Taluu left a comment
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.
Awesome. 👍
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Koc commentedJul 7, 2019
I've fixed tests and removed BC-breaks, so bc-break label non-actual anymore. More tests for all factories should be added, but I need 1 week more due to vacation. BTW PR is ready for another round of review. |
fabpot left a comment
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 to me. Thanks for the hard work so far!
src/Symfony/Component/Mailer/Transport/Smtp/EsmtpTransportFactory.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
29d9a30 to5029ed6CompareUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
fabpot commentedJul 15, 2019
Not sure if this PR is ready now but fabbot has an interesting patch to apply. |
Koc commentedJul 15, 2019
Almost ready. Failure caused because#32553 not merged yet. |
fabpot commentedJul 16, 2019
Koc commentedJul 16, 2019
Finally PR is ready 🎉 Travis is green except |
fabpot commentedJul 17, 2019
Thank you@Koc. |
…stom transports (Koc)This PR was merged into the 4.4 branch.Discussion----------[Mailer] Extract transport factory and allow create custom transports| Q | A| ------------- | ---| Branch? | 4.4| Bug fix? | no| New feature? | yes| BC breaks? | no| Deprecations? | no| Tests pass? | yes, failure unrelated (master hasn't this PR)| Fixed tickets |#31385,#32523| License | MIT| Doc PR | TBDAlternative approach to allow create custom transports and register DSN for it. Replaces#31931,#31935 . Similar to already existent TansportFactory from Messenger.TODO: - [x] Update changelog - [x] Add more tests for factories - [x] Add test for configuration + DI extensionCommits-------5b9cded Add transport factories (closes#31385,closes#32523)
| } | ||
| $user =urldecode($parsedDsn['user'] ??null); | ||
| $password =urldecode($parsedDsn['pass'] ??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.
this is broken. It is passingnull tourldecode, and it won't getnull as$user then.
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.
see2887724
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.
But it already covered with testhttps://github.com/symfony/symfony/pull/31946/files#diff-e3a1e78245b60fed36ed6ab4e56023ceR48 . Strange. Maybe becauseassertEquals compares'' equal tonull
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.
@KocassertEquals() does not make a strict comparison unlikeassertSame(). It is therefore recommended to useassertSame() (orassertNull() to check the null value).
…es (Koc)This PR was squashed before being merged into the 4.4 branch (closes#32609).Discussion----------[Mailer][DX][RFC] Rename mailer bridge transport classes| Q | A| ------------- | ---| Branch? | 4.4| Bug fix? | yno| New feature? | no| BC breaks? | yes| Deprecations? | no| Tests pass? | yes| Fixed tickets | -| License | MIT| Doc PR | -During working on#31946 I realized how painful to work with multiple classes which has same name. [Nice article](https://www.tomasvotruba.cz/blog/2019/05/02/alias-as-a-code-smell/) by@TomasVotruba with explanation of problems with such approach.~Built on top of#32608 , so only [2nd commit](bbf7e99) is actual.~Also I've changed namespaces to make bridge structure much simpler and be linear. All classes located on same level now. See how [bridge](https://github.com/symfony/symfony/tree/bbf7e99e89c70fab372929827ae509b41280ce40/src/Symfony/Component/Mailer/Bridge/Amazon) looks like now.Now in RFC state to get approve for such king of changes and update all other bridges.Commits-------eda4f01 [Mailer][DX][RFC] Rename mailer bridge transport classes
This PR was submitted for the 4.4 branch but it was squashed and merged into the 5.4 branch instead.Discussion----------[Mailer] Add custom transport factoriesThis might be useful for very custom use cases where we need to extract some data or do something before being able to create the actual transport.The feature apparently was added here:symfony/symfony#31946Commits-------72b69c1 [Mailer] Add custom transport factories
Uh oh!
There was an error while loading.Please reload this page.
Alternative approach to allow create custom transports and register DSN for it. Replaces#31931,#31935 . Similar to already existent TansportFactory from Messenger.
TODO: