From c5ecca768bcec9d8b0fa137f082ff888149ab009 Mon Sep 17 00:00:00 2001 From: Resinder <18302831+Resinder@users.noreply.github.com> Date: Fri, 23 Oct 2026 15:01:55 +0300 Subject: [PATCH 1/2] test: validate every catalog manifest against the SDK schema Bump the plugin-sdk pin to plugin-sdk#52, which adds the declarative connector schema, and check every manifest.yml that declares an apiVersion with validate_manifest (what `minder-plugin validate` runs). A manifest that drifts from the SDK contract now fails this repo's CI. Also check that each manifest's metadata.name matches its directory. Agent-Session: zeynep-portainer Co-Authored-By: Claude Opus 5.5 --- pyproject.toml | 18 ++++++------- tests/test_manifest_schemas.py | 46 ++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 9 deletions(-) create mode 100644 tests/test_manifest_schemas.py diff --git a/pyproject.toml b/pyproject.toml index a5b6fd5..bd92b97 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,15 +16,15 @@ py-modules = [] [project.optional-dependencies] dev = [ # Pinned past v0.1.0 to a specific commit (not a new tag -- this repo's - # own CHANGELOG: no routine version bumps pre-1.0). f44873fc is plugin-sdk - # #50 (tool effect classes): the AI_TOOLS `effect`, `idempotent`, - # per-argument `sensitivity` and `hosts` fields, which `minder-plugin - # validate` checks (errors on invalid values, warnings on a missing or - # contradicted effect). It builds on plugin-sdk #43 (platform context, - # contract v2: self.ctx / bind_context, the CONTRACT_VERSION / MANAGES / - # EGRESS / TIMESERIES declarations, FakePlatformContext) and still carries - # the package-style plugin validate/inspect fix `network` needs (#26). - "minder-plugin-sdk @ git+https://github.com/minderhq/plugin-sdk@f44873fcada50f17cc38d26089837d4d1a6227ec", + # own CHANGELOG: no routine version bumps pre-1.0). a310db94 is plugin-sdk + # #52 (manifest schemas): the declarative connector schema + # tests/test_manifest_schemas.py checks every manifest.yml against, and + # the full manifest-plugin trigger/action set. It builds on #50 (tool + # effect classes: AI_TOOLS `effect`, `idempotent`, `sensitivity`, `hosts`, + # checked by `minder-plugin validate`), #43 (platform context, contract + # v2) and the package-style plugin validate/inspect fix `network` needs + # (#26). The jsonschema/yaml extras give full schema validation. + "minder-plugin-sdk[jsonschema,yaml] @ git+https://github.com/minderhq/plugin-sdk@a310db94a006745d55a91dda65bc6434b9564cb2", "httpx>=0.27", "defusedxml>=0.7", "pytest>=8", diff --git a/tests/test_manifest_schemas.py b/tests/test_manifest_schemas.py new file mode 100644 index 0000000..8967885 --- /dev/null +++ b/tests/test_manifest_schemas.py @@ -0,0 +1,46 @@ +"""Every plugin manifest in the catalog validates against the plugin SDK's +schema: a declarative connector (``spec.runtime.kind: declarative``) against +the declarative connector schema, any other manifest against the manifest +plugin schema. This is what ``minder-plugin validate`` checks, and Minder +validates against the same schemas. + +Files without ``apiVersion`` (e.g. telegraf's bundle-claim ``manifest.yml``) +are not plugin manifests and are skipped. +""" + +from pathlib import Path + +import pytest +import yaml +from minder_plugin_sdk import validate_manifest + +ROOT = Path(__file__).resolve().parent.parent + + +def _load(path: Path): + return yaml.safe_load(path.read_text(encoding="utf-8")) + + +MANIFESTS = sorted( + p + for p in ROOT.glob("*/manifest.*") + if p.suffix in (".yml", ".yaml", ".json") + and isinstance(_load(p), dict) + and "apiVersion" in _load(p) +) + + +def test_the_catalog_has_declarative_manifests(): + names = {p.parent.name for p in MANIFESTS} + assert {"arxiv", "frankfurter", "openlibrary", "wikipedia"} <= names + + +@pytest.mark.parametrize("path", MANIFESTS, ids=lambda p: p.parent.name) +def test_manifest_matches_the_sdk_schema(path): + validate_manifest(_load(path)) # raises ManifestError with every problem + + +@pytest.mark.parametrize("path", MANIFESTS, ids=lambda p: p.parent.name) +def test_manifest_name_matches_its_directory(path): + # Minder's runner refuses a manifest that names another directory. + assert _load(path)["metadata"]["name"] == path.parent.name From 80d410f43c347be859964ab2319a7ab0a8d451b7 Mon Sep 17 00:00:00 2001 From: Resinder <18302831+Resinder@users.noreply.github.com> Date: Fri, 23 Oct 2026 15:33:11 +0300 Subject: [PATCH 2/2] test: repin plugin-sdk to the head of plugin-sdk#52 Agent-Session: zeynep-portainer Co-Authored-By: Claude Opus 5.5 --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index bd92b97..0c662c1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,7 @@ py-modules = [] [project.optional-dependencies] dev = [ # Pinned past v0.1.0 to a specific commit (not a new tag -- this repo's - # own CHANGELOG: no routine version bumps pre-1.0). a310db94 is plugin-sdk + # own CHANGELOG: no routine version bumps pre-1.0). 0919ce8c is plugin-sdk # #52 (manifest schemas): the declarative connector schema # tests/test_manifest_schemas.py checks every manifest.yml against, and # the full manifest-plugin trigger/action set. It builds on #50 (tool @@ -24,7 +24,7 @@ dev = [ # checked by `minder-plugin validate`), #43 (platform context, contract # v2) and the package-style plugin validate/inspect fix `network` needs # (#26). The jsonschema/yaml extras give full schema validation. - "minder-plugin-sdk[jsonschema,yaml] @ git+https://github.com/minderhq/plugin-sdk@a310db94a006745d55a91dda65bc6434b9564cb2", + "minder-plugin-sdk[jsonschema,yaml] @ git+https://github.com/minderhq/plugin-sdk@0919ce8ca4a01934bbcabe3cddf000b00d60b5e9", "httpx>=0.27", "defusedxml>=0.7", "pytest>=8",