-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DI] Fix EnvVar not loaded when Loader requires an env var #35355
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
c11ff3f
to
c371297
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.
LGTM, with some comments. Please add tests :)
cc1849a
to
85d2f05
Compare
85d2f05
to
95ced71
Compare
95ced71
to
e119aa6
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.
Not easy, but patch is good!
(I did some minor changes + improved tests while reviewing)
Good catch, thanks @jderusse. |
… (jderusse) This PR was merged into the 4.4 branch. Discussion ---------- [DI] Fix EnvVar not loaded when Loader requires an env var | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | #35348 | License | MIT | Doc PR | NA When an EnvVarLoader has a dependency on an Env Var tried to be loaded (which is the case for SodiumVault that is configured with `default::SYMFONY_DECRYPTION_SECRET`) the Loader is not usable. What happens: - when trying to resolve `SYMFONY_DECRYPTION_SECRET`, the EnvVarProcessor iterates over loaders - given SodiumVaultLoaders requires the same env variable `SYMFONY_DECRYPTION_SECRET`, it throws a `ParameterCircularReferenceException` - letting the $loaders generator invalid This PR, refactor the way loaders are iterated in order to rewind on failure. Commits ------- e119aa6 [DI] Fix EnvVar not loaded when Loader requires an env var
When an EnvVarLoader has a dependency on an Env Var tried to be loaded (which is the case for SodiumVault that is configured with
default::SYMFONY_DECRYPTION_SECRET
) the Loader is not usable.What happens:
SYMFONY_DECRYPTION_SECRET
, the EnvVarProcessor iterates over loadersSYMFONY_DECRYPTION_SECRET
, it throws aParameterCircularReferenceException
This PR, refactor the way loaders are iterated in order to rewind on failure.