Skip to content

Commit

Permalink
Fix Canary (#2016)
Browse files Browse the repository at this point in the history
* add: "release-2022-10-26" to canary runner PINNED_SMITHY_RS_VERSIONS
* update: canary-runner README.md
  • Loading branch information
Velfi authored Nov 28, 2022
1 parent ec9588b commit 9a4c1f3
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 17 deletions.
2 changes: 1 addition & 1 deletion tools/ci-cdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <version> --musl --cdk-outputs ../cdk-outputs.json
cargo run -- run --sdk-release-tag <version> --musl --cdk-outputs ../cdk-outputs.json
```

__NOTE:__ You may want to add a `--profile` to the `deploy` command to select a specific credential
Expand Down
19 changes: 11 additions & 8 deletions tools/ci-cdk/canary-runner/src/build_bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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.
Expand Down Expand Up @@ -251,12 +252,14 @@ pub async fn build_bundle(opt: BuildBundleArgs) -> Result<Option<PathBuf>> {

#[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());
Expand Down
21 changes: 13 additions & 8 deletions tools/ci-cdk/canary-runner/src/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,26 @@
// 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;
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
Expand All @@ -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
Expand Down

0 comments on commit 9a4c1f3

Please sign in to comment.