Skip to content
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

Debug finalized config in debug:config #30648

Merged
merged 1 commit into from
Mar 23, 2019
Merged

Debug finalized config in debug:config #30648

merged 1 commit into from
Mar 23, 2019

Conversation

ro0NL
Copy link
Contributor

@ro0NL ro0NL commented Mar 22, 2019

Q A
Branch? 4.2
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #30637
License MIT
Doc PR symfony/symfony-docs#...

Re-processing the extension config in debug:config causes a lot of steps to be ignored, basically everything in ValidateEnvPlaceholdersPass.

As such we trigger a misleading error when this command is invoked.

@ro0NL
Copy link
Contributor Author

ro0NL commented Mar 22, 2019

$ bin/console debug:config SecurityBundle

# before

  Invalid type for path "security.firewalls.api_login.security". Expected boolean, but got string.  

# after

Current configuration for "SecurityBundle"
==========================================

security:
    firewalls:
        api_login:
            security: '%env(bool:FOO)%'
            anonymous:
                secret: '%env(int:FOO)%'

@ro0NL
Copy link
Contributor Author

ro0NL commented Mar 22, 2019

deps=high should pass after merge.

@chalasr chalasr modified the milestones: next, 4.2 Mar 23, 2019
@fabpot
Copy link
Member

fabpot commented Mar 23, 2019

Thank you @ro0NL.

@fabpot fabpot merged commit b9ac3a5 into symfony:4.2 Mar 23, 2019
fabpot added a commit that referenced this pull request Mar 23, 2019
This PR was merged into the 4.2 branch.

Discussion
----------

Debug finalized config in debug:config

| Q             | A
| ------------- | ---
| Branch?       | 4.2
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #30637
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Re-processing the extension config in `debug:config` causes a lot of steps to be ignored, basically everything in `ValidateEnvPlaceholdersPass`.

As such we trigger a misleading error when this command is invoked.

Commits
-------

b9ac3a5 Debug finalized config in debug:config
@ro0NL ro0NL deleted the debug-conf branch March 24, 2019 09:43
@fabpot fabpot mentioned this pull request Apr 2, 2019
fabpot added a commit that referenced this pull request Aug 26, 2021
…bug:config and consistently resolve parameter values (herndlm)

This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] Fall back to default configuration in debug:config and consistently resolve parameter values

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #41121
| License       | MIT
| Doc PR        | n/a

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.

Commits
-------

9b6110b [FrameworkBundle] Fall back to default configuration in debug:config and consistently resolve parameter values
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants