Unverified Commit 882ebaf7 authored by ysaito1001's avatar ysaito1001 Committed by GitHub
Browse files

Avoid making `FsBuilder` aware of http-body version at interface level (#3101)

## Motivation and Context
Follow up on #3088

## Description
This PR reverts `ByteStream::read_with_body_0_4_from`,
`ByteStream::from_path_body_0_4`, and `ByteStream::from_file_body_0_4`
to the old names since from a customers' point of view, `FsBuilder`
should not mention anything about an `http-body` version at the API
level.

`FsBuilder` is currently an opt-in feature (with `rt-tokio` enabled) and
we make it tied to `http-body-0-4-x` by requiring `rt-tokio` including a
dependency on `http-body` version 0.4.x.

## Testing
Relied on the existing tests in CI

## Checklist
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
parent 78c23de8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -489,7 +489,7 @@ author = "rcoh"

[[smithy-rs]]
message = "Publicly exposed types from `http-body` and `hyper` crates within `aws-smithy-types` are now feature-gated. See the [upgrade guidance](https://github.com/awslabs/smithy-rs/discussions/3089) for details."
references = ["smithy-rs#3033", "smithy-rs#3088"]
references = ["smithy-rs#3033", "smithy-rs#3088", "smithy-rs#3101"]
meta = { "breaking" = true, "tada" = false, "bug" = false, "target" = "all" }
author = "ysaito1001"

+1 −1
Original line number Diff line number Diff line
@@ -269,7 +269,7 @@ mod tests {
        let crc32c_checksum = crc32c_checksum.finalize();

        let mut request = HttpRequest::new(
            ByteStream::read_with_body_0_4_from()
            ByteStream::read_from()
                .path(&file)
                .buffer_size(1024)
                .build()
+1 −5
Original line number Diff line number Diff line
@@ -21,11 +21,7 @@ async fn set_correct_headers() {
    let _resp = client
        .upload_archive()
        .vault_name("vault")
        .body(
            ByteStream::from_path_body_0_4("tests/test-file.txt")
                .await
                .unwrap(),
        )
        .body(ByteStream::from_path("tests/test-file.txt").await.unwrap())
        .send()
        .await;
    let req = handler.expect_request();
+1 −1
Original line number Diff line number Diff line
@@ -177,7 +177,7 @@ async fn test_checksum_on_streaming_request<'a>(
    use std::io::Write;
    file.write_all(body).unwrap();

    let body = aws_sdk_s3::primitives::ByteStream::read_with_body_0_4_from()
    let body = aws_sdk_s3::primitives::ByteStream::read_from()
        .path(file.path())
        .buffer_size(1024)
        .build()
+2 −2
Original line number Diff line number Diff line
@@ -71,12 +71,12 @@ class RequiredCustomizations : ClientCodegenDecorator {
    override fun extras(codegenContext: ClientCodegenContext, rustCrate: RustCrate) {
        val rc = codegenContext.runtimeConfig

        // Add rt-tokio and http-body-0-4-x features for `ByteStream::from_path_0_4`
        // Add rt-tokio feature for `ByteStream::from_path`
        rustCrate.mergeFeature(
            Feature(
                "rt-tokio",
                true,
                listOf("aws-smithy-async/rt-tokio", "aws-smithy-types/rt-tokio", "aws-smithy-types/http-body-0-4-x"),
                listOf("aws-smithy-async/rt-tokio", "aws-smithy-types/rt-tokio"),
            ),
        )

Loading