Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[DoctrineBridge] Allow to use a middleware instead of DbalLogger#45491
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
f3dc761 to4c4cd5aComparel-vo commentedFeb 20, 2022
status: needs work |
122ec76 to0281685Comparel-vo commentedFeb 20, 2022
status: needs review |
carsonbot commentedFeb 21, 2022
Hey! I think@lucasaba has recently worked with this code. Maybe they can help review this? Cheers! Carsonbot |
| { | ||
| $query =null; | ||
| if (1 === ++$this->nestingLevel) { | ||
| $this->debugDataHolder->addQuery($this->connectionName,$query =newQuery('"START TRANSACTION"')); |
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.
why the double quotes ? They are not part of the SQL query starting a transaction.
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.
same for COMMIT and ROLLBACK
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.
It's the format that is currently used in the profiler:https://github.com/doctrine/dbal/blob/2afc6f00e8ff145ab386e9d25af293db98418bf5/src/Connection.php#L1297; should I change it anyway ?
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Bridge/Doctrine/Tests/DataCollector/DoctrineDataCollectorTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
stof commentedFeb 24, 2022
@nicolas-grekas@fabpot given that this PR is about moving away from a deprecated DBAL API for the collector of the Symfony webprofiler, I suggest merging that into 5.4 rather than 6.1, so that the Symfony LTS does not use the deprecated API for years for the debug features. |
stof 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.
All classes in theSymfony\Bridge\Doctrine\Middleware\Debug namespace except for the middleware itself and the DebugDataHolder should be tagged@internal. The various decorators are not meant to be reused by other code than our middleware (the DebugDataHolder needs to be wired by DoctrineBundle, which is why it cannot be internal)
2eca244 tof660a87Comparel-vo commentedFeb 28, 2022
status: needs review |
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.
| publicfunctionstart():void | ||
| { | ||
| $this->start =microtime(true); |
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.
Doesn't this duplicate the logic from the stopwatch? How about using the duration from the stopwatch instead?
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.
Stopwatch is an optional dependency of Doctrine bridge. Not using the stopwatch here allows to have durations even when stopwatch is not installed.
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 find it kind of acceptable that timings are available only if the stopwatch is installed.
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.
The point is it's currently done in this way in DebugStack. So using stopwatch instead will lead to a loss of query durations occurring on a patch version (for an application without stopwatch). WDYT ?
Uh oh!
There was an error while loading.Please reload this page.
derrabus 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.
Wrong button… I'm getting old. 🙈
8aeaacc to8de3964Comparel-vo commentedMar 13, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
l-vo commentedMar 13, 2022
status: needs review |
derrabus commentedMar 22, 2022
If we don't do this already while merging up, please create that PR. |
Uh oh!
There was an error while loading.Please reload this page.
8de3964 to2d36823Compare2d36823 to20d0806Comparefabpot commentedMar 25, 2022
Thank you@l-vo. |
fabpot commentedApr 2, 2022
That's a breaking change as |
fabpot commentedApr 2, 2022
Nervermind, the BC break is in DoctrineBundle 2.6. |
l-vo commentedApr 2, 2022
@fabpot there is this kind of bc layer on Doctrine bundle:https://github.com/doctrine/DoctrineBundle/blob/0620e230c6529011b305e07efa0df0678bf71a6d/DoctrineBundle.php#L67. Did I miss another thing ? |
fabpot commentedApr 2, 2022
Here is the error I get: |
l-vo commentedApr 2, 2022
By chance, is it a project with sentry-symfony ? |
fabpot commentedApr 2, 2022
Yes, it is! |
l-vo commentedApr 2, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
it has been spotted ondoctrine/DoctrineBundle#1485, sentry-symfony aliases an internal interface as Doctrine\DBAL\Middleware that fools the detection. Accorded to the issue in DoctrineBundle, it won't be fixed on DoctrineBundle side. From@dmaicher:
|
l-vo commentedApr 2, 2022
Fixed on sentry-symfony side bygetsentry/sentry-symfony#608 |
…g middlewares (l-vo)This PR was submitted for the 6.0 branch but it was merged into the 6.1 branch instead.Discussion----------[DoctrineBridge] Restore PHP8 features for Doctrine debug middlewares| Q | A| ------------- | ---| Branch? | 6.1| Bug fix? | no| New feature? | no| Deprecations? | no| Tickets || License | MIT| Doc PR | To merge#45491 in 5.4, the code has been changed to be 7.2 compliant. This PR restores the original code for Symfony versions that support php >= 8.0 (see#45491 (comment)).Commits-------f4bdd82 Restore PHP8 features for Doctrine debug middlewares
Uh oh!
There was an error while loading.Please reload this page.
The SqlLogger that is used in doctrine bridge and doctrine bundle has been deprecated and replaced by a system of Middleware.
A work has started on Doctrine bundle withdoctrine/DoctrineBundle#1456 anddoctrine/DoctrineBundle#1472
This PR suggest to add a middleware thats covers what was previously done by
DbalLoggerandDebugStack.Another PR will follow in DoctrineBundle for the integration.