Skip to content

Fix custom domain resolution in load_domain (#30)#52

Open
ecsricktorzynski wants to merge 1 commit into
neo4j-labs:mainfrom
ecsricktorzynski:fix/issue-30-custom-domain-resolution
Open

Fix custom domain resolution in load_domain (#30)#52
ecsricktorzynski wants to merge 1 commit into
neo4j-labs:mainfrom
ecsricktorzynski:fix/issue-30-custom-domain-resolution

Conversation

@ecsricktorzynski

Copy link
Copy Markdown

Closes #30.

Problem

list_available_domains() scans both the bundled domains directory and ~/.create-context-graph/custom-domains/, but load_domain() only searched the bundled directory. Saved custom domains therefore appeared in the 'Available domains' list yet failed to load with 'Domain not found' — affecting both the --domain CLI flag and selecting a saved custom domain in the wizard.

Fix

Added _find_domain_path(), which resolves a domain id against bundled then custom directories, with a fallback that matches the YAML's internal domain.id when a saved file's stem has drifted. load_domain() now delegates to the existing load_domain_from_path() so the base-inheritance merge isn't duplicated.

Tests

Added TestLoadCustomDomainResolution (5 tests), including one asserting every domain in list_available_domains() is loadable. No regressions across test_ontology.py and test_custom_domain.py.

load_domain() only searched the bundled domains directory, so domains
saved to ~/.create-context-graph/custom-domains/ failed with 'Domain not
found' despite appearing in list_available_domains(). Resolution now
mirrors the listing logic (bundled + custom, with a domain.id fallback),
and load_domain() delegates to load_domain_from_path() to reuse the base
merge logic. Adds regression tests asserting every listed domain loads.
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.

Custom domains fail to resolve despite being saved and listed as available

2 participants