-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Situation
Inside the ENV config, we have two types of potential placeholders:
-
Regular/config placeholders Syntax
{placeholder}
They are used to reference other parts of the ENV configuration. For example, if you have"{tmp_base_dir}/doc-example-com"as string, the placeholdertmp_base_diris searched in the current section of the config.
It's possible to refer to other sections of the config withsection.keylike inpaths.base_tmp_dir.
Whatever variation we use, at the end it should resolve to at least some path that can be accessed. -
Runtime/dynamic placeholders Syntax
{{placeholder}}
These types of placeholders cannot and must not be replaced. They are replaced at runtime with specific values.
At the moment, some key contains both kind of placeholders. This is unfortunate as you can't test regular placeholders when they are mixed with runtime ones.
Use Case
Having these two separated have some benefits:
-
Both types are separated. For regular placeholders, it's the type
EnsureWritableDirectorywhich tests the directory, permissions etc. This wouldn't be possible, if we would have a mixture of regular and dynamic types. -
Code and testing becomes much more easier.
Possible Implementation
- Identify which keys uses both placeholder types.
- Introduce a consistent naming scheme (for example
_dynfor dynamic content) - Search the code that uses the key. Retrieve the dynamic key from the config and add it to the regular key to get the same functionality.