From 6b36b1c7e9f120bbc8a9e7f9b2feb8492a1ad718 Mon Sep 17 00:00:00 2001 From: Ian Letourneau Date: Thu, 31 Jul 2025 09:24:05 -0400 Subject: [PATCH] rename some event attributes --- harmony/src/domain/instrumentation.rs | 10 +++++----- harmony/src/domain/maestro/mod.rs | 4 ++-- harmony/src/modules/k3d/install.rs | 4 ++-- harmony_cli/src/cli_logger.rs | 11 +++++++---- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/harmony/src/domain/instrumentation.rs b/harmony/src/domain/instrumentation.rs index d464f05..3d45722 100644 --- a/harmony/src/domain/instrumentation.rs +++ b/harmony/src/domain/instrumentation.rs @@ -2,26 +2,26 @@ use log::debug; use once_cell::sync::Lazy; use tokio::sync::broadcast; -use super::interpret::{InterpretError, InterpretStatus, Outcome}; +use super::interpret::{InterpretError, Outcome}; #[derive(Debug, Clone)] pub enum HarmonyEvent { HarmonyStarted, PrepareTopologyStarted { - name: String, + topology: String, }, TopologyPrepared { - name: String, + topology: String, outcome: Outcome, }, InterpretExecutionStarted { - name: String, topology: String, + interpret: String, message: String, }, InterpretExecutionFinished { topology: String, - name: String, + interpret: String, outcome: Result, }, } diff --git a/harmony/src/domain/maestro/mod.rs b/harmony/src/domain/maestro/mod.rs index 2fbf786..a7f2b60 100644 --- a/harmony/src/domain/maestro/mod.rs +++ b/harmony/src/domain/maestro/mod.rs @@ -43,14 +43,14 @@ impl Maestro { /// Delegates the readiness check and potential setup actions to the Topology. pub async fn prepare_topology(&self) -> Result { instrumentation::instrument(HarmonyEvent::PrepareTopologyStarted { - name: self.topology.name().to_string(), + topology: self.topology.name().to_string(), }) .unwrap(); let outcome = self.topology.ensure_ready().await?; instrumentation::instrument(HarmonyEvent::TopologyPrepared { - name: self.topology.name().to_string(), + topology: self.topology.name().to_string(), outcome: outcome.clone(), }) .unwrap(); diff --git a/harmony/src/modules/k3d/install.rs b/harmony/src/modules/k3d/install.rs index 36a0472..6441305 100644 --- a/harmony/src/modules/k3d/install.rs +++ b/harmony/src/modules/k3d/install.rs @@ -55,7 +55,7 @@ impl Interpret for K3dInstallationInterpret { ) -> Result { instrumentation::instrument(HarmonyEvent::InterpretExecutionStarted { topology: topology.name().into(), - name: "k3d-installation".into(), + interpret: "k3d-installation".into(), message: "installing k3d...".into(), }) .unwrap(); @@ -77,7 +77,7 @@ impl Interpret for K3dInstallationInterpret { instrumentation::instrument(HarmonyEvent::InterpretExecutionFinished { topology: topology.name().into(), - name: "k3d-installation".into(), + interpret: "k3d-installation".into(), outcome: outcome.clone(), }) .unwrap(); diff --git a/harmony_cli/src/cli_logger.rs b/harmony_cli/src/cli_logger.rs index d7f8b22..ebe8f09 100644 --- a/harmony_cli/src/cli_logger.rs +++ b/harmony_cli/src/cli_logger.rs @@ -47,14 +47,17 @@ async fn handle_events() { match event { HarmonyEvent::HarmonyStarted => {} - HarmonyEvent::PrepareTopologyStarted { name } => { + HarmonyEvent::PrepareTopologyStarted { topology: name } => { let section = progress::new_section(format!( "{} Preparing environment: {name}...", crate::theme::EMOJI_TOPOLOGY, )); (*sections).insert(name, section); } - HarmonyEvent::TopologyPrepared { name, outcome } => { + HarmonyEvent::TopologyPrepared { + topology: name, + outcome, + } => { let section = (*sections).get(&name).unwrap(); let progress = progress::add_spinner(section, "".into()); @@ -74,7 +77,7 @@ async fn handle_events() { } } HarmonyEvent::InterpretExecutionStarted { - name, + interpret: name, topology, message, } => { @@ -85,7 +88,7 @@ async fn handle_events() { } HarmonyEvent::InterpretExecutionFinished { topology, - name, + interpret: name, outcome, } => { let section = (*sections).get(&topology).unwrap();