feat: untyped discovery config libraries (align with 3.26.14 server)#39
Open
AaronBarnes07 wants to merge 1 commit into
Open
feat: untyped discovery config libraries (align with 3.26.14 server)#39AaronBarnes07 wants to merge 1 commit into
AaronBarnes07 wants to merge 1 commit into
Conversation
Removes config_type from DiscoveryConfigLibrary and the name-based library methods; a library is now identified by (namespace, name) and imported by both database and file configs. Requires a 3.26.14+ server.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Makes discovery config libraries untyped in the client, matching the DataMasque 3.26.14 server (DM-4084). A single library is now identified by
(namespace, name)and can be imported by both database and file discovery configs.config_typefield fromDiscoveryConfigLibrary.config_typeargument fromget_discovery_config_library_by_name,create_or_update_discovery_config_library, anddelete_discovery_config_library_by_name_if_exists(name-based lookups now match onnamespaceonly).DiscoveryConfigTypeimport from the library client. The enum stays forDiscoveryConfig, which remains typed.Why
DM-4084 re-lands discovery config libraries as a single untyped library. The 3.26.14 server drops
config_typefrom the library model/serializer (uniqueness is(namespace, name)), so the current client would fail to parse every librarylist/getresponse (missing requiredconfig_type) and sends a now-meaninglessconfig_typeon writes.This is a breaking change to the library API (added in 1.1.6) and is coupled to the 3.26.14 server release. It must not be released before 3.26.14 ships, or the client breaks against the current (typed) server. Please hold the tag/release until 3.26.14 is out.
Test plan
uv run pytest— 397 passed (fully mocked; the typed-only "same name, different type" tests were removed since that's now impossible, and atest_library_is_untypedadded).uv run ruff check/ruff format --check— clean.uv run mypy datamasque— clean.Version bumped to
1.2.0inpyproject.toml+HISTORY.rst.