Skip to content

fix: isolate aliased configuration mappings - #438

Merged
codeforester merged 2 commits into
mainfrom
bug/407-20261008-bug-isolate-yaml-aliases-when-merging-configuration-layers
Oct 8, 2026
Merged

codeforester merged 2 commits into
mainfrom
bug/407-20261008-bug-isolate-yaml-aliases-when-merging-configuration-layers

Conversation

@codeforester

Copy link
Copy Markdown
Contributor

Fixes #407. Copies nested configuration containers so shared YAML aliases cannot make unrelated effective values mutate together. Tests: tests/test_batteries_included_config.py.

@codeforester

Copy link
Copy Markdown
Contributor Author

Review: the fix is correct (_copy_config_value deep-copies mappings, lists and tuples, so aliases are no longer shared). One test problem to fix before merge.

The new test_nested_mapping_aliases_are_isolated_across_layers was inserted in the middle of test_shared_mapping_alias_is_valid_but_recursive_alias_is_rejected_with_path. The recursive-alias with tempfile.TemporaryDirectory() block that belonged to the original test now sits at the end of the new test. Nothing fails, but the original test no longer checks what its name says, and the new test has an unrelated recursive-YAML assertion. Please move that block back to the original test.

Non-blocking: a tuple branch in _copy_config_value is untested (YAML won't produce tuples, so it only matters for programmatic callers).

@codeforester
codeforester force-pushed the bug/407-20261008-bug-isolate-yaml-aliases-when-merging-configuration-layers branch from 7aa081c to 83925a3 Compare October 8, 2026 17:03
@codeforester
codeforester force-pushed the bug/407-20261008-bug-isolate-yaml-aliases-when-merging-configuration-layers branch from 83925a3 to 141c5da Compare October 8, 2026 18:02
@codeforester
codeforester merged commit eb8483a into main Oct 8, 2026
115 checks passed
@codeforester
codeforester deleted the bug/407-20261008-bug-isolate-yaml-aliases-when-merging-configuration-layers branch October 8, 2026 18:17
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.

bug: isolate YAML aliases when merging configuration layers

1 participant