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

Update Smithy version dependency. #1623

Merged
merged 18 commits into from
Aug 19, 2022
Merged

Conversation

DavidOgunsAWS
Copy link
Contributor

@DavidOgunsAWS DavidOgunsAWS commented Aug 8, 2022

Motivation and Context

  • New major version of Smithy supporting IDLv2. AWS SDK code generator will soon need to support models in this version.

Description

  • Update the version dependency and a generated protocol test.

Testing

  • Built upcoming version of Smithy from IDL2 branch locally to VERSION 1.23.0 using ./gradlew clean build publishToMavenLocal smithy-cli:runtime
  • Made the changes in this PR to update the version of Smithy referenced in dependencies and ran: ./gradlew --refresh-dependencies clean codegen-test:test aws:sdk:assemble

To success.

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

A new generated diff is ready to view.

A new doc preview is ready to view.

@DavidOgunsAWS DavidOgunsAWS marked this pull request as ready for review August 12, 2022 18:23
@DavidOgunsAWS DavidOgunsAWS requested review from a team as code owners August 12, 2022 18:23
@david-perez
Copy link
Contributor

@DavidOgunsAWS You just have to remove those two tests from the list of tests that we expect to fail, and CI should pass. The tests were fixed upstream by @82marbag in smithy-lang/smithy#1319, so with this PR, they now pass. I noted this in #1590 (review).

Copy link
Collaborator

@jdisanti jdisanti left a comment

Choose a reason for hiding this comment

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

Mostly looks good to me. Just a couple questions.

CHANGELOG.next.toml Outdated Show resolved Hide resolved
@@ -61,7 +61,7 @@ structure CreateFooInput {}
</PrimitiveIntDocument>
""",
bodyMediaType: "application/xml",
params: { value: 1 }
params: { value: 1, requiredValue: 0 }
Copy link
Collaborator

Choose a reason for hiding this comment

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

The test description is: "Primitive ints should not be serialized when they are unset", so adding requiredValue to the params seems to break what is being tested. Are these tests still valid with Smithy IDL 2?

Copy link
Contributor Author

@DavidOgunsAWS DavidOgunsAWS Aug 16, 2022

Choose a reason for hiding this comment

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

Primitives are now just the type with a default value backing it. And default values should be serialized by the server, not by the client.

Perhaps this test needs refinement or is there an implementation & test change needed here?

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 the model for this test needs to be revised because it seems like the test isn't testing what it intended to test anymore. It seems like the requiredValue should get a default set on it rather than providing a value for it in the test case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The change I made was on the basis of understanding that old behavior around primitives and @required were kind of a wild west -- apparently not just for nullability, but also serialization. @default in 2.0 is where the behavior starts to be defined and predicted so I upgraded the test model to 2.0 and used that trait instead.

I don't believe there is anything further to be tested.

@github-actions
Copy link

A new generated diff is ready to view.

  • No codegen difference in the AWS SDK
  • No codegen difference in the Server Test
  • No codegen difference in the Server Test Python

A new doc preview is ready to view.

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.

4 participants