Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(engine): remove unused routing ports from actions and update asset download logic #689

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions engine/docs/mdbook/src/action.md
Original file line number Diff line number Diff line change
Expand Up @@ -2078,7 +2078,6 @@ Action for first port forwarding for sub-workflows.
}
```
### Input Ports
* routingPort
### Output Ports
* default
### Category
Expand Down Expand Up @@ -2336,7 +2335,6 @@ Action for last port forwarding for sub-workflows.
### Input Ports
* default
### Output Ports
* routingPort
### Category
* System

Expand Down
4 changes: 2 additions & 2 deletions engine/runtime/runtime/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ impl ProcessorFactory for InputRouterFactory {
}

fn get_input_ports(&self) -> Vec<Port> {
vec![Port::new(ROUTING_PARAM_KEY)]
vec![]
}

fn get_output_ports(&self) -> Vec<Port> {
Expand Down Expand Up @@ -497,7 +497,7 @@ impl ProcessorFactory for OutputRouterFactory {
}

fn get_output_ports(&self) -> Vec<Port> {
vec![Port::new(ROUTING_PARAM_KEY)]
vec![]
miseyu marked this conversation as resolved.
Show resolved Hide resolved
}

fn build(
Expand Down
8 changes: 2 additions & 6 deletions engine/schema/actions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2086,9 +2086,7 @@
}
},
"builtin": true,
"inputPorts": [
"routingPort"
],
"inputPorts": [],
"outputPorts": [
"default"
],
Expand Down Expand Up @@ -2347,9 +2345,7 @@
"inputPorts": [
"default"
],
"outputPorts": [
"routingPort"
],
"outputPorts": [],
"categories": [
"System"
]
Expand Down
8 changes: 2 additions & 6 deletions engine/schema/actions_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2086,9 +2086,7 @@
}
},
"builtin": true,
"inputPorts": [
"routingPort"
],
"inputPorts": [],
"outputPorts": [
"default"
],
Expand Down Expand Up @@ -2347,9 +2345,7 @@
"inputPorts": [
"default"
],
"outputPorts": [
"routingPort"
],
"outputPorts": [],
"categories": [
"System"
]
Expand Down
8 changes: 2 additions & 6 deletions engine/schema/actions_es.json
Original file line number Diff line number Diff line change
Expand Up @@ -2086,9 +2086,7 @@
}
},
"builtin": true,
"inputPorts": [
"routingPort"
],
"inputPorts": [],
"outputPorts": [
"default"
],
Expand Down Expand Up @@ -2347,9 +2345,7 @@
"inputPorts": [
"default"
],
"outputPorts": [
"routingPort"
],
"outputPorts": [],
"categories": [
"System"
]
Expand Down
8 changes: 2 additions & 6 deletions engine/schema/actions_fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2086,9 +2086,7 @@
}
},
"builtin": true,
"inputPorts": [
"routingPort"
],
"inputPorts": [],
miseyu marked this conversation as resolved.
Show resolved Hide resolved
"outputPorts": [
"default"
],
Expand Down Expand Up @@ -2347,9 +2345,7 @@
"inputPorts": [
"default"
],
"outputPorts": [
"routingPort"
],
"outputPorts": [],
"categories": [
"System"
]
Expand Down
8 changes: 2 additions & 6 deletions engine/schema/actions_ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -2086,9 +2086,7 @@
}
},
"builtin": true,
"inputPorts": [
"routingPort"
],
"inputPorts": [],
"outputPorts": [
"default"
],
Expand Down Expand Up @@ -2347,9 +2345,7 @@
"inputPorts": [
"default"
],
"outputPorts": [
"routingPort"
],
"outputPorts": [],
"categories": [
"System"
]
Expand Down
8 changes: 2 additions & 6 deletions engine/schema/actions_zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -2086,9 +2086,7 @@
}
},
"builtin": true,
"inputPorts": [
"routingPort"
],
"inputPorts": [],
"outputPorts": [
"default"
],
Expand Down Expand Up @@ -2347,9 +2345,7 @@
"inputPorts": [
"default"
],
"outputPorts": [
"routingPort"
],
"outputPorts": [],
"categories": [
"System"
]
Expand Down
3 changes: 3 additions & 0 deletions engine/worker/src/asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
6 changes: 6 additions & 0 deletions engine/worker/src/types/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ pub struct Asset {
pub files: Vec<String>,
}

impl Asset {
pub fn is_empty(&self) -> bool {
self.files.is_empty()
}
}

#[derive(Serialize, Deserialize, Debug, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct AssetFile {
Expand Down
Loading