Skip to content

Commit

Permalink
feat: propagate step IDs (#465)
Browse files Browse the repository at this point in the history
  • Loading branch information
morgante authored Aug 17, 2024
1 parent f8024ca commit 08d2350
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
9 changes: 5 additions & 4 deletions crates/cli/src/result_formatting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -408,18 +408,19 @@ impl Messager for FormattedMessager<'_> {
let mut writer = writer.lock().map_err(|_| anyhow!("Output lock poisoned"))?;
writeln!(writer, "[{:?}] {}", log.level, log.message)?;
} else {
let msg = format!("[{:?}] {} {:?}", log.level, log.message, log.step_id);
match log.level {
AnalysisLogLevel::Debug => {
debug!("{}", log.message);
debug!("{}", msg);
}
AnalysisLogLevel::Info => {
info!("{}", log.message);
info!("{}", msg);
}
AnalysisLogLevel::Warn => {
warn!("{}", log.message);
warn!("{}", msg);
}
AnalysisLogLevel::Error => {
error!("{}", log.message);
error!("{}", msg);
}
}
}
Expand Down
1 change: 1 addition & 0 deletions crates/marzano_messenger/src/logs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ pub struct SimpleLogMessage {
pub message: String,
pub level: AnalysisLogLevel,
pub meta: Option<std::collections::HashMap<String, serde_json::Value>>,
pub step_id: String,
}
2 changes: 2 additions & 0 deletions crates/marzano_messenger/src/workflows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,13 @@ pub trait WorkflowMessenger: Messager {
pub struct SimpleWorkflowMessage {
pub kind: String,
pub message: serde_json::Value,
pub step_id: String,
}

/// Wrap match results to account for workflow logic and path normalization
#[derive(Debug, Serialize, Deserialize)]
pub struct WorkflowMatchResult {
pub result: MatchResult,
pub workspace_path: Option<PathBuf>,
pub step_id: String,
}

0 comments on commit 08d2350

Please sign in to comment.