From 08a07d451ae03acae558a46e30733210bb751143 Mon Sep 17 00:00:00 2001 From: itowlson Date: Fri, 13 Feb 2026 11:23:45 +1300 Subject: [PATCH] `spin deploy`: no plugin specified is now hard error Signed-off-by: itowlson --- src/commands/cloud.rs | 15 +++++---------- src/commands/external.rs | 5 +---- tests/integration.rs | 24 ------------------------ 3 files changed, 6 insertions(+), 38 deletions(-) diff --git a/src/commands/cloud.rs b/src/commands/cloud.rs index 89099fc1c5..313f74d698 100644 --- a/src/commands/cloud.rs +++ b/src/commands/cloud.rs @@ -27,7 +27,7 @@ pub struct LoginCommand { } /// Transitional for compatibility: this will be removed as part of vendor-neutrality work. -const DEFAULT_DEPLOY_PLUGIN: &str = "cloud"; +const DEFAULT_DEPLOY_PLUGIN: &str = ""; /// The environment variable for setting the plugin to be used for operations relating /// to remote hosts. This allows the `spin deploy` and `spin login` shortcuts instead of @@ -60,20 +60,15 @@ fn deployment_plugin(cmd: &str) -> anyhow::Result { match std::env::var(DEPLOY_PLUGIN_ENV) { Ok(v) => Ok(v), Err(std::env::VarError::NotPresent) => { - terminal::ceprintln!(terminal::colors::bold_red(), "******** IMPORTANT! ********"); - terminal::ceprint!(terminal::colors::bold_red(), "Future breaking change: "); - eprintln!("`spin {cmd}` needs to be told which deployment plugin to use. Either:"); + terminal::error!( + "`spin {cmd}` needs to be told which deployment plugin to use. Either:" + ); terminal::step!( "*", "Run a plugin command (e.g. `spin {DEFAULT_DEPLOY_PLUGIN} {cmd}`); or" ); terminal::step!("*", "Set the `{DEPLOY_PLUGIN_ENV}` environment variable."); - eprintln!("For now, Spin will default to the `{DEFAULT_DEPLOY_PLUGIN}` plugin."); - terminal::ceprintln!( - terminal::colors::bold_red(), - "This will be a hard error in a future version." - ); - Ok(DEFAULT_DEPLOY_PLUGIN.to_string()) + anyhow::bail!("Unable to {cmd}"); } Err(_) => anyhow::bail!("{DEPLOY_PLUGIN_ENV} was defined but its value could not be read"), } diff --git a/src/commands/external.rs b/src/commands/external.rs index 40823e2ffe..fc15476053 100644 --- a/src/commands/external.rs +++ b/src/commands/external.rs @@ -37,10 +37,7 @@ fn parse_subcommand(mut cmd: Vec) -> anyhow::Result<(String, Vec )) } -const PREDEFINED_EXTERNALS: &[(&str, &str)] = &[( - "cloud", - "Commands for publishing applications to the Fermyon Cloud.", -)]; +const PREDEFINED_EXTERNALS: &[(&str, &str)] = &[]; pub fn predefined_externals() -> Vec<(String, String)> { PREDEFINED_EXTERNALS diff --git a/tests/integration.rs b/tests/integration.rs index 4a252c7cbf..408123a2d8 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -1154,30 +1154,6 @@ route = "/..." Ok(()) } - // TODO: Test on Windows - #[cfg(not(target_os = "windows"))] - #[test] - fn test_cloud_plugin_autoinstall() -> anyhow::Result<()> { - let env = test_environment::TestEnvironment::<()>::boot(ServicesConfig::none())?; - - let mut login = std::process::Command::new(spin_binary()); - login - .args(["login", "--help"]) - // Ensure that spin installs the plugins into the temporary directory - .env("SPIN_DATA_DIR", "./plugins"); - let output = env.run_in(&mut login)?; - - // Verify plugin successfully wrote to output file - assert!(std::str::from_utf8(&output.stdout)? - .trim() - .contains("The `cloud` plugin is required. Installing now.")); - // Ensure login help info is displayed - assert!(std::str::from_utf8(&output.stdout)? - .trim() - .contains("Log into Fermyon Cloud")); - Ok(()) - } - #[test] fn test_build_command() -> anyhow::Result<()> { do_test_build_command("tests/testcases/simple-build")