Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into davidpz/use-primiti…
Browse files Browse the repository at this point in the history
…ve-parse-in-the-server
  • Loading branch information
david-perez committed Apr 3, 2023
2 parents 72750b7 + f708076 commit 15b7574
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 26 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.next.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,9 @@ message = "Add support for omitting session token in canonical requests for SigV
references = ["smithy-rs#2473"]
meta = { "breaking" = false, "tada" = false, "bug" = false }
author = "martinjlowm"

[[aws-sdk-rust]]
message = "Add `into_segments` method to `AggregatedBytes`, for zero-copy conversions."
references = ["smithy-rs#2525"]
meta = { "breaking" = false, "tada" = false, "bug" = false }
author = "parker-timmerman"
23 changes: 5 additions & 18 deletions codegen-server-test/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,7 @@ val allCodegenTests = "../codegen-core/common-test-models".let { commonModels ->
"constraints",
imports = listOf("$commonModels/constraints.smithy"),
),
CodegenTest(
"aws.protocoltests.restjson#RestJson",
"rest_json",
// TODO(https://github.com/awslabs/smithy-rs/issues/1401) `@uniqueItems` is used.
extraConfig = """, "codegen": { "ignoreUnsupportedConstraints": true } """,
),
CodegenTest("aws.protocoltests.restjson#RestJson", "rest_json"),
CodegenTest(
"aws.protocoltests.restjson#RestJsonExtras",
"rest_json_extras",
Expand All @@ -75,26 +70,18 @@ val allCodegenTests = "../codegen-core/common-test-models".let { commonModels ->
CodegenTest(
"aws.protocoltests.restjson.validation#RestJsonValidation",
"rest_json_validation",
// `@range` trait is used on floating point shapes, which we deliberately don't want to support.
// See https://github.com/awslabs/smithy-rs/issues/1401.
extraConfig = """, "codegen": { "ignoreUnsupportedConstraints": true } """,
),
CodegenTest("aws.protocoltests.json10#JsonRpc10", "json_rpc10"),
CodegenTest(
"aws.protocoltests.json#JsonProtocol",
"json_rpc11",
extraConfig = """, "codegen": { "ignoreUnsupportedConstraints": true } """,
),
CodegenTest("aws.protocoltests.json#JsonProtocol", "json_rpc11"),
CodegenTest(
"aws.protocoltests.misc#MiscService",
"misc",
imports = listOf("$commonModels/misc.smithy"),
// TODO(https://github.com/awslabs/smithy-rs/issues/1401) `@uniqueItems` is used.
extraConfig = """, "codegen": { "ignoreUnsupportedConstraints": true } """,
),
CodegenTest(
"com.amazonaws.ebs#Ebs", "ebs",
imports = listOf("$commonModels/ebs.json"),
extraConfig = """, "codegen": { "ignoreUnsupportedConstraints": true } """,
),
CodegenTest("com.amazonaws.ebs#Ebs", "ebs", imports = listOf("$commonModels/ebs.json")),
CodegenTest("com.amazonaws.s3#AmazonS3", "s3"),
CodegenTest(
"com.aws.example.rust#PokemonService",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ fun validateUnsupportedConstraints(
.map { (shape, rangeTrait) -> UnsupportedRangeTraitOnShape(shape, rangeTrait as RangeTrait) }
.toSet()

// 5. `@uniqueItems` cannot reach a map shape.
// 4. `@uniqueItems` cannot reach a map shape.
// See https://github.com/awslabs/smithy/issues/1567.
val mapShapeReachableFromUniqueItemsListShapeSet = walker
.walkShapes(service)
Expand Down
5 changes: 5 additions & 0 deletions rust-runtime/aws-smithy-http/src/byte_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,11 @@ impl AggregatedBytes {
self.0.copy_to_bytes(self.0.remaining())
}

/// Convert this buffer into an [`Iterator`] of underlying non-contiguous segments of [`Bytes`]
pub fn into_segments(self) -> impl Iterator<Item = Bytes> {
self.0.into_inner().into_iter()
}

/// Convert this buffer into a `Vec<u8>`
pub fn to_vec(self) -> Vec<u8> {
self.0
Expand Down
1 change: 1 addition & 0 deletions tools/ci-build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ ARG rust_stable_version
ARG rust_nightly_version
RUN set -eux; \
yum -y install \
bc \
ca-certificates \
gcc \
git \
Expand Down
13 changes: 6 additions & 7 deletions tools/ci-scripts/check-only-aws-sdk-services
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ for test_dir in tests/*; do
fi
done

# TODO(CrateReorganization): Uncomment when cleaning up `enableNewCrateOrganizationScheme`
# large_file_count="$(find sdk -iname '*.rs' -type f -size +1M | wc -l | bc)"
# if [[ "${large_file_count}" != "0" ]]; then
# echo "Found ${large_file_count} generated code files larger than 1 MB:"
# find sdk -iname '*.rs' -type f -size +1M
# exit 1
# fi
large_file_count="$(find sdk -iname '*.rs' -type f -size +1M | wc -l | bc)"
if [[ "${large_file_count}" != "0" ]]; then
echo "Found ${large_file_count} generated code files larger than 1 MB:"
find sdk -iname '*.rs' -type f -size +1M
exit 1
fi

0 comments on commit 15b7574

Please sign in to comment.