From 7a66ff79cf6130bd375873624f06a68ab1fd1376 Mon Sep 17 00:00:00 2001 From: streamkit-devin Date: Mon, 25 May 2026 14:35:04 +0000 Subject: [PATCH] fix(api): drop stale publish-no-media rule and pinning test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The publish-no-media rule was documented in the client_lint rustdoc but never implemented — its surface is already covered by the empty-tracks rule. The rustdoc was cleaned up in b5c2eae, but the pinning test remained. - Remove the publish_no_media_rule_is_not_emitted pinning test from client_lint.rs (no longer needed since the doc no longer claims the rule exists). - Rename test_lint_publish_no_media to test_lint_empty_tracks in tests.rs to match the actual rule it validates. Closes #473 Signed-off-by: streamkit-devin --- crates/api/src/yaml/client_lint.rs | 35 ------------------------------ crates/api/src/yaml/tests.rs | 2 +- 2 files changed, 1 insertion(+), 36 deletions(-) diff --git a/crates/api/src/yaml/client_lint.rs b/crates/api/src/yaml/client_lint.rs index 2e1cb808..a272f49f 100644 --- a/crates/api/src/yaml/client_lint.rs +++ b/crates/api/src/yaml/client_lint.rs @@ -588,38 +588,3 @@ pub fn lint_client_against_nodes( warnings } - -#[cfg(test)] -mod tests { - use super::*; - - // The `publish-no-media` rule documented at the top of this file is not - // implemented: `PublishConfig` has no `audio`/`video` boolean fields, - // only a `tracks` array. Pin the current behaviour so the rustdoc/code - // drift surfaces if anyone tries to revive the rule without re-reading - // the model. See PR description "Follow-ups / observations". - #[test] - fn publish_no_media_rule_is_not_emitted() { - let client = ClientSection { - gateway_path: Some("/gw".into()), - publish: Some(PublishConfig { - broadcast: "bcast".into(), - tracks: vec![PublishTrackConfig { - kind: TrackKind::Audio, - source: CaptureSource::Microphone, - broadcast: None, - width: None, - height: None, - codec: None, - max_bitrate: None, - }], - }), - ..ClientSection::default() - }; - let warnings = lint_client_section(&client, EngineMode::Dynamic); - assert!( - !warnings.iter().any(|w| w.rule == "publish-no-media"), - "unexpected `publish-no-media` warning: {warnings:?}" - ); - } -} diff --git a/crates/api/src/yaml/tests.rs b/crates/api/src/yaml/tests.rs index 6b52b150..ffea2b4c 100644 --- a/crates/api/src/yaml/tests.rs +++ b/crates/api/src/yaml/tests.rs @@ -844,7 +844,7 @@ fn test_lint_missing_gateway() { } #[test] -fn test_lint_publish_no_media() { +fn test_lint_empty_tracks() { let mut c = dynamic_client(); c.publish = Some(PublishConfig { broadcast: "x".into(), tracks: vec![] }); let warnings = lint_client_section(&c, EngineMode::Dynamic);