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

Enable Endpoints 2.0 #2074

Merged
merged 21 commits into from
Dec 16, 2022
Merged

Enable Endpoints 2.0 #2074

merged 21 commits into from
Dec 16, 2022

Conversation

rcoh
Copy link
Collaborator

@rcoh rcoh commented Dec 7, 2022

Motivation and Context

  • Endpoints 2.0 #1784
  • enable endpoints 2.0
  • create the endpoint_url setter which is threaded into the Sdk::Config builtIn`
  • delete unused code, deprecate the old endpoint struct
  • update tests to use endpoint_url

Description

This PR enables Endpoints 2.0 for all services. For Smithy native clients, endpoints 2.0 is enabled but we haven't yet setup a default middleware that would make using that possible.

When endpoint rules are not defined & no resolver is provided, we currently will insert a resolver that always fails. A future PR will change this to panic on config construction but we will delay that until more refactoring and soaking has been done.

Testing

  • endpoint tests
  • existing tests pass

Future PRs will follow up with more integration tests

Checklist

  • I have updated CHANGELOG.next.toml if I made changes to the smithy-rs codegen or runtime crates
  • I have updated CHANGELOG.next.toml if I made changes to the AWS SDK, generated SDK code, or SDK 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.

@github-actions
Copy link

github-actions bot commented Dec 7, 2022

A new generated diff is ready to view.

A new doc preview is ready to view.

@github-actions
Copy link

github-actions bot commented Dec 8, 2022

A new generated diff is ready to view.

A new doc preview is ready to view.

@github-actions
Copy link

github-actions bot commented Dec 8, 2022

A new generated diff is ready to view.

A new doc preview is ready to view.

@github-actions
Copy link

github-actions bot commented Dec 8, 2022

A new generated diff is ready to view.

A new doc preview is ready to view.

@@ -4,6 +4,7 @@
*/

//! AWS SDK endpoint support.
#![allow(deprecated)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We expect to eventually remove the resolver fn right? If yes, we should create an issue and add a TODO here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, now that I think about it, perhaps we just need to create an issue that says "remove all deprecated code" that we pick up before GA


class AwsEndpointDecorator : RustCodegenDecorator<ClientProtocolGenerator, ClientCodegenContext> {
override val name: String = "AwsEndpoint"
override val order: Byte = 0
override val order: Byte = -100
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is giving me CSS Specificity flashbacks. Perhaps we should introduce a constant that represents "after everything else"?

(I think I got that order correct)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think we discussed "first", after, before, last

visitor.execute()
println("file:///$testDir/src/operation.rs")
return testDir
return clientIntegrationTest(model, additionalDecorators = listOf(codegenDecorator)) { _, _ -> }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does the { _, _ -> } at the end mean? Is that a closure that ignores two args and then does nothing? It looks so weird.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, normally it accepts a lambda. Let me put in a default arg for that, good idea.

@github-actions
Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

@rcoh rcoh force-pushed the enable-ep2 branch 2 times, most recently from e2a4c7f to a7b8f52 Compare December 12, 2022 17:33
@github-actions
Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

@rcoh rcoh marked this pull request as ready for review December 12, 2022 18:15
@rcoh rcoh requested review from a team as code owners December 12, 2022 18:15
@rcoh rcoh requested review from weihanglo and jjant December 12, 2022 18:15
@github-actions
Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

@github-actions
Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

@rcoh rcoh mentioned this pull request Dec 12, 2022
14 tasks
@github-actions
Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

@github-actions
Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

@github-actions
Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

@github-actions
Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

@github-actions
Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

@rcoh rcoh merged commit 29abdc9 into main Dec 16, 2022
@rcoh rcoh deleted the enable-ep2 branch December 16, 2022 17:56
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

Successfully merging this pull request may close these issues.

2 participants