-
Notifications
You must be signed in to change notification settings - Fork 597
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
Add ApiGatewayExportsNullabilityExceptionIntegration #2056
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mtdowling
suggested changes
Mar 17, 2023
...urces/software/amazon/smithy/aws/typescript/codegen/customization/apigw_exports/schemas.json
Outdated
Show resolved
Hide resolved
...mithy/aws/go/codegen/customization/ApiGatewayExportsNullabilityExceptionIntegrationTest.java
Outdated
Show resolved
Hide resolved
...ization/apigw_exports_exceptions/com.amazonaws.amplifybackend#AmplifyBackend.exceptions.json
Outdated
Show resolved
Hide resolved
...stomization/apigw_exports_exceptions/com.amazonaws.apigatewayv2#ApiGatewayV2.exceptions.json
Outdated
Show resolved
Hide resolved
...ions/com.amazonaws.route53recoverycontrolconfig#Route53RecoveryControlConfig.exceptions.json
Outdated
Show resolved
Hide resolved
...on/smithy/aws/go/codegen/customization/ApiGatewayExportsNullabilityExceptionIntegration.java
Show resolved
Hide resolved
...on/smithy/aws/go/codegen/customization/ApiGatewayExportsNullabilityExceptionIntegration.java
Outdated
Show resolved
Hide resolved
...on/smithy/aws/go/codegen/customization/ApiGatewayExportsNullabilityExceptionIntegration.java
Outdated
Show resolved
Hide resolved
...on/smithy/aws/go/codegen/customization/ApiGatewayExportsNullabilityExceptionIntegration.java
Outdated
Show resolved
Hide resolved
syall
force-pushed
the
apigw-exports-nullability-breakfix
branch
2 times, most recently
from
March 20, 2023 23:48
67cc313
to
c48348f
Compare
syall
changed the title
Implement ApiGatewayExportsNullabilityExceptionIntegration
Add ApiGatewayExportsNullabilityExceptionIntegration
Mar 20, 2023
syall
force-pushed
the
apigw-exports-nullability-breakfix
branch
from
March 21, 2023 01:16
c48348f
to
e58b408
Compare
syall
commented
Mar 21, 2023
syall
commented
Mar 21, 2023
...go-codegen/src/test/resources/software/amazon/smithy/aws/typescript/codegen/serviceid.smithy
Outdated
Show resolved
Hide resolved
syall
force-pushed
the
apigw-exports-nullability-breakfix
branch
2 times, most recently
from
March 22, 2023 20:45
a2a4056
to
3c53a8d
Compare
mtdowling
reviewed
Mar 22, 2023
...on/smithy/aws/go/codegen/customization/ApiGatewayExportsNullabilityExceptionIntegration.java
Show resolved
Hide resolved
mtdowling
suggested changes
Mar 22, 2023
...on/smithy/aws/go/codegen/customization/ApiGatewayExportsNullabilityExceptionIntegration.java
Outdated
Show resolved
Hide resolved
...on/smithy/aws/go/codegen/customization/ApiGatewayExportsNullabilityExceptionIntegration.java
Outdated
Show resolved
Hide resolved
...on/smithy/aws/go/codegen/customization/ApiGatewayExportsNullabilityExceptionIntegration.java
Outdated
Show resolved
Hide resolved
...on/smithy/aws/go/codegen/customization/ApiGatewayExportsNullabilityExceptionIntegration.java
Show resolved
Hide resolved
...on/smithy/aws/go/codegen/customization/ApiGatewayExportsNullabilityExceptionIntegration.java
Outdated
Show resolved
Hide resolved
...on/smithy/aws/go/codegen/customization/ApiGatewayExportsNullabilityExceptionIntegration.java
Show resolved
Hide resolved
...on/smithy/aws/go/codegen/customization/ApiGatewayExportsNullabilityExceptionIntegration.java
Outdated
Show resolved
Hide resolved
...mithy/aws/go/codegen/customization/ApiGatewayExportsNullabilityExceptionIntegrationTest.java
Outdated
Show resolved
Hide resolved
syall
force-pushed
the
apigw-exports-nullability-breakfix
branch
from
March 22, 2023 23:43
3c53a8d
to
a3a9240
Compare
mtdowling
approved these changes
Mar 22, 2023
aajtodd
approved these changes
Mar 23, 2023
...on/smithy/aws/go/codegen/customization/ApiGatewayExportsNullabilityExceptionIntegration.java
Show resolved
Hide resolved
lucix-aws
approved these changes
Mar 23, 2023
Due to internal model fixes for API Gateway (APIGW) exports, certain shapes and members that target those shapes that used to have defaults became nullable. In order to not break the existing Go v2 client API nullability, this customization adds back default values for affected shapes: - Root Boolean shapes: false - Root Number shapes: 0 - Snapshotted Members shapes: inherit defaults The class of services affected are APIGW services and APIGW services that migrated to Smithy, seen in `APIGW_NULLABILITY_EXCEPTION_SERVICES`. A "snapshot" of root-level and member shapes are captured in `APIGW_exports_nullability_exceptions.json`, a mapping of service shape IDs to a list of affected root-level and member shapes. Cases: - Snapshotted Root level: - If a snapshotted root level shape doesn't exist, an exception will be thrown. - Otherwise, a default will be patched if a default doesn't already exist - Snapshotted Member level: - If a snapshotted member level shape doesn't exist, an exception will be thrown. - Otherwise, a default will be patched if a default doesn't already exist - Nonsnapshotted Member level: - All nonsnapshotted member level shape that target a snapshotted root level will be identified and throw an error. - This is prevent breaking changes if a nonsnapshotted member changes target from a snapshotted root shape to a nonsnapshotted root shape, as the SDK has no prior info on either shape.
This reverts commit d0e3c48.
This reverts commit c11c11b.
syall
force-pushed
the
apigw-exports-nullability-breakfix
branch
from
March 23, 2023 21:02
a3a9240
to
a3e2e7c
Compare
syall
commented
Mar 23, 2023
...oftware/amazon/smithy/aws/go/codegen/customization/APIGW_exports_nullability_exceptions.json
Show resolved
Hide resolved
mtdowling
approved these changes
Mar 23, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For changes to files under the
/codegen/aws-models
folder, and manual edits to autogenerated code (e.g./service/s3/api.go
) please create an Issue instead of a PR for those type of changes.N/A.
If the PR addresses an existing bug or feature, please reference it here.
N/A.
To help speed up the process and reduce the time to merge please ensure that
Allow edits by maintainers
is checked before submitting your PR. This will allow the project maintainers to make minor adjustments or improvements to the submitted PR, allow us to reduce the roundtrip time for merging your request.Overview
Due to internal model fixes for API Gateway (APIGW) exports, certain shapes
and members that target those shapes that used to have defaults became
nullable. In order to not break the existing Go v2 client API nullability,
this customization adds back default values for affected shapes:
The class of services affected are APIGW services and APIGW services that
migrated to Smithy, seen in
APIGW_NULLABILITY_EXCEPTION_SERVICES
.A "snapshot" of root-level and member shapes are captured in
APIGW_exports_nullability_exceptions.json
, a mapping of service shape IDsto a list of affected root-level and member shapes.
Cases:
thrown.
thrown.
will be identified and throw an error.
from a snapshotted root shape to a nonsnapshotted root shape, as the SDK
has no prior info on either shape.
Also removes
serviceid.smithy
which was not used anywhere.Testing
Surprisingly, Go v2 had NO codegen tests at all. This PR sets up the first codegen test.
ApiGatewayExportsNullabilityExceptionIntegrationTest
make generate
@default
traits from the affected service models:@default
traits from affected service models using thecrusher.js
scriptmake generate
and confirm no codegen changes (empty commit)@default
traits