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

Feature-gate uses of items from unstable crates in aws-smithy-types #3033

Closed
Tracked by #3019
ysaito1001 opened this issue Oct 5, 2023 · 0 comments
Closed
Tracked by #3019
Assignees

Comments

@ysaito1001
Copy link
Contributor

ysaito1001 commented Oct 5, 2023

http-body and hyper crates are currently exposed in public API for SdkBody and ByteStream.

By introducing a new creation method from_body to both types, we should be able to consolidate from_dyn and impl From<hyper::Body>, making the use of hyper an implementation detail so we don't need to expose hyper in public API. That's step number one.

Step number two is the http-body crate still needs to be feature-gated based on its version. By doing so we let customers opt-in to use a unstable version of the Body trait for SdkBody and ByteStream and avoid breaking backwards compatibility when http-body goes to 1.0.

github-merge-queue bot pushed a commit that referenced this issue Oct 17, 2023
## Motivation and Context
Takes care of the first part of
#3053 (the remaining part is
denoted as `TODO(runtimeCratesVersioningCleanup)` and until that and
#3033 are done the issue will
not be closed).

## Description
This PR moves from `aws-smithy-http` to `aws-smithy-types`:
- the `SdkBody` struct
- the `byte_stream` module

Within the origin crate, we leave "breadcrumbs" (i.e. reexports) for
existing customers of the items above so they are not broken by the
move.

We have just moved `SdkBody` to `aws-smithy-types` without renaming it
to see how it looks there. However, as
[TODO(naming)](https://github.com/awslabs/smithy-rs/pull/3026/files#diff-090c503b779024fdadb8ac97465c80438635df82e62c42b0d85b588a303d9a95R28)
says, we can choose to rename it to just `Body`. Curious to hear what
the reviewers think.

## Testing
Relied on the tests in CI.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._

---------

Co-authored-by: Russell Cohen <rcoh@amazon.com>
@ysaito1001 ysaito1001 self-assigned this Oct 23, 2023
github-merge-queue bot pushed a commit that referenced this issue Oct 25, 2023
…-types` (#3088)

## Motivation and Context
Implements #3033

## Description
This PR hides behind cargo features the third-party types from
`http-body` and `hyper` crates that are used in`aws-smithy-types`'
public API. Customers need to opt-in by enabling a cargo feature
`http-body-0-4-x` in `aws-smithy-types` to create an `SdkBody` or
`ByteStream` using those third-party types. For more details, please see
[the upgrade
guide](#3089).

As can been seen from code changes, to reduce the surface area where we
need to feature-gate things, we have fused the
`aws_smithy_types::body::Inner::Streaming` enum variant into
`aws_smithy_types::body::Inner::Dyn` variant, thereby removing
`SdkBody::from_dyn`.

## Testing
Relied on 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._

---------

Co-authored-by: Zelda Hessler <zhessler@amazon.com>
@rcoh rcoh closed this as completed Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants