From b8f80e44a71318ae5f801ed79f5cf45e99a5bbb5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 30 May 2026 20:37:12 +0000 Subject: [PATCH 1/2] Update Rust crate tucana to 0.0.72 --- Cargo.lock | 32 ++++++++++++++++++++++++++------ Cargo.toml | 2 +- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 51ef96e..9052d8b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -346,7 +346,7 @@ dependencies = [ "tokio", "tonic", "tonic-health", - "tucana", + "tucana 0.0.70", "walkdir", ] @@ -1072,7 +1072,7 @@ dependencies = [ "taurus-provider", "tokio", "tonic", - "tucana", + "tucana 0.0.72", ] [[package]] @@ -1855,7 +1855,7 @@ dependencies = [ "tokio", "tonic", "tonic-health", - "tucana", + "tucana 0.0.72", ] [[package]] @@ -1868,7 +1868,7 @@ dependencies = [ "log", "rand 0.10.1", "serde_json", - "tucana", + "tucana 0.0.72", "ureq", "uuid", ] @@ -1889,7 +1889,7 @@ dependencies = [ "tokio", "tonic", "tonic-health", - "tucana", + "tucana 0.0.72", ] [[package]] @@ -1914,7 +1914,7 @@ dependencies = [ "serde", "serde_json", "taurus-core", - "tucana", + "tucana 0.0.72", ] [[package]] @@ -2260,6 +2260,26 @@ dependencies = [ "tonic-prost-build", ] +[[package]] +name = "tucana" +version = "0.0.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc5513f2fc08c899ee75f2f4717a7c4af53269a80e76b2f1a331b3455544b1ef" +dependencies = [ + "pbjson", + "pbjson-build", + "pbjson-types", + "prost", + "prost-build", + "prost-types", + "serde", + "serde_json", + "tonic", + "tonic-build", + "tonic-prost", + "tonic-prost-build", +] + [[package]] name = "typenum" version = "1.19.0" diff --git a/Cargo.toml b/Cargo.toml index 7bd6c25..4659d1e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ edition = "2024" [workspace.dependencies] async-trait = "0.1.89" code0-flow = { version = "0.0.33" } -tucana = { version = "0.0.70" } +tucana = { version = "0.0.72" } tokio = { version = "1.44.1", features = ["rt-multi-thread", "signal"] } log = "0.4.27" futures-lite = "2.6.0" From e3dbd8c0d2f8095e438e26f7d4eb7239fa13d03d Mon Sep 17 00:00:00 2001 From: Raphael Date: Sat, 30 May 2026 23:11:41 +0200 Subject: [PATCH 2/2] feat: adjustments to latest tucana version --- crates/taurus-core/src/runtime/engine.rs | 4 +- .../src/runtime/engine/compiler.rs | 46 +++++++++++-------- 2 files changed, 30 insertions(+), 20 deletions(-) diff --git a/crates/taurus-core/src/runtime/engine.rs b/crates/taurus-core/src/runtime/engine.rs index 13cbc88..5c67a2e 100644 --- a/crates/taurus-core/src/runtime/engine.rs +++ b/crates/taurus-core/src/runtime/engine.rs @@ -262,11 +262,11 @@ mod tests { next_node_id: Option, ) -> NodeFunction { NodeFunction { - database_id, + database_id: Some(database_id), runtime_function_id: runtime_function_id.to_string(), parameters, next_node_id, - definition_source: "taurus".to_string(), + definition_source: Some("taurus".to_string()), } } diff --git a/crates/taurus-core/src/runtime/engine/compiler.rs b/crates/taurus-core/src/runtime/engine/compiler.rs index ef21b03..47d7eb4 100644 --- a/crates/taurus-core/src/runtime/engine/compiler.rs +++ b/crates/taurus-core/src/runtime/engine/compiler.rs @@ -14,6 +14,9 @@ use crate::{ #[derive(Debug)] pub enum CompileError { + NodeIdMissing { + node_index: usize, + }, DuplicateNodeId { node_id: i64, }, @@ -37,6 +40,11 @@ pub enum CompileError { impl CompileError { pub fn as_runtime_error(&self) -> RuntimeError { match self { + CompileError::NodeIdMissing { node_index } => RuntimeError::new( + "T-CORE-000100", + "FlowCompileError", + format!("Node at index {} is missing database id", node_index), + ), CompileError::DuplicateNodeId { node_id } => RuntimeError::new( "T-CORE-000101", "FlowCompileError", @@ -90,10 +98,12 @@ pub fn compile_flow( ) -> Result { let mut node_idx_by_id = HashMap::with_capacity(nodes.len()); for (idx, node) in nodes.iter().enumerate() { - if node_idx_by_id.insert(node.database_id, idx).is_some() { - return Err(CompileError::DuplicateNodeId { - node_id: node.database_id, - }); + let Some(node_id) = node.database_id else { + return Err(CompileError::NodeIdMissing { node_index: idx }); + }; + + if node_idx_by_id.insert(node_id, idx).is_some() { + return Err(CompileError::DuplicateNodeId { node_id }); } } @@ -108,12 +118,15 @@ pub fn compile_flow( let mut compiled_nodes = Vec::with_capacity(nodes.len()); for node in nodes { + let node_id = node + .database_id + .expect("compiler validates node database ids before compilation"); let next_idx = match node.next_node_id { Some(next_id) => match node_idx_by_id.get(&next_id).copied() { Some(idx) => Some(idx), None => { return Err(CompileError::NextNodeMissing { - node_id: node.database_id, + node_id, next_node_id: next_id, }); } @@ -127,13 +140,13 @@ pub fn compile_flow( for (parameter_index, parameter) in node.parameters.iter().enumerate() { let Some(node_value) = parameter.value.as_ref() else { return Err(CompileError::ParameterValueMissing { - node_id: node.database_id, + node_id, parameter_index, }); }; let Some(value) = node_value.value.as_ref() else { return Err(CompileError::ParameterValueMissing { - node_id: node.database_id, + node_id, parameter_index, }); }; @@ -155,7 +168,7 @@ pub fn compile_flow( } None => { return Err(CompileError::SubFlowExecutionReferenceMissing { - node_id: node.database_id, + node_id, parameter_index, }); } @@ -170,7 +183,7 @@ pub fn compile_flow( } compiled_nodes.push(CompiledNode { - id: node.database_id, + id: node_id, handler_id: node.runtime_function_id, execution_target, next_idx, @@ -186,14 +199,11 @@ pub fn compile_flow( } fn execution_target_for(node: &NodeFunction) -> NodeExecutionTarget { - if node.definition_source.is_empty() - || node.definition_source == "taurus" - || node.definition_source.starts_with("draco") - { - NodeExecutionTarget::Local - } else { - NodeExecutionTarget::Remote { - service: node.definition_source.clone(), - } + match node.definition_source.as_deref() { + None | Some("") | Some("taurus") => NodeExecutionTarget::Local, + Some(source) if source.starts_with("draco") => NodeExecutionTarget::Local, + Some(service) => NodeExecutionTarget::Remote { + service: service.to_string(), + }, } }