-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[FrameworkBundle] Fall back to default configuration in debug:config and consistently resolve parameter values #42368
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
Conversation
7c4add2
to
60bb74f
Compare
089b5f0
to
b1f46bc
Compare
The failing test should be unrelated. |
86c4586
to
cb5e728
Compare
src/Symfony/Bundle/FrameworkBundle/Command/ConfigDebugCommand.php
Outdated
Show resolved
Hide resolved
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 generally OK to me
previously we resolved values (resolveValue
) after processing => https://github.com/symfony/symfony/pull/30648/files#diff-6f37907eb60dac18aec41358f427dab3c34f1c3d6d71247506ee52a856a05a2dL91, but im not sure it's still applicable for just default config now.
...Bundle/Tests/Functional/Bundle/DefaultConfigTestBundle/DependencyInjection/Configuration.php
Outdated
Show resolved
Hide resolved
Good catch! This is about env vars, right? I'll try to add a test and adapt that. |
yes :D another node with default env would be nice i guess, but AFAIK that's already taken care of due the outer |
cb5e728
to
ceb02cc
Compare
I added another node to check that and yes you're right - it's already taken care of |
b80de04
to
8f85856
Compare
8f85856
to
2affabe
Compare
ec2b218
to
7f82294
Compare
@ro0NL sorry to bother you again, 3 questions, no worries if you can't answer all of them
|
|
Grr, so apparently one of the values to check has single ticks on Windows but not on Linux xD I started to ignore appveyor already because it randomly failed.. ➜ symfony git:(bugfix/fallback-to-default-config) ✗ php ./phpunit src/Symfony/Bundle/FrameworkBundle
#!/usr/bin/env php
PHPUnit 9.5.7 by Sebastian Bergmann and contributors.
Warning: Your XML configuration validates against a deprecated schema.
Suggestion: Migrate your XML configuration using "--migrate-configuration"!
Testing /Users/herndlm/Development/source/git-forks/symfony/src/Symfony/Bundle/FrameworkBundle
............................................................. 61 / 1427 ( 4%)
............................................................. 122 / 1427 ( 8%)
............................................................. 183 / 1427 ( 12%)
............................................................. 244 / 1427 ( 17%)
............................................................. 305 / 1427 ( 21%)
............................................................. 366 / 1427 ( 25%)
............................................................. 427 / 1427 ( 29%)
............................................................. 488 / 1427 ( 34%)
............................................................. 549 / 1427 ( 38%)
......................................................SS..... 610 / 1427 ( 42%)
............................................................. 671 / 1427 ( 47%)
............................................................. 732 / 1427 ( 51%)
............................................................. 793 / 1427 ( 55%)
............................................................. 854 / 1427 ( 59%)
............................................................. 915 / 1427 ( 64%)
............................................................. 976 / 1427 ( 68%)
............................................................. 1037 / 1427 ( 72%)
............................................................. 1098 / 1427 ( 76%)
............................................................. 1159 / 1427 ( 81%)
............................................................. 1220 / 1427 ( 85%)
............................................................. 1281 / 1427 ( 89%)
............................................................. 1342 / 1427 ( 94%)
............................................................. 1403 / 1427 ( 98%)
........................ 1427 / 1427 (100%)
Time: 00:54.738, Memory: 240.50 MB
OK, but incomplete, skipped, or risky tests!
Tests: 1427, Assertions: 3427, Skipped: 2.
Legacy deprecation notices (156)
➜ symfony git:(bugfix/fallback-to-default-config) ✗ php -v
PHP 7.4.22 (cli) (built: Jul 29 2021 18:27:37) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Xdebug v3.0.4, Copyright (c) 2002-2021, by Derick Rethans
with Zend OPcache v7.4.22, Copyright (c), by Zend Technologies
➜ symfony git:(bugfix/fallback-to-default-config) ✗ git rev-parse HEAD
0939cdc44eeff42d04b4817f876494585cbecd87
➜ symfony git:(bugfix/fallback-to-default-config) ✗ should be all good then |
7f82294
to
0939cdc
Compare
src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ConfigDebugCommandTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ConfigDebugCommandTest.php
Outdated
Show resolved
Hide resolved
0939cdc
to
aa12784
Compare
@lyrixx what do you think? |
aa12784
to
82873f3
Compare
If it works as expected, let's ship it |
4afcb30
to
6be6168
Compare
…and consistently resolve parameter values
6be6168
to
9b6110b
Compare
Thank you @herndlm. |
Brings back determining the default configuration from pull request #30648. Refactors determining the extension config into a helper method to keep cognitive load low with early exits instead of nested ifs.
Additionaly, while reviewing, we noticed that entries with parameters are not resolved correctly if they come from the default config and an application config is existing but they are not overriden. E.g. the session config for the framework would output
save_path: %kernel.cache_dir%/sessions
instead of the resolved value.Tested via unit test (obviously) and by manually removing bundle configuration in a Symfony project.
Beware that I do not know much about bundles and internals, I looked that up while implementing this and might have missed better/simpler solutions or edge cases. Please somebody also do another functional test to ensure this is really working as it should.