From 007f609da433c1065a2a17b564e35b69ee9ca7f5 Mon Sep 17 00:00:00 2001 From: StreamKit Devin Date: Sat, 25 Apr 2026 15:13:11 +0000 Subject: [PATCH 1/2] fix: read 'repo' YAML key in registry scripts and tighten reload-keys concurrency - Change plugin.get('repository') to plugin.get('repo') in build_registry.py and check_registry_versions.py to match the actual YAML key used in plugin.yml files (#307). - Add RELOAD_KEYS_MAX_CONCURRENCY (1) for the admin-only reload-keys endpoint instead of reusing AUTH_MAX_CONCURRENCY (64) (#346). - Add unit tests for the repo-field mapping in both registry scripts. Closes #307 Closes #346 Signed-off-by: StreamKit Devin Co-Authored-By: Claudio Costa --- apps/skit/src/auth/handlers.rs | 4 +- scripts/marketplace/build_registry.py | 2 +- .../marketplace/check_registry_versions.py | 2 +- scripts/marketplace/test_build_registry.py | 63 +++++++++++++++++++ 4 files changed, 68 insertions(+), 3 deletions(-) create mode 100644 scripts/marketplace/test_build_registry.py diff --git a/apps/skit/src/auth/handlers.rs b/apps/skit/src/auth/handlers.rs index 0ea4ab3d..5dfbafca 100644 --- a/apps/skit/src/auth/handlers.rs +++ b/apps/skit/src/auth/handlers.rs @@ -27,6 +27,7 @@ use tower::limit::ConcurrencyLimitLayer; const AUTH_MAX_BODY_BYTES: usize = 64 * 1024; const AUTH_MAX_CONCURRENCY: usize = 64; +const RELOAD_KEYS_MAX_CONCURRENCY: usize = 1; /// Request body for login endpoint. #[derive(Debug, Deserialize)] @@ -508,7 +509,8 @@ pub fn auth_router() -> axum::Router> { ) .route( "/reload-keys", - post(reload_keys_handler).layer(ConcurrencyLimitLayer::new(AUTH_MAX_CONCURRENCY)), + post(reload_keys_handler) + .layer(ConcurrencyLimitLayer::new(RELOAD_KEYS_MAX_CONCURRENCY)), ); #[cfg(feature = "moq")] diff --git a/scripts/marketplace/build_registry.py b/scripts/marketplace/build_registry.py index 26f55e6f..b48644bc 100644 --- a/scripts/marketplace/build_registry.py +++ b/scripts/marketplace/build_registry.py @@ -170,7 +170,7 @@ def build_manifest( "license": plugin.get("license"), "license_url": plugin.get("license_url"), "homepage": plugin.get("homepage"), - "repository": plugin.get("repository"), + "repository": plugin.get("repo"), "entrypoint": plugin["entrypoint"], "bundle": bundle_block, "compatibility": plugin.get("compatibility"), diff --git a/scripts/marketplace/check_registry_versions.py b/scripts/marketplace/check_registry_versions.py index 4a228569..ed65c921 100644 --- a/scripts/marketplace/check_registry_versions.py +++ b/scripts/marketplace/check_registry_versions.py @@ -49,7 +49,7 @@ def build_manifest_from_plugin(plugin: dict, bundle_block: dict | None) -> dict: "license": plugin.get("license"), "license_url": plugin.get("license_url"), "homepage": plugin.get("homepage"), - "repository": plugin.get("repository"), + "repository": plugin.get("repo"), "entrypoint": plugin["entrypoint"], "bundle": bundle_block, "compatibility": plugin.get("compatibility"), diff --git a/scripts/marketplace/test_build_registry.py b/scripts/marketplace/test_build_registry.py new file mode 100644 index 00000000..c375473b --- /dev/null +++ b/scripts/marketplace/test_build_registry.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python3 +# SPDX-FileCopyrightText: © 2025 StreamKit Contributors +# SPDX-License-Identifier: MPL-2.0 + +"""Unit tests for build_registry and check_registry_versions manifest builders.""" + +import importlib.util +import pathlib +import sys + +import pytest + +SCRIPTS_DIR = pathlib.Path(__file__).resolve().parent + +# Import build_registry module by path (it has no package structure). +_br_spec = importlib.util.spec_from_file_location( + "build_registry", SCRIPTS_DIR / "build_registry.py" +) +build_registry = importlib.util.module_from_spec(_br_spec) +_br_spec.loader.exec_module(build_registry) + +# Import check_registry_versions module by path. +_cr_spec = importlib.util.spec_from_file_location( + "check_registry_versions", SCRIPTS_DIR / "check_registry_versions.py" +) +check_registry_versions = importlib.util.module_from_spec(_cr_spec) +_cr_spec.loader.exec_module(check_registry_versions) + + +SAMPLE_PLUGIN = { + "id": "test-plugin", + "name": "Test Plugin", + "node_kind": "test_node", + "kind": "native", + "entrypoint": "libtest.so", + "description": "A test plugin", + "license": "MPL-2.0", + "repo": "https://github.com/streamer45/streamkit", +} + + +class TestBuildManifestRepoField: + """Regression tests for #307: plugin.yml uses ``repo`` not ``repository``.""" + + def test_build_manifest_maps_repo_to_repository(self): + manifest = build_registry.build_manifest(SAMPLE_PLUGIN, "1.0.0", bundle_block=None) + assert manifest["repository"] == "https://github.com/streamer45/streamkit" + + def test_check_registry_maps_repo_to_repository(self): + manifest = check_registry_versions.build_manifest_from_plugin( + SAMPLE_PLUGIN, bundle_block=None + ) + assert manifest["repository"] == "https://github.com/streamer45/streamkit" + + def test_build_manifest_omits_repository_when_repo_absent(self): + plugin = {k: v for k, v in SAMPLE_PLUGIN.items() if k != "repo"} + manifest = build_registry.build_manifest(plugin, "1.0.0", bundle_block=None) + assert "repository" not in manifest + + def test_check_registry_omits_repository_when_repo_absent(self): + plugin = {k: v for k, v in SAMPLE_PLUGIN.items() if k != "repo"} + manifest = check_registry_versions.build_manifest_from_plugin(plugin, bundle_block=None) + assert "repository" not in manifest From c17b0526280759cc90ee0921546509588c8cbe2a Mon Sep 17 00:00:00 2001 From: StreamKit Devin Date: Sat, 25 Apr 2026 15:17:19 +0000 Subject: [PATCH 2/2] fix: add missing repository field to parakeet 0.3.0 manifest The committed manifest was generated with the old buggy code that read plugin.get('repository') instead of plugin.get('repo'), so the field was always None and stripped. Update the manifest to match what the fixed build_registry.py would produce. Signed-off-by: StreamKit Devin Co-Authored-By: Claudio Costa --- docs/public/registry/plugins/parakeet/0.3.0/manifest.json | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/public/registry/plugins/parakeet/0.3.0/manifest.json b/docs/public/registry/plugins/parakeet/0.3.0/manifest.json index ea3af355..be0c2381 100644 --- a/docs/public/registry/plugins/parakeet/0.3.0/manifest.json +++ b/docs/public/registry/plugins/parakeet/0.3.0/manifest.json @@ -8,6 +8,7 @@ "description": "Fast speech-to-text using NVIDIA Parakeet TDT via sherpa-onnx", "license": "MPL-2.0", "homepage": "https://huggingface.co/nvidia/parakeet-tdt-0.6b-v3", + "repository": "https://github.com/streamer45/streamkit", "entrypoint": "libparakeet.so", "bundle": { "url": "https://github.com/streamer45/streamkit/releases/download/plugin-parakeet-v0.3.0/parakeet-0.3.0-bundle.tar.zst",