-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[FrameworkBundle] add --deprecations on debug:container command #32584
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] add --deprecations on debug:container command #32584
Conversation
e504ade
to
2728a8d
Compare
5f14174
to
ad4acac
Compare
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.
When the deprecation message is too large, the output is unreadable. Could we format that message? or do we have an option in the table helper to set the width of the column?
BTW very useful command, thanks!
src/Symfony/Bundle/FrameworkBundle/Command/DebugDeprecationsCommand.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/FrameworkBundle/Command/DebugDeprecationsCommand.php
Outdated
Show resolved
Hide resolved
I would remove the table and take inspiration from the reports from the bridge if that makes sense. |
I will check that ! Thanks.
Maybe we could call it DebugContainerCompiledDeprecation (that’s big ;))
Le mer. 17 juil. 2019 à 20:13, Nicolas Grekas <notifications@github.com> a
écrit :
… I would remove the table and take inspiration from the reports from the
bridge if that makes sense.
Also, the name might be confision: this is only about deprecations
triggered during compile+warmup. There can be many more.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#32584?email_source=notifications&email_token=AA2KV4WMVDFWA6X4D66R5ZTP75OOLA5CNFSM4IESRN3KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2GEDOY#issuecomment-512508347>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA2KV4RMDLA4FXBFFRWAA3TP75OOLANCNFSM4IESRN3A>
.
|
ed04eb3
to
b21cc72
Compare
@nicolas-grekas updated according to the bridge |
src/Symfony/Bundle/FrameworkBundle/Command/DebugWarmedDeprecationsCommand.php
Outdated
Show resolved
Hide resolved
4f156ea
to
43f18cd
Compare
cc @yceruto WDYT ? |
src/Symfony/Bundle/FrameworkBundle/Command/DebugDeprecationsWarmedCommand.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/FrameworkBundle/Command/DebugDeprecationsWarmedCommand.php
Outdated
Show resolved
Hide resolved
43f18cd
to
c27ad7a
Compare
|
@nicolas-grekas I've taken this symfony/src/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmerAggregate.php Lines 99 to 107 in 2ab1521
I think this is really the deprecation collected during cache warmup. |
Oh, sorry I forgot about that :) |
Since we collect the same logs during container compilations, I think it does too |
So do, |
c27ad7a
to
77d5061
Compare
8ba1bda
to
6f00187
Compare
PR rebased and comments fixed. |
cc @yceruto |
src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php
Outdated
Show resolved
Hide resolved
6f00187
to
4b62442
Compare
PR updated and ready ! |
Why don't we supported all formats (JSON, Markdown and XML)? |
I don't see the need of getting this information in JSON for example ATM. |
The support for many formats is for integration with third-party tools. |
@Simperfit Do you have to finish this PR? We won't merge it if we don't support all formats. Or maybe someone else can take over to finish it, it should not be too time consuming. |
4b62442
to
9a97e33
Compare
FYI, I rebased your branch |
$formattedLogs = []; | ||
$remainingCount = 0; | ||
foreach ($logs as $log) { | ||
$formattedLogs[] = sprintf("%sx: %s \n in %s:%s", $log['count'], $log['message'], $log['file'], $log['line']); |
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.
we should use <href=%s>%s:%d</>
here, to generate IDE links (which means using the FileLinkFormatter service to compute it)
@@ -143,6 +146,11 @@ protected function write($content, $decorated = false) | |||
*/ | |||
abstract protected function describeContainerServices(ContainerBuilder $builder, array $options = []); | |||
|
|||
/** | |||
* Describes container deprecations. | |||
*/ |
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.
can be removed
@@ -149,6 +154,8 @@ protected function execute(InputInterface $input, OutputInterface $output) | |||
} elseif ($name = $input->getArgument('name')) { | |||
$name = $this->findProperServiceName($input, $errorIo, $object, $name, $input->getOption('show-hidden')); | |||
$options = ['id' => $name]; | |||
} elseif ($input->getOption('deprecations')) { | |||
$options = ['deprecations' => 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.
validateInput()
needs to be updated to forbid combining this option with others.
Any news here? Anyone willing to take over? |
Closing as stale, anyone willing to help, please start from this PR. |
I'll try implementing missing formats (md, json and xml) |
…r command (Simperfit, noemi-salaun) This PR was merged into the 5.1-dev branch. Discussion ---------- [FrameworkBundle] add --deprecations on debug:container command | Q | A | ------------- | --- | Branch? | master (5.1) | Bug fix? | no | New feature? | yes <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | #30089 <!-- prefix each issue number with "Fix #", if any --> | License | MIT | Doc PR | todo _I apologize in advance, I am not fluent in English_ Continuity of @Simperfit work from his PR #32584 I added support for XML, JSON and markdown formats as well as unit tests for all formats. ## XML format ```xml <?xml version="1.0" encoding="UTF-8"?> <deprecations remainingCount="5"> <deprecation count="3"> <message>Some deprecation message.</message> <file>/path/to/some/file.php</file> <line>39</line> </deprecation> <deprecation count="2"> <message>An other deprecation message.</message> <file>/path/to/an/other/file.php</file> <line>25</line> </deprecation> </deprecations> ``` ## JSON format ```json { "remainingCount": 5, "deprecations": [ { "message": "Some deprecation message.", "file": "\/path\/to\/some\/file.php", "line": 39, "count": 3 }, { "message": "An other deprecation message.", "file": "\/path\/to\/an\/other\/file.php", "line": 25, "count": 2 } ] } ``` ## Markdown format ## Remaining deprecations (5) - 3x: "Some deprecation message." in /path/to/some/file.php:39 - 2x: "An other deprecation message." in /path/to/an/other/file.php:25 I added a new commit on top of @Simperfit 's one, but I don't know how you would like to have the git history writed. Commits ------- ee6391e [FrameworkBundle] add all formats support for debug:container --deprecations command 161f659 [FrameworkBundle] add --deprecations on debug:container command
Two question for this:
is a table output enough ?Edit: new output
