Wrong Order in Substitution Resolution Leads to Faulty Configuration
See original GitHub issueThe substitution resolution is not performed in the order of the HOCON variable assignment.
Version: 0.3.58
Example:
pyhocon -i <INPUT_FILE>
Input file:
common = common
original = ${common}/original
result = ${original}
replaced = ${common}/replaced
result = ${replaced}
copy = ${result}
Result:
{
"common": "common",
"original": "common/original",
"result": "common/replaced",
"replaced": "common/replaced",
"copy": "common/original"
}
Expected Result:
{
"common": "common",
"original": "common/original",
"result": "common/replaced",
"replaced": "common/replaced",
"copy": "common/replaced"
}
Analyzing the substitution process, we see that the substitution is performed in the following order:
- ${common} -> original = common/original
- ${original} -> result = common/original
- ${replaced} -> result = ${replaced} (HOWEVER: cannot be resolved because ${replaced} contains a substitution itself, thus the previous resolution stays for now! Here lies the issue!)
- ${common} -> replaced = common/replaced
- ${result} -> copy = common/original (Because the result = ${replaced} substitution could not be done until now, this apparently takes the previous substitution)
Now the next substitution iteration starts with the single left over substitution:
- ${replaced} -> result = common/replaced
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top Results From Across the Web
Customizing resolution of a dependency directly
However, tasks to build the replaced dependency will not be executed in order to resolve the depending Configuration . Conditionally substituting a dependency....
Read more >Substitution failure is not an error - Wikipedia
Substitution failure is not an error (SFINAE) refers to a situation in C++ where an invalid substitution of template parameters is not in...
Read more >c++ - what is the order of the function template instantiation ...
both templates will be instantiated but overload resolution will fail as the two functions void test(anonymous struct, int) are ambiguous.
Read more >"The Delegates settings were not saved correctly" error when ...
Resolution. Outlook can be configured to enable you to add delegates without requiring you to grant the "send on behalf of" permission. Follow...
Read more >Common TypeScript module problems and how to solve them
Enabling the compiler module resolution tracing in TypeScript can ... configuration, TypeScript compiler will throw the following error:
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi! I’ve created test based on your test data and managed to fix it and not break any other tests: https://github.com/chimpler/pyhocon/pull/284
Better now: https://github.com/chimpler/pyhocon/pull/285