-
Notifications
You must be signed in to change notification settings - Fork 192
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
Route::new in upgrade #1891
Route::new in upgrade #1891
Conversation
Move the creation of Routes in Upgradable to have a cleaner sequence of constraints in ServiceBuilder::build Signed-off-by: Daniele Ahmed <[email protected]>
@@ -152,7 +152,7 @@ class ServerServiceGeneratorV2( | |||
private val buildConstraints = operations.zip(builderOps).zip(extensionTypes).map { (first, exts) -> | |||
val (operation, type) = first | |||
// TODO(https://github.com/awslabs/smithy-rs/issues/1713#issue-1365169734): The `Error = Infallible` is an | |||
// excess requirement to stay at parity with existing builder. | |||
// excess requirement to stay at parity with existing builder. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: Formatter did this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did this because Intellij formats TODO lines if they are prefixed with a space, but can remove
Signed-off-by: Daniele Ahmed <[email protected]>
A new generated diff is ready to view.
A new doc preview is ready to view. |
|
||
// For `Route::new` for the resulting service | ||
<Pl::Layer as Layer<Upgrade<P, Op, Exts, B, Pl::Service>>>::Service: tower::Service<http::Request<B>, Error = std::convert::Infallible>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have tower::Service
and Infallible
imported here so we don't need tower::Service
and std::convert::Infallible
.
Same for line 261.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be worth adding a type alias to reduce the length of these.
Signed-off-by: Daniele Ahmed <[email protected]>
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
Signed-off-by: Daniele Ahmed <[email protected]>
cc78a64
to
b2b9272
Compare
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
Move the creation of Routes in Upgradable to have a cleaner sequence of constraints in ServiceBuilder::build
Signed-off-by: Daniele Ahmed [email protected]
Motivation and Context
ServiceBuilder::build()
is generated and used by customers and has one set of constraints like this one for each operation:The last three constraints are specific to how we handle services and should not be surfaced to customers.
Description
Move the creation of Routes in Upgradable and remove the constraints above. Each operation will have only one constraint:
Testing
Checklist
CHANGELOG.next.toml
if I made changes to the smithy-rs codegen or runtime cratesCHANGELOG.next.toml
if I made changes to the AWS SDK, generated SDK code, or SDK runtime cratesBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.