You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm opening this in reference to a downstream issue with BLT (which uses consolidation/config): acquia/blt#3697
BLT works by providing a default set of configuration, and then calling ConfigProcessor::extend() to override any values with user-provided variants (via blt.yml and other sources).
As you can see from that issue, the problem this user is facing is that when they want to override an array, they have to override every element of that array individually. I think it would make more sense that if you override any part of an array, it resets the entire array.
For instance, if the array is this:
sync:
commands:
- op1
- op2
We extend it as:
sync:
commands:
- opfoo
We expect the final overridden config to be:
sync:
commands:
- opfoo
But we actually get:
sync:
commands:
- opfoo
- op2
Is this expected behavior? Is there some other workaround that I'm missing?
The text was updated successfully, but these errors were encountered:
danepowell
changed the title
Extending an array config only overrides specific members of the array
Extending an array config only overrides specific elements of the array
Jun 4, 2019
Unordered lists are a weak spot in configuration override. Configuration is combined using @grasmash 's ArrayUtil::mergeRecursiveDistinct. I think that whether you want to replace or merge array elements might depend on the context.
If we did change the behavior here, it would have to either be via an option (a method call a client could make), or be part of a new major release, as it would be a backwards-incompatible change.
I'm opening this in reference to a downstream issue with BLT (which uses consolidation/config): acquia/blt#3697
BLT works by providing a default set of configuration, and then calling ConfigProcessor::extend() to override any values with user-provided variants (via blt.yml and other sources).
As you can see from that issue, the problem this user is facing is that when they want to override an array, they have to override every element of that array individually. I think it would make more sense that if you override any part of an array, it resets the entire array.
For instance, if the array is this:
We extend it as:
We expect the final overridden config to be:
But we actually get:
Is this expected behavior? Is there some other workaround that I'm missing?
The text was updated successfully, but these errors were encountered: