Skip to content

Commit

Permalink
Upgrade to Smithy 1.39 (#2290)
Browse files Browse the repository at this point in the history
  • Loading branch information
isaiahvita authored Sep 27, 2023
1 parent 8c233fb commit 0ce99b9
Show file tree
Hide file tree
Showing 32 changed files with 2,256 additions and 111 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/codegen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
pull_request:
branches: [ main ]

env:
# get owner of the repository. used by forks.
SMITHY_GO_REPOSITORY: ${{ github.event.pull_request.head.repo.owner.login }}/smithy-go

jobs:
codegen-test:
name: SDK Codegen Test
Expand Down Expand Up @@ -38,17 +42,18 @@ jobs:
with:
go-version: ${{ matrix.go-version }}

- uses: actions/checkout@v2
with:
repository: aws/smithy-go
path: tmp-smithy-go
- name: Find smithy-go
shell: bash
env:
RUNNER_TMPDIR: ${{ runner.temp }}
run: ./ci-find-smithy-go.sh

- name: Build and publish smithy-go
working-directory: tmp-smithy-go
working-directory: ${{ runner.temp }}/smithy-go
run: make smithy-publish-local

- name: Cleanup smithy-go
run: rm -rf tmp-smithy-go
run: rm -rf ${{ runner.temp }}/smithy-go

- name: SDK Codegen
run: make smithy-generate
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:

env:
EACHMODULE_CONCURRENCY: 2
SMITHY_GO_REPOSITORY: ${{ vars.SMITHY_GO_REPOSITORY }}
SMITHY_GO_REPOSITORY: ${{ github.event.pull_request.head.repo.owner.login }}/smithy-go
GIT_PAT: ${{ secrets.CI_GIT_PAT}}

jobs:
Expand Down
2 changes: 1 addition & 1 deletion codegen/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
smithyVersion=1.37.0
smithyVersion=1.39.0
smithyGradleVersion=0.7.0
1 change: 1 addition & 0 deletions codegen/smithy-aws-go-codegen/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ dependencies {
api("software.amazon.smithy:smithy-aws-traits:$smithyVersion")
api("software.amazon.smithy:smithy-aws-iam-traits:$smithyVersion")
api("software.amazon.smithy:smithy-aws-cloudformation-traits:$smithyVersion")
api("software.amazon.smithy:smithy-aws-endpoints:$smithyVersion")
api("software.amazon.smithy:smithy-diff:$smithyVersion")
api("software.amazon.smithy.go:smithy-go-codegen:0.1.0")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.4.0")
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
import software.amazon.smithy.codegen.core.Symbol;
import software.amazon.smithy.go.codegen.SymbolUtils;
import software.amazon.smithy.go.codegen.endpoints.FnProvider;
import software.amazon.smithy.rulesengine.language.syntax.fn.FunctionDefinition;

import software.amazon.smithy.rulesengine.language.syntax.expressions.functions.FunctionDefinition;

public class AwsFnProvider implements FnProvider {
@Override
Expand All @@ -15,8 +14,8 @@ public Symbol fnFor(String name) {
case "aws.parseArn" -> SymbolUtils.createValueSymbolBuilder("ParseARN",
AwsGoDependency.AWS_ENDPOINT_RULESFN).build();
case "aws.isVirtualHostableS3Bucket" ->
SymbolUtils.createValueSymbolBuilder("IsVirtualHostableS3Bucket",
AwsGoDependency.AWS_ENDPOINT_RULESFN).build();
SymbolUtils.createValueSymbolBuilder("IsVirtualHostableS3Bucket",
AwsGoDependency.AWS_ENDPOINT_RULESFN).build();

default -> null;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ static void generateHttpProtocolTests(GenerationContext context) {
.operation(ShapeId.from("aws.protocoltests.restxml#PutWithContentEncoding"))
.addTestName("SDKAppliedContentEncoding_restXml")
.addTestName("SDKAppendedGzipAfterProvidedEncoding_restXml")
.build(),
HttpProtocolUnitTestGenerator.SkipTest.builder()
.service(ShapeId.from("aws.protocoltests.restxml#RestXml"))
.operation(ShapeId.from("aws.protocoltests.restxml#HttpPayloadWithUnion"))
.addTestName("RestXmlHttpPayloadWithUnion")
.addTestName("RestXmlHttpPayloadWithUnsetUnion")
.build()
));

Expand All @@ -158,6 +164,22 @@ static void generateHttpProtocolTests(GenerationContext context) {
.service(ShapeId.from("aws.protocoltests.restxml#RestXml"))
.operation(ShapeId.from("aws.protocoltests.restxml#HttpPrefixHeaders"))
.addTestName("HttpPrefixHeadersAreNotPresent")
.build(),

HttpProtocolUnitTestGenerator.SkipTest.builder()
.service(ShapeId.from("aws.protocoltests.restjson#RestJson"))
.operation(ShapeId.from("aws.protocoltests.restjson#JsonUnions"))
.addTestName("RestJsonDeserializeIgnoreType")
.build(),
HttpProtocolUnitTestGenerator.SkipTest.builder()
.service(ShapeId.from("aws.protocoltests.json10#JsonRpc10"))
.operation(ShapeId.from("aws.protocoltests.json10#JsonUnions"))
.addTestName("AwsJson10DeserializeIgnoreType")
.build(),
HttpProtocolUnitTestGenerator.SkipTest.builder()
.service(ShapeId.from("aws.protocoltests.json#JsonProtocol"))
.operation(ShapeId.from("aws.protocoltests.json#JsonUnions"))
.addTestName("AwsJson11DeserializeIgnoreType")
.build()
));

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

113 changes: 113 additions & 0 deletions internal/protocoltest/awsrestjson/api_op_HttpPayloadWithUnion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0ce99b9

Please sign in to comment.