feat: add 5 notification mutations + comprehensive refactors from PR review

New notification actions (archive_many, create_unique, unarchive_many,
unarchive_all, recalculate) bring unraid_notifications to 14 actions.

Also includes continuation of CodeRabbit/PR review fixes:
- Remove redundant try-except in virtualization.py (silent failure fix)
- Add QueryCache protocol with get/put/invalidate_all to core/client.py
- Refactor subscriptions (manager, diagnostics, resources, utils)
- Update config (logging, settings) for improved structure
- Expand test coverage: http_layer, safety guards, schema validation
- Minor cleanups: array, docker, health, keys tools

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Jacob Magar
2026-03-13 01:54:55 -04:00
parent 06f18f32fc
commit 60defc35ca
27 changed files with 2508 additions and 423 deletions

View File

@@ -153,10 +153,25 @@ class TestInfoQueries:
from unraid_mcp.tools.info import QUERIES
expected_actions = {
"overview", "array", "network", "registration", "connect",
"variables", "metrics", "services", "display", "config",
"online", "owner", "settings", "server", "servers",
"flash", "ups_devices", "ups_device", "ups_config",
"overview",
"array",
"network",
"registration",
"connect",
"variables",
"metrics",
"services",
"display",
"config",
"online",
"owner",
"settings",
"server",
"servers",
"flash",
"ups_devices",
"ups_device",
"ups_config",
}
assert set(QUERIES.keys()) == expected_actions
@@ -314,8 +329,13 @@ class TestDockerQueries:
from unraid_mcp.tools.docker import QUERIES
expected = {
"list", "details", "logs", "networks",
"network_details", "port_conflicts", "check_updates",
"list",
"details",
"logs",
"networks",
"network_details",
"port_conflicts",
"check_updates",
}
assert set(QUERIES.keys()) == expected
@@ -520,7 +540,19 @@ class TestNotificationMutations:
def test_all_notification_mutations_covered(self, schema: GraphQLSchema) -> None:
from unraid_mcp.tools.notifications import MUTATIONS
expected = {"create", "archive", "unread", "delete", "delete_archived", "archive_all"}
expected = {
"create",
"archive",
"unread",
"delete",
"delete_archived",
"archive_all",
"archive_many",
"create_unique",
"unarchive_many",
"unarchive_all",
"recalculate",
}
assert set(MUTATIONS.keys()) == expected
@@ -713,8 +745,7 @@ class TestSchemaCompleteness:
failures.append(f"{tool_name}/MUTATIONS/{action}: {errors[0]}")
assert not failures, (
f"{len(failures)} of {total} operations failed validation:\n"
+ "\n".join(failures)
f"{len(failures)} of {total} operations failed validation:\n" + "\n".join(failures)
)
def test_schema_has_query_type(self, schema: GraphQLSchema) -> None: