From c3f9a0a5ab8f05ae67b9e3eb433cf5b83362857b Mon Sep 17 00:00:00 2001 From: Raphael Date: Wed, 15 Apr 2026 18:00:44 +0200 Subject: [PATCH 1/4] feat: update service will return success --- src/flow_service/mod.rs | 48 ++++++++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/src/flow_service/mod.rs b/src/flow_service/mod.rs index 2202ea0..fce47f0 100644 --- a/src/flow_service/mod.rs +++ b/src/flow_service/mod.rs @@ -90,17 +90,18 @@ impl FlowUpdateService { self } - pub async fn send(&self) { - self.update_data_types().await; - self.update_runtime_functions().await; - self.update_functions().await; - self.update_flow_types().await; + pub async fn send(&self) -> bool { + let data_types_success = self.update_data_types().await; + let runtime_functions_success = self.update_runtime_functions().await; + let functions_success = self.update_functions().await; + let flow_types_success = self.update_flow_types().await; + data_types_success || runtime_functions_success || functions_success || flow_types_success } - async fn update_data_types(&self) { + async fn update_data_types(&self) -> bool { if self.data_types.is_empty() { log::info!("No DataTypes present."); - return; + return true; } log::info!("Updating {} DataTypes.", self.data_types.len()); @@ -115,21 +116,25 @@ impl FlowUpdateService { match client.update(request).await { Ok(response) => { + let res = response.into_inner(); log::info!( "Was the update of the DataTypes accepted by Sagittarius? {}", - response.into_inner().success + res.success ); + + res.success } Err(err) => { log::error!("Failed to update data types: {:?}", err); + false } } } - async fn update_functions(&self) { + async fn update_functions(&self) -> bool { if self.functions.is_empty() { log::info!("No FunctionDefinitions present."); - return; + return true; } log::info!("Updating {} FunctionDefinitions.", self.functions.len()); @@ -144,21 +149,24 @@ impl FlowUpdateService { match client.update(request).await { Ok(response) => { + let res = response.into_inner(); log::info!( "Was the update of the FunctionDefinitions accepted by Sagittarius? {}", - response.into_inner().success + res.success ); + res.success } Err(err) => { log::error!("Failed to update function definitions: {:?}", err); + false } } } - async fn update_runtime_functions(&self) { + async fn update_runtime_functions(&self) -> bool { if self.runtime_functions.is_empty() { log::info!("No RuntimeFunctionDefinitions present."); - return; + return true; } log::info!( @@ -176,21 +184,24 @@ impl FlowUpdateService { match client.update(request).await { Ok(response) => { + let res = response.into_inner(); log::info!( "Was the update of the RuntimeFunctionDefinitions accepted by Sagittarius? {}", - response.into_inner().success + res.success ); + res.success } Err(err) => { log::error!("Failed to update runtime function definitions: {:?}", err); + false } } } - async fn update_flow_types(&self) { + async fn update_flow_types(&self) -> bool { if self.flow_types.is_empty() { log::info!("No FlowTypes present."); - return; + return true; } log::info!("Updating {} FlowTypes.", self.flow_types.len()); @@ -205,13 +216,16 @@ impl FlowUpdateService { match client.update(request).await { Ok(response) => { + let res = response.into_inner(); log::info!( "Was the update of the FlowTypes accepted by Sagittarius? {}", - response.into_inner().success + res.success ); + res.success } Err(err) => { log::error!("Failed to update flow types: {:?}", err); + false } } } From f586a7b1155d5873688ead66b3e600a876af0fc0 Mon Sep 17 00:00:00 2001 From: Raphael Date: Wed, 15 Apr 2026 18:00:55 +0200 Subject: [PATCH 2/4] ref: cargo fmt --- src/flow_definition/feature/version.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/flow_definition/feature/version.rs b/src/flow_definition/feature/version.rs index 22fa106..51c0f76 100644 --- a/src/flow_definition/feature/version.rs +++ b/src/flow_definition/feature/version.rs @@ -4,9 +4,7 @@ pub trait HasVersion { fn version(&self) -> &String; fn is_accepted(&self, filter: &Option) -> bool { - filter - .as_ref() - .is_none_or(|v| self.version() == v) + filter.as_ref().is_none_or(|v| self.version() == v) } } From 091b35a1400c762c06787d51c0f74897cd5ab9b0 Mon Sep 17 00:00:00 2001 From: Raphael Date: Wed, 15 Apr 2026 18:06:41 +0200 Subject: [PATCH 3/4] fix: all bools must be true --- src/flow_service/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/flow_service/mod.rs b/src/flow_service/mod.rs index fce47f0..afea172 100644 --- a/src/flow_service/mod.rs +++ b/src/flow_service/mod.rs @@ -95,7 +95,7 @@ impl FlowUpdateService { let runtime_functions_success = self.update_runtime_functions().await; let functions_success = self.update_functions().await; let flow_types_success = self.update_flow_types().await; - data_types_success || runtime_functions_success || functions_success || flow_types_success + data_types_success && runtime_functions_success && functions_success && flow_types_success } async fn update_data_types(&self) -> bool { From 868c3ca97614acd39c218e147090e57ad875b658 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raphael=20G=C3=B6tz?= <52959657+raphael-goetz@users.noreply.github.com> Date: Wed, 15 Apr 2026 18:12:12 +0200 Subject: [PATCH 4/4] Update src/flow_service/mod.rs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Raphael Götz <52959657+raphael-goetz@users.noreply.github.com> --- src/flow_service/mod.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/flow_service/mod.rs b/src/flow_service/mod.rs index afea172..1dc35c0 100644 --- a/src/flow_service/mod.rs +++ b/src/flow_service/mod.rs @@ -90,7 +90,11 @@ impl FlowUpdateService { self } - pub async fn send(&self) -> bool { + pub async fn send(&self) { + let _ = self.send_with_status().await; + } + + pub async fn send_with_status(&self) -> bool { let data_types_success = self.update_data_types().await; let runtime_functions_success = self.update_runtime_functions().await; let functions_success = self.update_functions().await;