Skip to content

Commit 5a2dbd4

Browse files
author
Zelda Hessler
authored
fix various small issues (#3056)
This fixes some pre-commit issues and updates the gradle builds to fix a deprecated thing where I was sure it wouldn't break anything. ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._
1 parent 3b6f886 commit 5a2dbd4

File tree

15 files changed

+89
-91
lines changed

15 files changed

+89
-91
lines changed

.github/workflows/ci-tls.yml

Lines changed: 59 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -20,62 +20,62 @@ jobs:
2020
name: Verify TLS configuration
2121
runs-on: ubuntu-latest
2222
steps:
23-
- name: Install packages
24-
shell: bash
25-
run: |
26-
sudo apt-get update
27-
sudo apt-get -y install gcc make python3-pip nginx git ruby openjdk-17-jre pkg-config libssl-dev faketime
28-
pip3 install certbuilder crlbuilder
29-
- name: Stop nginx
30-
run: sudo systemctl stop nginx
31-
- name: Checkout smithy-rs
32-
uses: actions/checkout@v3
33-
with:
34-
path: ./smithy-rs
35-
- name: Checkout trytls
36-
uses: actions/checkout@v3
37-
with:
38-
repository: ouspg/trytls
39-
path: ./trytls
40-
- name: Checkout badtls
41-
uses: actions/checkout@v3
42-
with:
43-
repository: wbond/badtls.io
44-
path: ./badtls.io
45-
- name: Checkout badssl
46-
uses: actions/checkout@v3
47-
with:
48-
repository: chromium/badssl.com
49-
path: ./badssl.com
50-
- name: Install Rust
51-
uses: dtolnay/rust-toolchain@master
52-
with:
53-
toolchain: ${{ env.rust_version }}
54-
- name: Build badssl.com
55-
shell: bash
56-
working-directory: badssl.com
57-
env:
58-
DOCKER_BUILDKIT: 1
59-
run: ../smithy-rs/tools/ci-scripts/configure-tls/configure-badssl
60-
- name: Build SDK
61-
working-directory: smithy-rs
62-
run: ./gradlew :aws:sdk:assemble -Paws.services=+sts,+sso
63-
- name: Build trytls
64-
shell: bash
65-
working-directory: trytls
66-
run: ../smithy-rs/tools/ci-scripts/configure-tls/configure-trytls
67-
- name: Build badtls.io
68-
working-directory: badtls.io
69-
shell: bash
70-
run: ../smithy-rs/tools/ci-scripts/configure-tls/configure-badtls
71-
- name: Update TLS configuration
72-
shell: bash
73-
run: smithy-rs/tools/ci-scripts/configure-tls/update-certs
74-
- name: Build TLS stub
75-
working-directory: smithy-rs/tools/ci-resources/tls-stub
76-
shell: bash
77-
run: cargo build
78-
- name: Test TLS configuration
79-
working-directory: smithy-rs/tools
80-
shell: bash
81-
run: trytls https target/debug/stub
23+
- name: Install packages
24+
shell: bash
25+
run: |
26+
sudo apt-get update
27+
sudo apt-get -y install gcc make python3-pip nginx git ruby openjdk-17-jre pkg-config libssl-dev faketime
28+
pip3 install certbuilder crlbuilder
29+
- name: Stop nginx
30+
run: sudo systemctl stop nginx
31+
- name: Checkout smithy-rs
32+
uses: actions/checkout@v3
33+
with:
34+
path: ./smithy-rs
35+
- name: Checkout trytls
36+
uses: actions/checkout@v3
37+
with:
38+
repository: ouspg/trytls
39+
path: ./trytls
40+
- name: Checkout badtls
41+
uses: actions/checkout@v3
42+
with:
43+
repository: wbond/badtls.io
44+
path: ./badtls.io
45+
- name: Checkout badssl
46+
uses: actions/checkout@v3
47+
with:
48+
repository: chromium/badssl.com
49+
path: ./badssl.com
50+
- name: Install Rust
51+
uses: dtolnay/rust-toolchain@master
52+
with:
53+
toolchain: ${{ env.rust_version }}
54+
- name: Build badssl.com
55+
shell: bash
56+
working-directory: badssl.com
57+
env:
58+
DOCKER_BUILDKIT: 1
59+
run: ../smithy-rs/tools/ci-scripts/configure-tls/configure-badssl
60+
- name: Build SDK
61+
working-directory: smithy-rs
62+
run: ./gradlew :aws:sdk:assemble -Paws.services=+sts,+sso
63+
- name: Build trytls
64+
shell: bash
65+
working-directory: trytls
66+
run: ../smithy-rs/tools/ci-scripts/configure-tls/configure-trytls
67+
- name: Build badtls.io
68+
working-directory: badtls.io
69+
shell: bash
70+
run: ../smithy-rs/tools/ci-scripts/configure-tls/configure-badtls
71+
- name: Update TLS configuration
72+
shell: bash
73+
run: smithy-rs/tools/ci-scripts/configure-tls/update-certs
74+
- name: Build TLS stub
75+
working-directory: smithy-rs/tools/ci-resources/tls-stub
76+
shell: bash
77+
run: cargo build
78+
- name: Test TLS configuration
79+
working-directory: smithy-rs/tools
80+
shell: bash
81+
run: trytls https target/debug/stub

aws/SDK_CHANGELOG.next.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -775,4 +775,4 @@
775775
}
776776
],
777777
"aws-sdk-model": []
778-
}
778+
}

