Skip to content

Support nested merge_keys strategies via dotted paths - #55

Merged
coordt merged 2 commits into
masterfrom
feat/issue-45-nested-merge-keys
Sep 27, 2026
Merged

coordt merged 2 commits into
masterfrom
feat/issue-45-nested-merge-keys

Conversation

@coordt

@coordt coordt commented Sep 27, 2026

Copy link
Copy Markdown
Member

Summary

  • comprehensive_merge recursed into nested dicts unconditionally, so a composition's merge_keys had no effect below the top level.
  • A nested key can now be given its own merge strategy using a dotted path (e.g. requirements.dev: update) in merge_keys; everything else still merges comprehensively.
  • Updated docs and the Composition.merge_keys field description to explain the dotted-path syntax.
  • Fixed a pre-existing interrogate/ruff config conflict on freeze_data's @overload stubs that was blocking commits touching that file.

Fixes #45

Test plan

  • uv run pytest (336 passed; unrelated test_git_commands.py failures pre-date this change, reproduced on master)
  • uv run ruff check / ruff format --check
  • pre-commit run --all-files equivalent hooks passed on both commits (mypy, interrogate, pydoclint, etc.)
  • New tests added for nested-key strategy selection in test_data_merge.py and test_context.py

coordt and others added 2 commits September 27, 2026 08:48
comprehensive_merge previously recursed into nested dicts unconditionally,
ignoring the composition's merge_keys strategy below the top level. A dotted
key path (e.g. "requirements.dev") in merge_keys now selects its own merge
strategy for that nested key while the rest of the structure still merges
comprehensively.

Also set interrogate's ignore-overloaded-functions, since it and ruff's
overload-with-docstring rule otherwise contradict each other on the
freeze_data overload stubs in the touched file.

Co-authored-by: Claude <noreply@anthropic.com>
Completes the fix in the previous commit: update_context now passes
merge_keys through to comprehensive_merge so top-level context updates
honor nested-key strategies, docs/schema description explain the dotted
path syntax, and tests cover both comprehensive_merge and update_context.

Co-authored-by: Claude <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-09-27 13:52 UTC

@github-actions

Copy link
Copy Markdown
Contributor

Version hint: patch
Current version: 0.9.3
New version (when merged): 0.9.4

Comment ID: Display version hint-auto-generated

@coordt
coordt merged commit 815c3f9 into master Sep 27, 2026
5 checks passed
@coordt
coordt deleted the feat/issue-45-nested-merge-keys branch September 27, 2026 13:51
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.

merge_keys strategy doesn't apply below the top level in comprehensive_merge

1 participant