Skip to content

Propagate mode during config parsing#1280

Open
Alexey-Borisov wants to merge 1 commit into
userver-framework:developfrom
Alexey-Borisov:enable-nested-config-env-and-file
Open

Propagate mode during config parsing#1280
Alexey-Borisov wants to merge 1 commit into
userver-framework:developfrom
Alexey-Borisov:enable-nested-config-env-and-file

Conversation

@Alexey-Borisov

Copy link
Copy Markdown

No description provided.

@apolukhin

Copy link
Copy Markdown
Member

You are adding a recursive evaluation of #something. That's the thing we'd like to avoid as it makes the YAML config a Turing complete programming language

What problem are you trying to solve that is not solvable right now? Please provide a concrete example

@Alexey-Borisov

Alexey-Borisov commented Jun 30, 2026

Copy link
Copy Markdown
Author

There isn't any problem that is impossible to solve with the current implementation.
I ran into this while doing a small refactoring of our configuration. In our tests we currently have configuration like:

fieldA#env: valueA
fieldB#env: valueB

After the refactoring, it became more natural to group these values under a common node in config_vars.yaml and use $root in static_config.yaml:

root:
fieldA#env: valueA
fieldB#env: valueB

However, this is currently not supported.
Of course, we can rewrite the test configuration to avoid this, so this is more a matter of convenience than necessity. When I looked at the implementation, it seemed that allowing nested #env processing wouldn't introduce any obvious issues, so I proposed the change.

@Alexey-Borisov

Copy link
Copy Markdown
Author

Maybe a better solution would be to add an additional mode that allows this kind of recursion and has to be explicitly enabled by the user?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants