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

aws-sdk-rust should be generatable even if some traits are not recognized #2104

Closed
rcoh opened this issue Dec 14, 2022 · 0 comments
Closed
Assignees
Labels
ops Improves our operations and release process sdk sdk-ga

Comments

@rcoh
Copy link
Collaborator

rcoh commented Dec 14, 2022

While the Rust SDK is currently in dev preview, new Smithy traits can break code generation by merely existing in the AWS models. For example, it couldn’t consume new models with new endpoints-related traits until we added the Smithy dependency that provided those trait classes, and this required a Smithy upgrade.

For us to continue generating the Rust SDK in spite of the existence of new Smithy traits, we need a way to ignore them.

@jdisanti jdisanti added ops Improves our operations and release process sdk sdk-ga labels Dec 14, 2022
@ysaito1001 ysaito1001 self-assigned this Feb 21, 2023
ysaito1001 added a commit that referenced this issue Apr 20, 2023
… to 1.29.0 as part of it) (#2547)

## Motivation and Context
Addresses #2104

## Description
This PR allows us to build `aws-sdk-rust` even with unknown traits
present in the AWS models. This requires `Smithy` 1.29.0 that includes
[support](smithy-lang/smithy#1685) for an extension
property,
[allowUnknownTraits](https://smithy.io/2.0/guides/building-models/gradle-plugin.html?highlight=allowunknowntraits#smithy-extension-properties).

## Testing
Manually added a unknown trait into an AWS model like so:
```
diff --git a/aws/sdk/aws-models/sts.json b/aws/sdk/aws-models/sts.json
--- a/aws/sdk/aws-models/sts.json
+++ b/aws/sdk/aws-models/sts.json
@@ -69,6 +69,7 @@
                 "aws.auth#sigv4": {
                     "name": "sts"
                 },
+                "aws.protocols#awsQuery2": {},
                 "aws.protocols#awsQuery": {},
```
and confirmed `/gradlew :aws:sdk:assemble` built SDK successfully. Also
verified that without `allowUnknownTraits = true` in
`aws/sdk/build.gradle.kts`, `/gradlew :aws:sdk:assemble` failed with the
above unknown trait.

----

_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: Yuki Saito <awsaito@amazon.com>
unexge pushed a commit that referenced this issue Apr 24, 2023
… to 1.29.0 as part of it) (#2547)

## Motivation and Context
Addresses #2104

## Description
This PR allows us to build `aws-sdk-rust` even with unknown traits
present in the AWS models. This requires `Smithy` 1.29.0 that includes
[support](smithy-lang/smithy#1685) for an extension
property,
[allowUnknownTraits](https://smithy.io/2.0/guides/building-models/gradle-plugin.html?highlight=allowunknowntraits#smithy-extension-properties).

## Testing
Manually added a unknown trait into an AWS model like so:
```
diff --git a/aws/sdk/aws-models/sts.json b/aws/sdk/aws-models/sts.json
--- a/aws/sdk/aws-models/sts.json
+++ b/aws/sdk/aws-models/sts.json
@@ -69,6 +69,7 @@
                 "aws.auth#sigv4": {
                     "name": "sts"
                 },
+                "aws.protocols#awsQuery2": {},
                 "aws.protocols#awsQuery": {},
```
and confirmed `/gradlew :aws:sdk:assemble` built SDK successfully. Also
verified that without `allowUnknownTraits = true` in
`aws/sdk/build.gradle.kts`, `/gradlew :aws:sdk:assemble` failed with the
above unknown trait.

----

_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: Yuki Saito <awsaito@amazon.com>
rcoh pushed a commit that referenced this issue Apr 24, 2023
… to 1.29.0 as part of it) (#2547)

## Motivation and Context
Addresses #2104

## Description
This PR allows us to build `aws-sdk-rust` even with unknown traits
present in the AWS models. This requires `Smithy` 1.29.0 that includes
[support](smithy-lang/smithy#1685) for an extension
property,
[allowUnknownTraits](https://smithy.io/2.0/guides/building-models/gradle-plugin.html?highlight=allowunknowntraits#smithy-extension-properties).

## Testing
Manually added a unknown trait into an AWS model like so:
```
diff --git a/aws/sdk/aws-models/sts.json b/aws/sdk/aws-models/sts.json
--- a/aws/sdk/aws-models/sts.json
+++ b/aws/sdk/aws-models/sts.json
@@ -69,6 +69,7 @@
                 "aws.auth#sigv4": {
                     "name": "sts"
                 },
+                "aws.protocols#awsQuery2": {},
                 "aws.protocols#awsQuery": {},
```
and confirmed `/gradlew :aws:sdk:assemble` built SDK successfully. Also
verified that without `allowUnknownTraits = true` in
`aws/sdk/build.gradle.kts`, `/gradlew :aws:sdk:assemble` failed with the
above unknown trait.

----

_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: Yuki Saito <awsaito@amazon.com>
@rcoh rcoh closed this as completed Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ops Improves our operations and release process sdk sdk-ga
Projects
None yet
Development

No branches or pull requests

3 participants