diff --git a/crates/cli/tests/snapshots/run_node_test__inherits_moon_env_vars.snap b/crates/cli/tests/snapshots/run_node_test__inherits_moon_env_vars.snap index d0f06aad674..ffc9bdd73a3 100644 --- a/crates/cli/tests/snapshots/run_node_test__inherits_moon_env_vars.snap +++ b/crates/cli/tests/snapshots/run_node_test__inherits_moon_env_vars.snap @@ -12,7 +12,7 @@ MOON_PROJECT_ID=node MOON_PROJECT_ROOT=/base MOON_PROJECT_SNAPSHOT=/.moon/cache/states/node/snapshot.json MOON_PROJECT_SOURCE=base -MOON_RUNNING_ACTION=run-target +MOON_RUNNING_ACTION=run-task MOON_TARGET=node:envVarsMoon MOON_TOOLCHAIN_DIR=~/.proto MOON_WORKING_DIR= diff --git a/crates/cli/tests/snapshots/run_rust_test__inherits_moon_env_vars.snap b/crates/cli/tests/snapshots/run_rust_test__inherits_moon_env_vars.snap index 357a9e1044c..4cdfd4a9bd7 100644 --- a/crates/cli/tests/snapshots/run_rust_test__inherits_moon_env_vars.snap +++ b/crates/cli/tests/snapshots/run_rust_test__inherits_moon_env_vars.snap @@ -12,7 +12,7 @@ MOON_PROJECT_ID=rust MOON_PROJECT_ROOT= MOON_PROJECT_SNAPSHOT=/.moon/cache/states/rust/snapshot.json MOON_PROJECT_SOURCE=. -MOON_RUNNING_ACTION=run-target +MOON_RUNNING_ACTION=run-task MOON_TARGET=rust:envVarsMoon MOON_TOOLCHAIN_DIR=~/.proto MOON_WORKING_DIR= diff --git a/crates/cli/tests/snapshots/run_system_test__unix__inherits_moon_env_vars.snap b/crates/cli/tests/snapshots/run_system_test__unix__inherits_moon_env_vars.snap index a7b53256da3..e207b53c5ba 100644 --- a/crates/cli/tests/snapshots/run_system_test__unix__inherits_moon_env_vars.snap +++ b/crates/cli/tests/snapshots/run_system_test__unix__inherits_moon_env_vars.snap @@ -11,7 +11,7 @@ MOON_PROJECT_ID=unix MOON_PROJECT_ROOT=/unix MOON_PROJECT_SNAPSHOT=/.moon/cache/states/unix/snapshot.json MOON_PROJECT_SOURCE=unix -MOON_RUNNING_ACTION=run-target +MOON_RUNNING_ACTION=run-task MOON_TARGET=unix:envVarsMoon MOON_TOOLCHAIN_DIR=~/.proto MOON_WORKING_DIR= diff --git a/crates/core/action-pipeline/src/actions/mod.rs b/crates/core/action-pipeline/src/actions/mod.rs index 02145e2250c..b05f60452e2 100644 --- a/crates/core/action-pipeline/src/actions/mod.rs +++ b/crates/core/action-pipeline/src/actions/mod.rs @@ -1,7 +1,7 @@ use std::env; pub mod install_deps; -pub mod run_target; +pub mod run_task; pub mod setup_tool; pub mod sync_project; pub mod sync_workspace; @@ -30,13 +30,14 @@ fn matches_pattern(value: &str, pattern: &str) -> bool { let mut right = value.split(':'); return match ((left.next(), left.next()), (right.next(), right.next())) { + #[allow(clippy::nonminimal_bool)] ((Some(a1), Some(a2)), (Some(b1), Some(b2))) => { // foo:bar == foo:bar a1 == b1 && a2 == b2 || - // foo:bar == foo:* - a1 == b1 && b2 == "*" || - // foo:bar == *:bar - a2 == b2 && b1 == "*" + // foo:bar == foo:* + a1 == b1 && b2 == "*" || + // foo:bar == *:bar + a2 == b2 && b1 == "*" } ((Some(a1), Some(_)), (Some(b1), None)) => { // foo:bar == foo @@ -66,8 +67,8 @@ mod tests { assert!(!matches_pattern("rust", "node:20.0.0")); assert!(!matches_pattern("node:19.0.0", "node:20.0.0")); - assert!(matches_pattern("foo", "foo,bar")); - assert!(matches_pattern("bar", "foo,bar")); - assert!(!matches_pattern("baz", "foo,bar")); + assert!(matches_pattern("foo,bar", "foo")); + assert!(matches_pattern("foo,bar", "bar")); + assert!(!matches_pattern("foo,bar", "baz")); } } diff --git a/crates/core/action-pipeline/src/actions/run_target.rs b/crates/core/action-pipeline/src/actions/run_task.rs similarity index 96% rename from crates/core/action-pipeline/src/actions/run_target.rs rename to crates/core/action-pipeline/src/actions/run_task.rs index 3f256a457ba..ec6c9e1fa55 100644 --- a/crates/core/action-pipeline/src/actions/run_target.rs +++ b/crates/core/action-pipeline/src/actions/run_task.rs @@ -13,9 +13,9 @@ use std::env; use std::sync::Arc; use tokio::sync::RwLock; -const LOG_TARGET: &str = "moon:action:run-target"; +const LOG_TARGET: &str = "moon:action:run-task"; -pub async fn run_target( +pub async fn run_task( action: &mut Action, context: Arc>, emitter: Arc>, @@ -24,7 +24,7 @@ pub async fn run_target( target: &Target, runtime: &Runtime, ) -> miette::Result { - env::set_var("MOON_RUNNING_ACTION", "run-target"); + env::set_var("MOON_RUNNING_ACTION", "run-task"); let emitter = emitter.read().await; let workspace = workspace.read().await; @@ -33,7 +33,7 @@ pub async fn run_target( debug!( target: LOG_TARGET, - "Running target {}", + "Running task {}", color::label(&task.target) ); diff --git a/crates/core/action-pipeline/src/processor.rs b/crates/core/action-pipeline/src/processor.rs index cc939b1002e..af3ed5693a4 100644 --- a/crates/core/action-pipeline/src/processor.rs +++ b/crates/core/action-pipeline/src/processor.rs @@ -1,5 +1,5 @@ use crate::actions::install_deps::install_deps; -use crate::actions::run_target::run_target; +use crate::actions::run_task::run_task; use crate::actions::setup_tool::setup_tool; use crate::actions::sync_project::sync_project; use crate::actions::sync_workspace::sync_workspace; @@ -178,7 +178,7 @@ pub async fn process_action( local_emitter.emit(Event::TargetRunning { target }).await?; - let run_result = run_target( + let run_result = run_task( &mut action, context, emitter, diff --git a/crates/node/platform/src/actions/run_target.rs b/crates/node/platform/src/actions/run_target.rs index 8f34ed35770..94137aef49e 100644 --- a/crates/node/platform/src/actions/run_target.rs +++ b/crates/node/platform/src/actions/run_target.rs @@ -16,7 +16,7 @@ use rustc_hash::FxHashMap; use starbase_styles::color; use std::path::Path; -const LOG_TARGET: &str = "moon:node-platform:run-target"; +const LOG_TARGET: &str = "moon:node-platform:run-task"; fn create_node_options( node_config: &NodeConfig, diff --git a/website/src/utils/renderGraph.ts b/website/src/utils/renderGraph.ts index 6a6e0e8089f..cf91cd2385f 100644 --- a/website/src/utils/renderGraph.ts +++ b/website/src/utils/renderGraph.ts @@ -50,6 +50,13 @@ export function renderGraph(element: HTMLElement, graph: cytoscape.ElementsDefin width: 60, }, }, + { + selector: 'node[type="run-task"], node[type="sm"]', + style: { + // @ts-expect-error Types incorrect + 'background-gradient-stop-colors': '#6e58d1 #4a2ec6 #3b259e', + }, + }, { selector: 'node[type="run-target"], node[type="sm"]', style: {