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

re-add support for sourcing endpoint URLs from service-specific env config #3568

Merged
merged 10 commits into from
Apr 10, 2024

Conversation

Velfi
Copy link
Contributor

@Velfi Velfi commented Apr 8, 2024

The service env config work I did was flawed in that it didn't respect the precedence of programmatic config. This PR
adds a way of tracking the precedence up to the point of converting the SdkConfig into a service config. Now, env config will only be resolved when config was not set programmatically. I added tests to aws-config for the origin tracking to ensure it works.

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

Copy link

github-actions bot commented Apr 8, 2024

A new generated diff is ready to view.

  • AWS SDK (ignoring whitespace)
  • No codegen difference in the Client Test
  • No codegen difference in the Server Test
  • No codegen difference in the Server Test Python
  • No codegen difference in the Server Test Typescript

A new doc preview is ready to view.

Copy link

github-actions bot commented Apr 9, 2024

A new generated diff is ready to view.

  • AWS SDK (ignoring whitespace)
  • No codegen difference in the Client Test
  • No codegen difference in the Server Test
  • No codegen difference in the Server Test Python
  • No codegen difference in the Server Test Typescript

A new doc preview is ready to view.

@Velfi Velfi marked this pull request as ready for review April 9, 2024 16:22
@Velfi Velfi requested a review from a team as a code owner April 9, 2024 16:22
Copy link

github-actions bot commented Apr 9, 2024

A new generated diff is ready to view.

  • AWS SDK (ignoring whitespace)
  • No codegen difference in the Client Test
  • No codegen difference in the Server Test
  • No codegen difference in the Server Test Python
  • No codegen difference in the Server Test Typescript

A new doc preview is ready to view.

///
/// This is used internally to understand how to merge config structs while
/// respecting precedence of origins.
pub fn insert_origin(&mut self, setting: &'static str, origin: Origin) {
Copy link
Contributor

Choose a reason for hiding this comment

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

correctness: Do we want this to be mutable after it is built into SdkConfig?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question. I think so, but I'm not sure. For now, I'll make it so that:

  • SdkConfig's Builder exposes an insert_origin method.
  • SdkConfig itself only exposes a way to check origins.

We can add other stuff later if/when we need it.

aws/rust-runtime/aws-types/src/sdk_config.rs Show resolved Hide resolved
Copy link

github-actions bot commented Apr 9, 2024

A new generated diff is ready to view.

  • AWS SDK (ignoring whitespace)
  • No codegen difference in the Client Test
  • No codegen difference in the Server Test
  • No codegen difference in the Server Test Python
  • No codegen difference in the Server Test Typescript

A new doc preview is ready to view.

Copy link
Contributor

@ysaito1001 ysaito1001 left a comment

Choose a reason for hiding this comment

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

The changes look great. I'll probably go through one more round to be sure.

aws/rust-runtime/aws-config/src/lib.rs Show resolved Hide resolved
aws/rust-runtime/aws-types/Cargo.toml Outdated Show resolved Hide resolved
aws/rust-runtime/aws-types/src/origin.rs Outdated Show resolved Hide resolved
Copy link

github-actions bot commented Apr 9, 2024

A new generated diff is ready to view.

  • AWS SDK (ignoring whitespace)
  • No codegen difference in the Client Test
  • No codegen difference in the Server Test
  • No codegen difference in the Server Test Python
  • No codegen difference in the Server Test Typescript

A new doc preview is ready to view.

Copy link

A new generated diff is ready to view.

  • AWS SDK (ignoring whitespace)
  • No codegen difference in the Client Test
  • No codegen difference in the Server Test
  • No codegen difference in the Server Test Python
  • No codegen difference in the Server Test Typescript

A new doc preview is ready to view.

Copy link

A new generated diff is ready to view.

  • AWS SDK (ignoring whitespace)
  • No codegen difference in the Client Test
  • No codegen difference in the Server Test
  • No codegen difference in the Server Test Python
  • No codegen difference in the Server Test Typescript

A new doc preview is ready to view.

@ysaito1001
Copy link
Contributor

ysaito1001 commented Apr 10, 2024

Lastly, we probably need to have a changelog entry that revises or corrects release notes that we put out in https:/awslabs/aws-sdk-rust/releases/tag/release-2024-04-08 and the discussion topic, since the support is currently for endpoint url.

@Velfi
Copy link
Contributor Author

Velfi commented Apr 10, 2024

Lastly, we probably need to have a changelog entry that revises or corrects release notes that we put out in https:/awslabs/aws-sdk-rust/releases/tag/release-2024-04-08 and the discussion topic, since the support is currently for endpoint url.

I updated the discussion. I think the Changelog entry is fine:

🎉 (#3493) Users may now set service-specific configuration in the environment. For more information, see #3537.

@Velfi Velfi added this pull request to the merge queue Apr 10, 2024
Merged via the queue into main with commit d1bbd01 Apr 10, 2024
44 checks passed
@Velfi Velfi deleted the zhessler-env-endpoint-urls-attempt-2 branch April 10, 2024 16:08
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.

3 participants