aws/sdk-codegen/src/test/kotlin/software/amazon/smithy/rustsdk/OperationInputTestGeneratorTests.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ class OperationInputTestGeneratorTests {
2121
val operationModel = """
2222
$prefix
2323
namespace operations
24-
24+
2525
operation Ping {}
2626
""".trimIndent()
2727
val serviceModel = """
2828
$prefix
2929
namespace service
30-
30+
3131
use operations#Ping
32-
32+
3333
service MyService {
3434
operations: [Ping]
3535
}

aws/sdk/build.gradle.kts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ plugins {
1919
}
2020

2121
configure<software.amazon.smithy.gradle.SmithyExtension> {
22-
smithyBuildConfigs = files(buildDir.resolve("smithy-build.json"))
22+
smithyBuildConfigs = files(layout.buildDirectory.file("smithy-build.json"))
2323
allowUnknownTraits = true
2424
}
2525

@@ -144,7 +144,7 @@ tasks.register("generateSmithyBuild") {
144144
inputs.property("servicelist", awsServices.services.toString())
145145
inputs.property("eventStreamAllowList", eventStreamAllowList)
146146
inputs.dir(projectDir.resolve("aws-models"))
147-
outputs.file(buildDir.resolve("smithy-build.json"))
147+
outputs.file(layout.buildDirectory.file("smithy-build.json"))
148148

149149
doFirst {
150150
buildDir.resolve("smithy-build.json").writeText(generateSmithyBuild(awsServices))
@@ -186,7 +186,7 @@ tasks.register("relocateServices") {
186186
}
187187
}
188188
}
189-
inputs.dir("$buildDir/smithyprojections/sdk/")
189+
inputs.dir(layout.buildDirectory.dir("smithyprojections/sdk/"))
190190
outputs.dir(sdkOutputDir)
191191
}
192192

@@ -406,15 +406,15 @@ tasks.register<ExecRustBuildTool>("generateVersionManifest") {
406406
"--examples-revision",
407407
properties.get("aws.sdk.examples.revision") ?: "missing",
408408
).apply {
409-
val previousReleaseManifestPath = getPreviousReleaseVersionManifestPath()?.let { manifestPath ->
409+
getPreviousReleaseVersionManifestPath()?.let { manifestPath ->
410410
add("--previous-release-versions")
411411
add(manifestPath)
412412
}
413413
}
414414
}
415415

416416
tasks["smithyBuildJar"].apply {
417-
inputs.file(buildDir.resolve("smithy-build.json"))
417+
inputs.file(layout.buildDirectory.file("smithy-build.json"))
418418
inputs.dir(projectDir.resolve("aws-models"))
419419
dependsOn("generateSmithyBuild")
420420
dependsOn("generateCargoWorkspace")
@@ -455,5 +455,5 @@ tasks.register<Delete>("deleteSdk") {
455455
}
456456
tasks["clean"].dependsOn("deleteSdk")
457457
tasks["clean"].doFirst {
458-
delete(buildDir.resolve("smithy-build.json"))
458+
delete(layout.buildDirectory.file("smithy-build.json"))
459459
}

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ allprojects.forEach {
2929

3030
it.the<JacocoPluginExtension>().apply {
3131
toolVersion = "0.8.8"
32-
reportsDirectory.set(file("$buildDir/jacoco-reports"))
32+
reportsDirectory.set(layout.buildDirectory.dir("jacoco-reports"))
3333
}
3434
}
3535

codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/customizations/ClientDocsGenerator.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class ClientDocsGenerator(private val codegenContext: ClientCodegenContext) : Li
2929

3030
private fun crateLayout(): Writable =
3131
writable {
32-
val serviceName = codegenContext.serviceShape?.getTrait<TitleTrait>()?.value ?: "the service"
32+
val serviceName = codegenContext.serviceShape.getTrait<TitleTrait>()?.value ?: "the service"
3333
containerDocs(
3434
"""
3535
The entry point for most customers will be [`Client`], which exposes one method for each API

codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/endpoint/EndpointsDecorator.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class EndpointsDecorator : ClientCodegenDecorator {
107107
override fun extras(codegenContext: ClientCodegenContext, rustCrate: RustCrate) {
108108
val generator = EndpointTypesGenerator.fromContext(codegenContext)
109109
rustCrate.withModule(ClientRustModule.Config.endpoint) {
110-
withInlineModule(endpointTestsModule(codegenContext), rustCrate.moduleDocProvider) {
110+
withInlineModule(endpointTestsModule(), rustCrate.moduleDocProvider) {
111111
generator.testGenerator()(this)
112112
}
113113
}

codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/endpoint/generators/EndpointParamsGenerator.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ import software.amazon.smithy.rust.codegen.core.util.dq
4040
import software.amazon.smithy.rust.codegen.core.util.orNull
4141

4242
// internals contains the actual resolver function
43-
fun endpointImplModule(codegenContext: ClientCodegenContext) = RustModule.private("internals", parent = ClientRustModule.Config.endpoint)
43+
fun endpointImplModule() = RustModule.private("internals", parent = ClientRustModule.Config.endpoint)
4444

45-
fun endpointTestsModule(codegenContext: ClientCodegenContext) = RustModule.new(
45+
fun endpointTestsModule() = RustModule.new(
4646
"test",
4747
visibility = Visibility.PRIVATE,
4848
parent = ClientRustModule.Config.endpoint,

codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/endpoint/generators/EndpointResolverGenerator.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ internal class EndpointResolverGenerator(
207207
endpointRuleSet: EndpointRuleSet,
208208
fnsUsed: List<CustomRuntimeFunction>,
209209
): RuntimeType {
210-
return RuntimeType.forInlineFun("resolve_endpoint", endpointImplModule(codegenContext)) {
210+
return RuntimeType.forInlineFun("resolve_endpoint", endpointImplModule()) {
211211
Attribute(allow(allowLintsForResolver)).render(this)
212212
rustTemplate(
213213
"""

codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/protocol/RequestSerializerGenerator.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ class RequestSerializerGenerator(
3636
private val codegenScope by lazy {
3737
val runtimeApi = RuntimeType.smithyRuntimeApi(codegenContext.runtimeConfig)
3838
val interceptorContext = runtimeApi.resolve("client::interceptors::context")
39-
val smithyTypes = RuntimeType.smithyTypes(codegenContext.runtimeConfig)
4039
arrayOf(
4140
*preludeScope,
4241
"BoxError" to RuntimeType.boxError(codegenContext.runtimeConfig),

0 commit comments

Comments
 (0)