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

Source sdk-partitions from the models instead of hardcoding #3292

Merged
merged 7 commits into from
Dec 20, 2023

Conversation

rcoh
Copy link
Collaborator

@rcoh rcoh commented Dec 7, 2023

Motivation and Context

Fixes #2836

This is required to gain access to hew partitions.

Description

  1. Update sync-models to sync from aws-sdk-rust. This location includes sdk-partitions.json
  2. Update aws:sdk gradle file to properly set this variable in codegen.
  3. Add an additional safeguard to ensure that the default hardcoded version is only used in tests and adhoc SDK generation.

Testing

  • Verify that adhoc assemble fails if you manually set the flag for a prod build

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

@rcoh rcoh requested review from a team as code owners December 7, 2023 16:16
Copy link

github-actions bot commented Dec 7, 2023

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.

/** Path to the `default-partitions.json` configuration */
val partitionsConfigPath: Path?
get() =
awsSdk?.getStringMember("partitionsConfigPath")?.orNull()?.value?.let { Paths.get(it) }

val productionSdkBuild: Boolean
Copy link
Collaborator

Choose a reason for hiding this comment

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

As this is being set to true in non-production builds, perhaps we should call it, "requirePartitionsJson"?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I guess "production" isn't the right word. I really mean "we're generating an AWS SDK" — I think we may want this in other places, e.g. we can remove the requirement for endpoint rules based on this flag instead of requiring customers to manually set the codegen flag.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we were using "generateReadme" for that purpose previously.

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.

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.

1. Update `sync-models` to sync from aws-sdk-rust. This location includes `sdk-partitions.json`
2. Update aws:sdk gradle file to properly set this variable in codegen./
3. Add an additional safeguard to ensure that the default hardcoded version is only used in tests and adhoc SDK generation.
Unify codegen flags behind a single "awsSdkBuild" flag. This is a singular flag to toggle "AWS mode" on and off. This also updates the sdk-codegen integration tests to be use this build mode to more closely reflect actual generated SDKs.
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.

@aws-sdk-rust-ci aws-sdk-rust-ci merged commit cfd8942 into main Dec 20, 2023
40 of 41 checks passed
@aws-sdk-rust-ci aws-sdk-rust-ci deleted the source-partitions-json branch December 20, 2023 20:34
@rcoh
Copy link
Collaborator Author

rcoh commented Dec 20, 2023

merged as bot because server changes are whitespace only

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.

Use partitions.json from aws-models
4 participants