From 9a4c1f304f6f5237d480cfb56dad2951d927d424 Mon Sep 17 00:00:00 2001 From: Zelda Hessler Date: Mon, 28 Nov 2022 16:42:40 -0600 Subject: [PATCH] Fix Canary (#2016) * add: "release-2022-10-26" to canary runner PINNED_SMITHY_RS_VERSIONS * update: canary-runner README.md --- tools/ci-cdk/README.md | 2 +- .../ci-cdk/canary-runner/src/build_bundle.rs | 19 ++++++++++------- tools/ci-cdk/canary-runner/src/run.rs | 21 ++++++++++++------- 3 files changed, 25 insertions(+), 17 deletions(-) diff --git a/tools/ci-cdk/README.md b/tools/ci-cdk/README.md index 1333af37f9..31c4a2fc6e 100644 --- a/tools/ci-cdk/README.md +++ b/tools/ci-cdk/README.md @@ -21,7 +21,7 @@ From there, you can just point the `canary-runner` to the `cdk-outputs.json` to ```bash cd canary-runner -cargo run -- --sdk-version --musl --cdk-outputs ../cdk-outputs.json +cargo run -- run --sdk-release-tag --musl --cdk-outputs ../cdk-outputs.json ``` __NOTE:__ You may want to add a `--profile` to the `deploy` command to select a specific credential diff --git a/tools/ci-cdk/canary-runner/src/build_bundle.rs b/tools/ci-cdk/canary-runner/src/build_bundle.rs index 7a47c96bae..4f31d75d9c 100644 --- a/tools/ci-cdk/canary-runner/src/build_bundle.rs +++ b/tools/ci-cdk/canary-runner/src/build_bundle.rs @@ -3,6 +3,13 @@ * SPDX-License-Identifier: Apache-2.0 */ +use std::fmt::Write as FmtWrite; +use std::fs; +use std::io::Write as IoWrite; +use std::path::{Path, PathBuf}; +use std::process::Command; +use std::str::FromStr; + use anyhow::{bail, Context, Result}; use clap::Parser; use lazy_static::lazy_static; @@ -11,12 +18,6 @@ use smithy_rs_tool_common::here; use smithy_rs_tool_common::release_tag::ReleaseTag; use smithy_rs_tool_common::shell::handle_failure; use smithy_rs_tool_common::versions_manifest::VersionsManifest; -use std::fmt::Write as FmtWrite; -use std::fs; -use std::io::Write as IoWrite; -use std::path::{Path, PathBuf}; -use std::process::Command; -use std::str::FromStr; const BASE_MANIFEST: &str = r#" # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. @@ -251,12 +252,14 @@ pub async fn build_bundle(opt: BuildBundleArgs) -> Result> { #[cfg(test)] mod tests { - use super::*; - use crate::Args; use clap::Parser; use smithy_rs_tool_common::package::PackageCategory; use smithy_rs_tool_common::versions_manifest::CrateVersion; + use crate::Args; + + use super::*; + #[test] fn test_arg_parsing() { assert!(Args::try_parse_from(["./canary-runner", "build-bundle"]).is_err()); diff --git a/tools/ci-cdk/canary-runner/src/run.rs b/tools/ci-cdk/canary-runner/src/run.rs index 19d6048720..c5bafc6c16 100644 --- a/tools/ci-cdk/canary-runner/src/run.rs +++ b/tools/ci-cdk/canary-runner/src/run.rs @@ -14,11 +14,12 @@ // CAUTION: This subcommand will `git reset --hard` in some cases. Don't ever run // it against a smithy-rs repo that you're actively working in. -use crate::build_bundle::BuildBundleArgs; +use std::path::PathBuf; +use std::str::FromStr; +use std::time::{Duration, SystemTime}; +use std::{env, path::Path}; + use anyhow::{bail, Context, Result}; -use aws_sdk_cloudwatch as cloudwatch; -use aws_sdk_lambda as lambda; -use aws_sdk_s3 as s3; use clap::Parser; use cloudwatch::model::StandardUnit; use s3::types::ByteStream; @@ -26,12 +27,13 @@ use serde::Deserialize; use smithy_rs_tool_common::git::{find_git_repository_root, Git, GitCLI}; use smithy_rs_tool_common::macros::here; use smithy_rs_tool_common::release_tag::ReleaseTag; -use std::path::PathBuf; -use std::str::FromStr; -use std::time::{Duration, SystemTime}; -use std::{env, path::Path}; use tracing::info; +use crate::build_bundle::BuildBundleArgs; + +use aws_sdk_cloudwatch as cloudwatch; +use aws_sdk_lambda as lambda; +use aws_sdk_s3 as s3; lazy_static::lazy_static! { // Occasionally, a breaking change introduced in smithy-rs will cause the canary to fail // for older versions of the SDK since the canary is in the smithy-rs repository and will @@ -45,6 +47,9 @@ lazy_static::lazy_static! { // Versions <= 0.6.0 no longer compile against the canary after this commit in smithy-rs // due to the breaking change in https://github.com/awslabs/smithy-rs/pull/1085 (ReleaseTag::from_str("v0.6.0").unwrap(), "d48c234796a16d518ca9e1dda5c7a1da4904318c"), + // Versions <= release-2022-10-26 no longer compile against the canary after this commit in smithy-rs + // due to the s3 canary update in https://github.com/awslabs/smithy-rs/pull/1974 + (ReleaseTag::from_str("release-2022-10-26").unwrap(), "3e24477ae7a0a2b3853962a064bc8333a016af54") ]; pinned.sort(); pinned