From 9330206fc8694a075395055c14bb9b39818a53b9 Mon Sep 17 00:00:00 2001 From: Yuji Mise Date: Wed, 11 Dec 2024 15:59:48 +0900 Subject: [PATCH] fix(engine): remove unused routing ports from actions and update asset download logic --- engine/docs/mdbook/src/action.md | 2 -- engine/runtime/runtime/src/node.rs | 4 ++-- engine/schema/actions.json | 8 ++------ engine/schema/actions_en.json | 8 ++------ engine/schema/actions_es.json | 8 ++------ engine/schema/actions_fr.json | 8 ++------ engine/schema/actions_ja.json | 8 ++------ engine/schema/actions_zh.json | 8 ++------ engine/worker/src/asset.rs | 3 +++ engine/worker/src/types/metadata.rs | 6 ++++++ 10 files changed, 23 insertions(+), 40 deletions(-) diff --git a/engine/docs/mdbook/src/action.md b/engine/docs/mdbook/src/action.md index 191f2fcd1..9f635223e 100644 --- a/engine/docs/mdbook/src/action.md +++ b/engine/docs/mdbook/src/action.md @@ -2078,7 +2078,6 @@ Action for first port forwarding for sub-workflows. } ``` ### Input Ports -* routingPort ### Output Ports * default ### Category @@ -2336,7 +2335,6 @@ Action for last port forwarding for sub-workflows. ### Input Ports * default ### Output Ports -* routingPort ### Category * System diff --git a/engine/runtime/runtime/src/node.rs b/engine/runtime/runtime/src/node.rs index 3e8d89899..12fc67ac8 100644 --- a/engine/runtime/runtime/src/node.rs +++ b/engine/runtime/runtime/src/node.rs @@ -411,7 +411,7 @@ impl ProcessorFactory for InputRouterFactory { } fn get_input_ports(&self) -> Vec { - vec![Port::new(ROUTING_PARAM_KEY)] + vec![] } fn get_output_ports(&self) -> Vec { @@ -497,7 +497,7 @@ impl ProcessorFactory for OutputRouterFactory { } fn get_output_ports(&self) -> Vec { - vec![Port::new(ROUTING_PARAM_KEY)] + vec![] } fn build( diff --git a/engine/schema/actions.json b/engine/schema/actions.json index 25bbde670..2c1faff85 100644 --- a/engine/schema/actions.json +++ b/engine/schema/actions.json @@ -2086,9 +2086,7 @@ } }, "builtin": true, - "inputPorts": [ - "routingPort" - ], + "inputPorts": [], "outputPorts": [ "default" ], @@ -2347,9 +2345,7 @@ "inputPorts": [ "default" ], - "outputPorts": [ - "routingPort" - ], + "outputPorts": [], "categories": [ "System" ] diff --git a/engine/schema/actions_en.json b/engine/schema/actions_en.json index 25bbde670..2c1faff85 100644 --- a/engine/schema/actions_en.json +++ b/engine/schema/actions_en.json @@ -2086,9 +2086,7 @@ } }, "builtin": true, - "inputPorts": [ - "routingPort" - ], + "inputPorts": [], "outputPorts": [ "default" ], @@ -2347,9 +2345,7 @@ "inputPorts": [ "default" ], - "outputPorts": [ - "routingPort" - ], + "outputPorts": [], "categories": [ "System" ] diff --git a/engine/schema/actions_es.json b/engine/schema/actions_es.json index a8d023bf0..faf9827ff 100644 --- a/engine/schema/actions_es.json +++ b/engine/schema/actions_es.json @@ -2086,9 +2086,7 @@ } }, "builtin": true, - "inputPorts": [ - "routingPort" - ], + "inputPorts": [], "outputPorts": [ "default" ], @@ -2347,9 +2345,7 @@ "inputPorts": [ "default" ], - "outputPorts": [ - "routingPort" - ], + "outputPorts": [], "categories": [ "System" ] diff --git a/engine/schema/actions_fr.json b/engine/schema/actions_fr.json index 01ce65831..d83383713 100644 --- a/engine/schema/actions_fr.json +++ b/engine/schema/actions_fr.json @@ -2086,9 +2086,7 @@ } }, "builtin": true, - "inputPorts": [ - "routingPort" - ], + "inputPorts": [], "outputPorts": [ "default" ], @@ -2347,9 +2345,7 @@ "inputPorts": [ "default" ], - "outputPorts": [ - "routingPort" - ], + "outputPorts": [], "categories": [ "System" ] diff --git a/engine/schema/actions_ja.json b/engine/schema/actions_ja.json index d0f8f2d05..821acf64f 100644 --- a/engine/schema/actions_ja.json +++ b/engine/schema/actions_ja.json @@ -2086,9 +2086,7 @@ } }, "builtin": true, - "inputPorts": [ - "routingPort" - ], + "inputPorts": [], "outputPorts": [ "default" ], @@ -2347,9 +2345,7 @@ "inputPorts": [ "default" ], - "outputPorts": [ - "routingPort" - ], + "outputPorts": [], "categories": [ "System" ] diff --git a/engine/schema/actions_zh.json b/engine/schema/actions_zh.json index 587e08059..1e262f32e 100644 --- a/engine/schema/actions_zh.json +++ b/engine/schema/actions_zh.json @@ -2086,9 +2086,7 @@ } }, "builtin": true, - "inputPorts": [ - "routingPort" - ], + "inputPorts": [], "outputPorts": [ "default" ], @@ -2347,9 +2345,7 @@ "inputPorts": [ "default" ], - "outputPorts": [ - "routingPort" - ], + "outputPorts": [], "categories": [ "System" ] diff --git a/engine/worker/src/asset.rs b/engine/worker/src/asset.rs index 44df7325d..2d6e33d93 100644 --- a/engine/worker/src/asset.rs +++ b/engine/worker/src/asset.rs @@ -11,6 +11,9 @@ pub(crate) async fn download_asset( asset: &Asset, download_path: &Uri, ) -> crate::errors::Result<()> { + if asset.is_empty() { + return Ok(()); + } let uris = asset .files .iter() diff --git a/engine/worker/src/types/metadata.rs b/engine/worker/src/types/metadata.rs index 0103521db..ce2748bc1 100644 --- a/engine/worker/src/types/metadata.rs +++ b/engine/worker/src/types/metadata.rs @@ -23,6 +23,12 @@ pub struct Asset { pub files: Vec, } +impl Asset { + pub fn is_empty(&self) -> bool { + self.files.is_empty() + } +} + #[derive(Serialize, Deserialize, Debug, JsonSchema)] #[serde(rename_all = "camelCase")] pub struct AssetFile {