Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add canary for S3 Express (disabled by default until it's been released) #3462

Merged
merged 16 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions aws/rust-runtime/aws-inlineable/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ publish = false
repository = "https://github.com/smithy-lang/smithy-rs"

[dependencies]
# Used by lru, and this forces it to be a later version that avoids
# https://github.com/tkaitchuck/aHash/issues/200
# when built with `cargo update -Z minimal-versions`
ahash = "0.8.11"
aws-credential-types = { path = "../aws-credential-types" }
aws-runtime = { path = "../aws-runtime", features = ["http-02x"] }
aws-sigv4 = { path = "../aws-sigv4" }
Expand Down
4 changes: 3 additions & 1 deletion aws/rust-runtime/aws-inlineable/src/s3_express.rs
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,9 @@ pub(crate) mod identity_provider {
runtime_components: &'a RuntimeComponents,
config_bag: &'a ConfigBag,
) -> Result<SessionCredentials, BoxError> {
let mut config_builder = crate::config::Builder::from_config_bag(config_bag);
// TODO(Post S3Express release): Thread through `BehaviorVersion` from the outer S3 client
let mut config_builder = crate::config::Builder::from_config_bag(config_bag)
.behavior_version(crate::config::BehaviorVersion::latest());

// inherits all runtime components from a current S3 operation but clears out
// out interceptors configured for that operation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ class S3Decorator : ClientCodegenDecorator {
ShapeId.from("com.amazonaws.s3#CreateSessionOutput"),
// API returns GetObjectAttributes_Response_ instead of Output
ShapeId.from("com.amazonaws.s3#GetObjectAttributesOutput"),
// API returns ListAllMyDirectoryBucketsResult instead of ListDirectoryBucketsOutput
ShapeId.from("com.amazonaws.s3#ListDirectoryBucketsOutput"),
ysaito1001 marked this conversation as resolved.
Show resolved Hide resolved
)

override fun protocols(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,10 @@ private fun s3ExpressModule(runtimeConfig: RuntimeConfig) =

private fun s3ExpressDependencies(runtimeConfig: RuntimeConfig) =
arrayOf(
// Used by lru, and this forces it to be a later version that avoids
// https://github.com/tkaitchuck/aHash/issues/200
// when built with `cargo update -Z minimal-versions`
CargoDependency.AHash,
ysaito1001 marked this conversation as resolved.
Show resolved Hide resolved
AwsCargoDependency.awsCredentialTypes(runtimeConfig),
AwsCargoDependency.awsRuntime(runtimeConfig),
AwsCargoDependency.awsSigv4(runtimeConfig),
Expand Down
193 changes: 0 additions & 193 deletions aws/sdk/integration-tests/s3/tests/data/express/list-objects-v2.json

This file was deleted.

22 changes: 0 additions & 22 deletions aws/sdk/integration-tests/s3/tests/express.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,6 @@ where
aws_sdk_s3::Client::from_conf(update_builder(config).build())
}

// TODO(S3Express): Convert this test to the S3 express section in canary
#[tokio::test]
ysaito1001 marked this conversation as resolved.
Show resolved Hide resolved
async fn list_objects_v2() {
let _logs = capture_test_logs();

let http_client =
ReplayingClient::from_file("tests/data/express/list-objects-v2.json").unwrap();
let client = test_client(|b| b.http_client(http_client.clone())).await;

let result = client
.list_objects_v2()
.bucket("s3express-test-bucket--usw2-az1--x-s3")
.send()
.await;
dbg!(result).expect("success");

http_client
.validate_body_and_headers(Some(&["x-amz-s3session-token"]), "application/xml")
.await
.unwrap();
}

#[tokio::test]
async fn mixed_auths() {
let _logs = capture_test_logs();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,9 @@ data class CargoDependency(
}

companion object {
// Forces AHash to be a later version that avoids
// https://github.com/tkaitchuck/aHash/issues/200
val AHash: CargoDependency = CargoDependency("ahash", CratesIo("0.8.11"))
val OnceCell: CargoDependency = CargoDependency("once_cell", CratesIo("1.16"))
val Url: CargoDependency = CargoDependency("url", CratesIo("2.3.1"))
val Bytes: CargoDependency = CargoDependency("bytes", CratesIo("1.0.0"))
Expand Down
7 changes: 7 additions & 0 deletions tools/ci-cdk/canary-lambda/src/canary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ pub fn get_canaries_to_run(
.collect()
}

#[derive(Clone)]
pub struct CanaryEnv {
pub(crate) s3_bucket_name: String,
pub(crate) s3_mrap_bucket_arn: String,
pub(crate) s3_express_bucket_name: String,
pub(crate) expected_transcribe_result: String,
#[allow(dead_code)]
pub(crate) page_size: usize,
Expand All @@ -63,6 +65,7 @@ impl fmt::Debug for CanaryEnv {
f.debug_struct("CanaryEnv")
.field("s3_bucket_name", &"*** redacted ***")
.field("s3_mrap_bucket_arn", &"*** redacted ***")
.field("s3_express_bucket_name", &"*** redacted ***")
.field(
"expected_transcribe_result",
&self.expected_transcribe_result,
Expand All @@ -79,6 +82,9 @@ impl CanaryEnv {
// S3 MRAP bucket name to test against
let s3_mrap_bucket_arn =
env::var("CANARY_S3_MRAP_BUCKET_ARN").expect("CANARY_S3_MRAP_BUCKET_ARN must be set");
// S3 Express bucket name to test against
let s3_express_bucket_name = env::var("CANARY_S3_EXPRESS_BUCKET_NAME")
.expect("CANARY_S3_EXPRESS_BUCKET_NAME must be set");

// Expected transcription from Amazon Transcribe from the embedded audio file.
// This is an environment variable so that the code doesn't need to be changed if
Expand All @@ -97,6 +103,7 @@ impl CanaryEnv {
Self {
s3_bucket_name,
s3_mrap_bucket_arn,
s3_express_bucket_name,
expected_transcribe_result,
page_size,
}
Expand Down
Loading
Loading