From becc76cf63b6782159860464d75afb3b520774be Mon Sep 17 00:00:00 2001 From: marshmallow Date: Wed, 6 May 2026 20:43:14 +1000 Subject: [PATCH] move keys @ preactivation immediately before activation --- crates/core/src/hive/plan.rs | 39 +++++++++++------------------------- 1 file changed, 12 insertions(+), 27 deletions(-) diff --git a/crates/core/src/hive/plan.rs b/crates/core/src/hive/plan.rs index 291ab368..4811e949 100644 --- a/crates/core/src/hive/plan.rs +++ b/crates/core/src/hive/plan.rs @@ -139,17 +139,6 @@ fn apply_plan( })); } - if !*no_keys - && matches!( - &goal, - ApplyGoal::Keys | ApplyGoal::SwitchToConfiguration(SwitchToConfigurationGoal::Switch) - ) - { - let (pre, post) = apply_plan_keys(args, node, &target); - steps.extend(pre); - end.extend(post); - } - if !matches!(goal, ApplyGoal::Keys) { steps.push(Step::Evaluate(Evaluate)); } @@ -184,6 +173,17 @@ fn apply_plan( })); } + if !*no_keys + && matches!( + &goal, + ApplyGoal::Keys | ApplyGoal::SwitchToConfiguration(SwitchToConfigurationGoal::Switch) + ) + { + let (pre, post) = apply_plan_keys(args, node, &target); + steps.extend(pre); + end.extend(post); + } + if let ApplyGoal::SwitchToConfiguration(goal) = goal { steps.push(Step::SwitchToConfiguration(SwitchToConfiguration { goal: *goal, @@ -303,22 +303,7 @@ mod tests { assert_eq!( plan.steps, - vec![ - Evaluate.into(), - Build { target: None }.into() // TODO: this was previously used in an old test, may lose - // coverage by deleting it. - // Ping { }.into(), - // PushKeyAgent { host_platform: "x86_64-linux".into(), substitute_on_destination: true, target: Target::default() }.into(), - // Keys { .. }.into(), - // crate::hive::steps::evaluate::Evaluate.into(), - // crate::hive::steps::build::Build { .. }.into(), - // crate::hive::steps::push::PushBuildOutput { .. }.into(), - // SwitchToConfiguration { .. }.into(), - // Keys { - // filter: UploadKeyAt::PostActivation - // } - // .into(), - ] + vec![Evaluate.into(), Build { target: None }.into()] ); }