-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[FrameworkBundle] Only show relevant columns in debug:router
call
#59780
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
base: 7.3
Are you sure you want to change the base?
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
debug:router
call
821481d
to
44577d0
Compare
Oddly enough the tests work locally. Any idea why? Or is there a way to generate the expected output from the input? |
Can you share some before/after screenshots? |
Added screenshots oddly enough it does not show the deprecation notice I added. |
debug:router
calldebug:router
call
65d4a5f
to
f7384d1
Compare
Okay the last remaining error I presume is because the CI tests do not use a true color terminal. Question: should I set the CI colors to use |
f7384d1
to
623d688
Compare
src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php
Outdated
Show resolved
Hide resolved
@mamazu I like this a lot. Thanks! Two quick comments: (1): I'd use the HTTP method colors from the OpenAPI standard (and keep (2): I'm divided about outputting the controller. It's useful, but it will break the table design for most people. See your screenshot. Even if you use very short controllers (most folks will display long FQCN) the resulting table is pretty wide. In practice, each row could be displayed in two rows instead. So, why not display each route in two lines since the beginning to avoid breaking the design? |
@javiereguiluz Thanks for the feedback.
|
6534fa7
to
78b95e8
Compare
af774f0
to
fe882b3
Compare
Because you mentioned "grepability", another approach can also be to use |
You are completely correct, the text representation contains the least amount of infos anyways, so any other format for searching would also work. |
src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/empty_route_collection.json
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/empty_route_collection.xml
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_collection_1.json
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_collection_1.xml
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_with_generic_host.xml
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php
Outdated
Show resolved
Hide resolved
@@ -84,6 +84,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int | |||
if ($this->fileLinkFormatter) { | |||
$container = fn () => $this->getContainerBuilder($this->getApplication()->getKernel()); | |||
} | |||
if ($input->getOption('show-controllers')) { | |||
trigger_deprecation('symfony/console', '7.3', 'Using --show-controllers is deprecated. They are shown by default now.'); |
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'm not sure I see the point of this change. The arguments in the PR description look like personal preference to me. I'd prefer not changing this.
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.
In general yes, it's personal preference but there is also a technical argument to it.
The TextDescriptor
in List mode is the only thing that supports this flag. If you provide an argument for getting the route details or if you use a different formatter none of them use this flag. So this would also remove inconsistency in my opinion.
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 don't think that's sound enough to warrant a deprecation. Consistency is not the main aspect here.
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.
Fair enough. I'll remove it.
$methods = ['ANY']; | ||
} | ||
|
||
return implode('|', array_map(fn (string $method): string => '<fg='.self::VERB_COLORS[$method].'>'.$method.'</>', $methods)); |
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 possible that $method is not defined in VERB_COLORS (eg TRACE, PURGE, or any custom verb)
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.
Should fall back to default now.
d5d400c
to
b6f285a
Compare
The test failures aren't related to the feature. |
@nicolas-grekas So I've removed the deprecation. (I don't know if I can remove the deprecation tag from the PR) Secondly I don't know how the pipeline failures are related to the feature. Could you please restart it or is there anything else I could do? |
What I did
Always showing the controllers in the list view (we but not removing the--show-controllers
so it's not a BC break)Why
Screenshots
Before:

After:
