diff --git a/CHANGELOG.md b/CHANGELOG.md index 86150e6ba4..9e51b8d401 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,28 @@ +December 13th, 2023 +=================== + +December 11th, 2023 +=================== +**New this release:** +- :bug: (client, [smithy-rs#3305](https://github.com/smithy-lang/smithy-rs/issues/3305)) `crate::event_receiver::EventReceiver` is now re-exported as `crate::primitives::event_stream::EventReceiver` when a service supports event stream operations. + + +December 8th, 2023 +================== +**New this release:** +- :tada: (all, [smithy-rs#3121](https://github.com/smithy-lang/smithy-rs/issues/3121), [smithy-rs#3295](https://github.com/smithy-lang/smithy-rs/issues/3295)) All generated docs now include docsrs labels when features are required +- :bug: (client, [smithy-rs#3262](https://github.com/smithy-lang/smithy-rs/issues/3262)) Loading native TLS trusted certs for the default HTTP client now only occurs if the default HTTP client is not overridden in config. +- (client, [smithy-rs#3277](https://github.com/smithy-lang/smithy-rs/issues/3277)) Improve the error messages for when auth fails to select an auth scheme for a request. +- (client, [smithy-rs#3282](https://github.com/smithy-lang/smithy-rs/issues/3282)) Fix documentation and examples on HyperConnector and HyperClientBuilder. +- (client, [aws-sdk-rust#990](https://github.com/awslabs/aws-sdk-rust/issues/990), @declanvk) Expose local socket address from ConnectionMetadata. +- (all, [smithy-rs#3294](https://github.com/smithy-lang/smithy-rs/issues/3294)) [`Number`](https://docs.rs/aws-smithy-types/latest/aws_smithy_types/enum.Number.html) `TryInto` implementations now succesfully convert from `f64` to numeric types when no precision is lost. This fixes some deserialization issues where numbers like `25.0` were sent when `Byte` fields were expected. + +**Contributors** +Thank you for your contributions! ❤ +- @declanvk ([aws-sdk-rust#990](https://github.com/awslabs/aws-sdk-rust/issues/990)) + + December 1st, 2023 ================== **New this release:** diff --git a/CHANGELOG.next.toml b/CHANGELOG.next.toml index dcc8089443..92713f5cd4 100644 --- a/CHANGELOG.next.toml +++ b/CHANGELOG.next.toml @@ -11,93 +11,6 @@ # meta = { "breaking" = false, "tada" = false, "bug" = false, "target" = "client | server | all"} # author = "rcoh" -[[aws-sdk-rust]] -message = "Loading native TLS trusted certs for the default HTTP client now only occurs if the default HTTP client is not overridden in config." -references = ["smithy-rs#3262"] -meta = { "breaking" = false, "tada" = false, "bug" = true } -author = "jdisanti" - -[[smithy-rs]] -message = "Loading native TLS trusted certs for the default HTTP client now only occurs if the default HTTP client is not overridden in config." -references = ["smithy-rs#3262"] -meta = { "breaking" = false, "tada" = false, "bug" = true, "target" = "client" } -author = "jdisanti" - -[[aws-sdk-rust]] -message = """Client creation now takes microseconds instead of milliseconds. -Previously, it would take 2-3 milliseconds for each client instantiation due to time spent compiling regexes. -For applications that used several clients, this would increase start-up time in cases where it really matters, -such as for AWS Lambda cold starts. This time was improved by both changing regex implementation and caching the -result of the compilation.""" -references = ["aws-sdk-rust#975", "smithy-rs#3269"] -meta = { "breaking" = false, "tada" = true, "bug" = false } -author = "jdisanti" - -[[aws-sdk-rust]] -message = """Add `test_credentials` to `ConfigLoader` in `aws_config`. This allows the following pattern during tests: - -```rust -async fn main() { - let conf = aws_config::defaults(BehaviorVersion::latest()) - .test_credentials() - .await; -} -``` - -This is designed for unit tests and using local mocks like DynamoDB Local and LocalStack with the SDK. -""" -meta = { "breaking" = false, "tada" = true, "bug" = false } -author = "rcoh" -references = ["smithy-rs#3279", "aws-sdk-rust#971"] - -[[aws-sdk-rust]] -message = "Improve the error messages for when auth fails to select an auth scheme for a request." -references = ["aws-sdk-rust#979", "smithy-rs#3277"] -meta = { "breaking" = false, "tada" = false, "bug" = false } -author = "jdisanti" - -[[smithy-rs]] -message = "Improve the error messages for when auth fails to select an auth scheme for a request." -references = ["smithy-rs#3277"] -meta = { "breaking" = false, "tada" = false, "bug" = false, "target" = "client" } -author = "jdisanti" - -[[aws-sdk-rust]] -message = "Fix documentation and examples on HyperConnector and HyperClientBuilder." -references = ["aws-sdk-rust#986", "smithy-rs#3282"] -meta = { "breaking" = false, "tada" = false, "bug" = false } -author = "jdisanti" - -[[smithy-rs]] -message = "Fix documentation and examples on HyperConnector and HyperClientBuilder." -references = ["smithy-rs#3282"] -meta = { "breaking" = false, "tada" = false, "bug" = false, "target" = "client" } -author = "jdisanti" - -[[smithy-rs]] -message = "Expose local socket address from ConnectionMetadata." -references = ["aws-sdk-rust#990"] -meta = { "breaking" = false, "tada" = false, "bug" = false, "target" = "client" } -author = "declanvk" - -[[smithy-rs]] -message = "All generated docs now include docsrs labels when features are required" -references = ["smithy-rs#3121", "smithy-rs#3295"] -meta = { "breaking" = false, "tada" = true, "bug" = false, "target" = "all" } -author = "rcoh" - -[[aws-sdk-rust]] -message = "All generated docs now include docsrs labels when features are required" -references = ["smithy-rs#3121", "smithy-rs#3295"] -meta = { "breaking" = false, "tada" = true, "bug" = false } -author = "rcoh" - -[[smithy-rs]] -message = "[`Number`](https://docs.rs/aws-smithy-types/latest/aws_smithy_types/enum.Number.html) `TryInto` implementations now succesfully convert from `f64` to numeric types when no precision is lost. This fixes some deserialization issues where numbers like `25.0` were sent when `Byte` fields were expected." -references = ["smithy-rs#3294"] -meta = { "breaking" = false, "tada" = false, "bug" = false, "target" = "all" } -author = "rcoh" - [[smithy-rs]] message = "Add support for constructing [`SdkBody`] and [`ByteStream`] from `http-body` 1.0 bodies. Note that this is initial support and works via a backwards compatibility shim to http-body 0.4. Hyper 1.0 is not supported." references = ["smithy-rs#3300", "aws-sdk-rust#977"] diff --git a/aws/SDK_CHANGELOG.next.json b/aws/SDK_CHANGELOG.next.json index 8823e0a91a..89f683749d 100644 --- a/aws/SDK_CHANGELOG.next.json +++ b/aws/SDK_CHANGELOG.next.json @@ -6,7 +6,22 @@ "smithy-rs": [], "aws-sdk-rust": [ { - "message": "Make properties of S3Control PublicAccessBlockConfiguration optional. Previously, they defaulted to false, but this created invalid requests.", + "message": "Retry additional classes of H2 errors (H2 GoAway & H2 ResetStream)", + "meta": { + "bug": false, + "breaking": false, + "tada": false + }, + "author": "rcoh", + "references": [ + "aws-sdk-rust#738", + "aws-sdk-rust#858" + ], + "since-commit": "88970ba88ef45266aade152c7c1da8e90b24c0d7", + "age": 5 + }, + { + "message": "Make some properties for IoT types optional. Previously, they defaulted to false, but that isn't how the service actual works.", "meta": { "bug": true, "breaking": true, @@ -14,83 +29,143 @@ }, "author": "milesziemer", "references": [ - "smithy-rs#3246" + "smithy-rs#3256" ], - "since-commit": "e155c3048b9989fe406ef575d461ea01dfaf294c", + "since-commit": "88970ba88ef45266aade152c7c1da8e90b24c0d7", "age": 5 }, { - "message": "Allow `--` to be used in bucket names for S3", + "message": "Fix `config::Builder::set_credentials_provider` to override a credentials provider previously set.", "meta": { "bug": true, "breaking": false, "tada": false }, - "author": "rcoh", + "author": "ysaito1001", "references": [ - "smithy-rs#3253" + "aws-sdk-rust#973", + "smithy-rs#3278" ], - "since-commit": "48e3c95a3f10eebd5a637f8e7670c4232cdabbe4", + "since-commit": "529b3f03e2b945ea2e5e879183ccfd8e74b7377c", "age": 4 }, { - "message": "Retry additional classes of H2 errors (H2 GoAway & H2 ResetStream)", + "message": "`config::Config::credentials_provider` has been broken since `release-2023-11-15` and is now marked as `deprecated` explicitly.", "meta": { "bug": false, "breaking": false, "tada": false }, - "author": "rcoh", + "author": "ysaito1001", "references": [ - "aws-sdk-rust#738", - "aws-sdk-rust#858" + "smithy-rs#3251", + "smithy-rs#3278" ], - "since-commit": "88970ba88ef45266aade152c7c1da8e90b24c0d7", - "age": 2 + "since-commit": "529b3f03e2b945ea2e5e879183ccfd8e74b7377c", + "age": 4 }, { - "message": "Make some properties for IoT types optional. Previously, they defaulted to false, but that isn't how the service actual works.", + "message": "Loading native TLS trusted certs for the default HTTP client now only occurs if the default HTTP client is not overridden in config.", "meta": { "bug": true, - "breaking": true, + "breaking": false, "tada": false }, - "author": "milesziemer", + "author": "jdisanti", "references": [ - "smithy-rs#3256" + "smithy-rs#3262" ], - "since-commit": "88970ba88ef45266aade152c7c1da8e90b24c0d7", - "age": 2 + "since-commit": "fc335cbc87e70aa63895828fca55b51795b94a6c", + "age": 3 }, { - "message": "Fix `config::Builder::set_credentials_provider` to override a credentials provider previously set.", + "message": "Client creation now takes microseconds instead of milliseconds.\nPreviously, it would take 2-3 milliseconds for each client instantiation due to time spent compiling regexes.\nFor applications that used several clients, this would increase start-up time in cases where it really matters,\nsuch as for AWS Lambda cold starts. This time was improved by both changing regex implementation and caching the\nresult of the compilation.", "meta": { - "bug": true, + "bug": false, + "breaking": false, + "tada": true + }, + "author": "jdisanti", + "references": [ + "aws-sdk-rust#975", + "smithy-rs#3269" + ], + "since-commit": "fc335cbc87e70aa63895828fca55b51795b94a6c", + "age": 3 + }, + { + "message": "Add `test_credentials` to `ConfigLoader` in `aws_config`. This allows the following pattern during tests:\n\n```rust\nasync fn main() {\n let conf = aws_config::defaults(BehaviorVersion::latest())\n .test_credentials()\n .await;\n}\n```\n\nThis is designed for unit tests and using local mocks like DynamoDB Local and LocalStack with the SDK.\n", + "meta": { + "bug": false, + "breaking": false, + "tada": true + }, + "author": "rcoh", + "references": [ + "smithy-rs#3279", + "aws-sdk-rust#971" + ], + "since-commit": "fc335cbc87e70aa63895828fca55b51795b94a6c", + "age": 3 + }, + { + "message": "Improve the error messages for when auth fails to select an auth scheme for a request.", + "meta": { + "bug": false, "breaking": false, "tada": false }, - "author": "ysaito1001", + "author": "jdisanti", "references": [ - "aws-sdk-rust#973", - "smithy-rs#3278" + "aws-sdk-rust#979", + "smithy-rs#3277" ], - "since-commit": "529b3f03e2b945ea2e5e879183ccfd8e74b7377c", - "age": 1 + "since-commit": "fc335cbc87e70aa63895828fca55b51795b94a6c", + "age": 3 }, { - "message": "`config::Config::credentials_provider` has been broken since `release-2023-11-15` and is now marked as `deprecated` explicitly.", + "message": "Fix documentation and examples on HyperConnector and HyperClientBuilder.", "meta": { "bug": false, "breaking": false, "tada": false }, + "author": "jdisanti", + "references": [ + "aws-sdk-rust#986", + "smithy-rs#3282" + ], + "since-commit": "fc335cbc87e70aa63895828fca55b51795b94a6c", + "age": 3 + }, + { + "message": "All generated docs now include docsrs labels when features are required", + "meta": { + "bug": false, + "breaking": false, + "tada": true + }, + "author": "rcoh", + "references": [ + "smithy-rs#3121", + "smithy-rs#3295" + ], + "since-commit": "fc335cbc87e70aa63895828fca55b51795b94a6c", + "age": 3 + }, + { + "message": "`crate::event_receiver::EventReceiver` is now re-exported as `crate::primitives::event_stream::EventReceiver` when a service supports event stream operations.", + "meta": { + "bug": true, + "breaking": false, + "tada": false + }, "author": "ysaito1001", "references": [ - "smithy-rs#3251", - "smithy-rs#3278" + "smithy-rs#3305" ], - "since-commit": "529b3f03e2b945ea2e5e879183ccfd8e74b7377c", - "age": 1 + "since-commit": "9f0ba850e03241f657e2e40ca185780e0a5878cb", + "age": 2 } ], "aws-sdk-model": [] diff --git a/aws/sdk/integration-tests/transcribestreaming/tests/test.rs b/aws/sdk/integration-tests/transcribestreaming/tests/test.rs index 5178bd2ae9..5b761eba2c 100644 --- a/aws/sdk/integration-tests/transcribestreaming/tests/test.rs +++ b/aws/sdk/integration-tests/transcribestreaming/tests/test.rs @@ -7,6 +7,8 @@ use async_stream::stream; use aws_sdk_transcribestreaming::config::{Credentials, Region}; use aws_sdk_transcribestreaming::error::SdkError; use aws_sdk_transcribestreaming::operation::start_stream_transcription::StartStreamTranscriptionOutput; +#[allow(unused)] // making sure `EventReceiver` is re-exported +use aws_sdk_transcribestreaming::primitives::event_stream::EventReceiver; use aws_sdk_transcribestreaming::primitives::event_stream::{HeaderValue, Message}; use aws_sdk_transcribestreaming::primitives::Blob; use aws_sdk_transcribestreaming::types::error::{AudioStreamError, TranscriptResultStreamError}; diff --git a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/customizations/SmithyTypesPubUseExtra.kt b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/customizations/SmithyTypesPubUseExtra.kt index 2c8176e1e9..dac62172a8 100644 --- a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/customizations/SmithyTypesPubUseExtra.kt +++ b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/customizations/SmithyTypesPubUseExtra.kt @@ -14,6 +14,7 @@ import software.amazon.smithy.rust.codegen.core.rustlang.rustTemplate import software.amazon.smithy.rust.codegen.core.rustlang.writable import software.amazon.smithy.rust.codegen.core.smithy.CodegenContext import software.amazon.smithy.rust.codegen.core.smithy.RuntimeType +import software.amazon.smithy.rust.codegen.core.smithy.RuntimeType.Companion.eventReceiver import software.amazon.smithy.rust.codegen.core.smithy.RustCrate import software.amazon.smithy.rust.codegen.core.util.hasEventStreamMember import software.amazon.smithy.rust.codegen.core.util.hasEventStreamOperations @@ -101,11 +102,13 @@ fun pubUseSmithyPrimitivesEventStream( if (codegenContext.serviceShape.hasEventStreamOperations(model)) { rustTemplate( """ + pub use #{EventReceiver}; pub use #{Header}; pub use #{HeaderValue}; pub use #{Message}; pub use #{StrBytes}; """, + "EventReceiver" to eventReceiver(rc), "Header" to RuntimeType.smithyTypes(rc).resolve("event_stream::Header"), "HeaderValue" to RuntimeType.smithyTypes(rc).resolve("event_stream::HeaderValue"), "Message" to RuntimeType.smithyTypes(rc).resolve("event_stream::Message"), diff --git a/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/customizations/SmithyTypesPubUseExtraTest.kt b/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/customizations/SmithyTypesPubUseExtraTest.kt index 71bd51cf21..e320b9745a 100644 --- a/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/customizations/SmithyTypesPubUseExtraTest.kt +++ b/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/customizations/SmithyTypesPubUseExtraTest.kt @@ -10,7 +10,6 @@ import software.amazon.smithy.model.Model import software.amazon.smithy.rust.codegen.core.rustlang.RustWriter import software.amazon.smithy.rust.codegen.core.smithy.CodegenContext import software.amazon.smithy.rust.codegen.core.smithy.RustCrate -import software.amazon.smithy.rust.codegen.core.smithy.generators.StructureGeneratorTest.Companion.model import software.amazon.smithy.rust.codegen.core.testutil.asSmithyModel import software.amazon.smithy.rust.codegen.core.testutil.generatePluginContext import software.amazon.smithy.rust.codegen.core.testutil.testCodegenContext @@ -25,6 +24,11 @@ class SmithyTypesPubUseExtraTest { return """ namespace test + service TestService { + version: "123" + operations: [SomeOperation] + } + $additionalShape structure SomeStruct { } @@ -46,22 +50,23 @@ class SmithyTypesPubUseExtraTest { """.asSmithyModel() } - private val rustCrate: RustCrate - private val codegenContext: CodegenContext = testCodegenContext(model) + private fun initialize(model: Model): Pair { + val codegenContext = testCodegenContext(model) - init { val (context, _) = generatePluginContext( model, runtimeConfig = codegenContext.runtimeConfig, ) - rustCrate = + val rustCrate = RustCrate( context.fileManifest, codegenContext.symbolProvider, codegenContext.settings.codegenConfig, codegenContext.expectModuleDocProvider(), ) + + return Pair(codegenContext, rustCrate) } private fun reexportsWithEmptyModel() = reexportsWithMember() @@ -72,11 +77,12 @@ class SmithyTypesPubUseExtraTest { unionMember: String = "", additionalShape: String = "", ) = RustWriter.root().let { writer -> - pubUseSmithyPrimitives( - codegenContext, - modelWithMember(inputMember, outputMember, unionMember, additionalShape), - rustCrate, - )(writer) + val model = modelWithMember(inputMember, outputMember, unionMember, additionalShape) + val props = initialize(model) + val context = props.first + val rustCrate = props.second + pubUseSmithyPrimitives(context, model, rustCrate)(writer) + pubUseSmithyPrimitivesEventStream(context, model)(writer) writer.toString() } @@ -164,4 +170,26 @@ class SmithyTypesPubUseExtraTest { streamingTypes, ) } + + @Test + fun `it re-exports when a model has event stream`() { + val eventStreamTypes = + listOf( + "crate::event_receiver::EventReceiver", + "::aws_smithy_types::event_stream::Header", + "::aws_smithy_types::event_stream::HeaderValue", + "::aws_smithy_types::event_stream::Message", + "::aws_smithy_types::str_bytes::StrBytes", + ) + val eventStreamShape = "@streaming union EventStream { foo: SomeStruct }" + + assertHasReexports( + reexportsWithMember(additionalShape = eventStreamShape, inputMember = "m: EventStream"), + eventStreamTypes, + ) + assertHasReexports( + reexportsWithMember(additionalShape = eventStreamShape, outputMember = "m: EventStream"), + eventStreamTypes, + ) + } } diff --git a/gradle.properties b/gradle.properties index ce30214ca8..16d41e2d47 100644 --- a/gradle.properties +++ b/gradle.properties @@ -12,10 +12,10 @@ rust.msrv=1.72.1 org.gradle.jvmargs=-Xmx1024M # Version number to use for the generated stable runtime crates -smithy.rs.runtime.crate.stable.version=1.0.3 +smithy.rs.runtime.crate.stable.version=1.1.1 # Version number to use for the generated unstable runtime crates -smithy.rs.runtime.crate.unstable.version=0.60.0 +smithy.rs.runtime.crate.unstable.version=0.60.1 kotlin.code.style=official