From ef1e37d15b29b7c7d5c67fe14355439fd2a50d30 Mon Sep 17 00:00:00 2001 From: ysaito1001 Date: Fri, 15 Dec 2023 14:11:30 -0600 Subject: [PATCH] Revert "Allow downgrading smithy-rs versions (#3316)" This reverts commit 5a0e4344ad502b38eed93252216cfa4ae789c35f. --- .../src/subcommand/upgrade_runtime_crates_version.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/tools/ci-build/publisher/src/subcommand/upgrade_runtime_crates_version.rs b/tools/ci-build/publisher/src/subcommand/upgrade_runtime_crates_version.rs index 439dc52bf..f9df685bf 100644 --- a/tools/ci-build/publisher/src/subcommand/upgrade_runtime_crates_version.rs +++ b/tools/ci-build/publisher/src/subcommand/upgrade_runtime_crates_version.rs @@ -4,14 +4,13 @@ */ use crate::fs::Fs; -use anyhow::{anyhow, Context}; +use anyhow::{anyhow, bail, Context}; use clap::Parser; use once_cell::sync::Lazy; use regex::Regex; use smithy_rs_tool_common::package::PackageStability; use std::borrow::Cow; use std::path::{Path, PathBuf}; -use tracing::warn; static STABLE_VERSION_REGEX: Lazy = Lazy::new(|| { Regex::new( @@ -105,8 +104,7 @@ fn update_gradle_properties<'a>( // Special version tag used on the `main` branch && current_version != semver::Version::parse("0.0.0-smithy-rs-head").unwrap() { - // NOTE: do not backport this change to mainline during merge. - warn!("Moving from {current_version} to {upgraded_version} is a *downgrade*."); + bail!("Moving from {current_version} to {upgraded_version} would be a *downgrade*. This command doesn't allow it!"); } Ok(version_regex.replace(gradle_properties, format!("${{field}}{}", upgraded_version))) } @@ -189,9 +187,7 @@ mod tests { assert_eq!("smithy.rs.runtime.crate.stable.version=1.0.3", updated); } - // ignored: we are temporarily removing this safeguard #[test] - #[ignore] fn downgrading_stable_crate_should_be_caught_as_err() { let gradle_properties = "smithy.rs.runtime.crate.stable.version=1.0.2"; let version = semver::Version::new(1, 0, 1); @@ -201,9 +197,7 @@ mod tests { assert!(format!("{:?}", result).contains("downgrade")); } - // ignored: we are temporarily removing this safeguard #[test] - #[ignore] fn downgrading_unstable_crate_should_be_caught_as_err() { let gradle_properties = "smithy.rs.runtime.crate.unstable.version=0.57.1"; let version = semver::Version::new(0, 57, 0); -- GitLab