Skip to content

Commit f4eae79

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents c5f45a5 + ba97564 commit f4eae79

File tree

43 files changed

+2433
-353
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+2433
-353
lines changed

.github/workflows/release.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,38 @@ on:
2323
default: true
2424

2525
jobs:
26+
# If a release is kicked off before an image is built after push to main,
27+
# or if a dry-run release is kicked off against a non-main branch to test
28+
# automation changes, we'll need to build a base image to work against.
29+
# This job will be a no-op if an image was already built on main.
30+
acquire-base-image:
31+
name: Acquire Base Image
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v3
35+
with:
36+
path: smithy-rs
37+
fetch-depth: 0
38+
- name: Acquire base image
39+
id: acquire
40+
run: ./smithy-rs/tools/ci-build/acquire-build-image
41+
- name: Upload base image
42+
uses: actions/upload-artifact@v3
43+
with:
44+
name: smithy-rs-base-image
45+
path: smithy-rs-base-image
46+
retention-days: 1
47+
2648
release-ci:
2749
name: Prerelease checks
50+
needs:
51+
- acquire-base-image
2852
uses: ./.github/workflows/ci.yml
2953

3054
release:
3155
name: Release
3256
needs:
57+
- acquire-base-image
3358
- release-ci
3459
runs-on: ubuntu-latest
3560
steps:

CHANGELOG.next.toml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,18 @@
1111
# meta = { "breaking" = false, "tada" = false, "bug" = false }
1212
# author = "rcoh"
1313

14+
[[smithy-rs]]
15+
message = "Add checksum calculation and validation wrappers for HTTP bodies."
16+
references = ["smithy-rs#1263"]
17+
meta = { "breaking" = false, "tada" = false, "bug" = false }
18+
author = "Velfi"
19+
20+
[[smithy-rs]]
21+
message = "`aws_smithy_http::header::append_merge_header_maps`, a function for merging two `HeaderMap`s, is now public."
22+
references = ["smithy-rs#1263"]
23+
meta = { "breaking" = false, "tada" = false, "bug" = false }
24+
author = "Velfi"
25+
1426
[[aws-sdk-rust]]
1527
message = """
1628
Fix compilation of `aws-config` with `rustls` and `native-tls` disabled. The
@@ -37,6 +49,12 @@ references = ["smithy-rs#1457"]
3749
meta = { "breaking" = false, "tada" = true, "bug" = false }
3850
author = "calavera"
3951

52+
[[aws-sdk-rust]]
53+
message = "Add `From<aws_smithy_client::erase::DynConnector>` impl for `aws_smithy_client::http_connector::HttpConnector`"
54+
references = ["aws-sdk-rust#581"]
55+
meta = { "breaking" = false, "tada" = true, "bug" = false }
56+
author = "Velfi"
57+
4058
[[smithy-rs]]
4159
message = """
4260
Updated the smithy client's retry behavior to allow for a configurable initial backoff. Previously, the initial backoff
@@ -86,3 +104,15 @@ async fn main() -> Result<(), aws_sdk_dynamodb::Error> {
86104
references = ["aws-sdk-rust#567"]
87105
meta = { "breaking" = false, "tada" = true, "bug" = false }
88106
author = "Velfi"
107+
108+
[[aws-sdk-rust]]
109+
message = """
110+
Until now, SDK crates have all shared the exact same version numbers.
111+
This changes with this release. From now on, SDK crates will only version
112+
bump if they have changes. Coincidentally, they may share the same version
113+
number for some releases since changes to the code generator will cause
114+
a version bump in all of them, but this should not be relied upon.
115+
"""
116+
references = ["smithy-rs#1540"]
117+
meta = { "breaking" = false, "tada" = false, "bug" = false }
118+
author = "jdisanti"

aws/SDK_README.md.hb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ This is the README Handlebars template for `aws-sdk-rust`.
33
It gets instantiated and copied into the build artifacts by the `aws:sdk:assemble` build target.
44

55
Available template arguments:
6-
- `{{sdk_version}}`: the SDK version number (just the number, no `v` prefix)
6+
- `{{sdk_version_<crate_name_in_snake_case>}}` (e.g., `{{sdk_version_aws_config}}` for the `aws-config` crate): the version number of the given crate (just the number, no `v` prefix)
77
- `{{msrv}}`: The MSRV Rust compiler version (just the number, no `v` prefix)
88
--}}
99
<!--
@@ -12,17 +12,17 @@ This README file is auto-generated by the build system in awslabs/smithy-rs.
1212
To update it, edit the `aws/SDK_README.md.hb` Handlebars template in that repository.
1313
-->
1414

15-
# The AWS SDK for Rust [![Docs](https://img.shields.io/badge/docs-v{{sdk_version}}-blue)](https://awslabs.github.io/aws-sdk-rust/) ![MSRV](https://img.shields.io/badge/msrv-{{msrv}}-red) [![Usage Guide](https://img.shields.io/badge/Developer_Guide-blue)](https://docs.aws.amazon.com/sdk-for-rust/latest/dg/welcome.html)
15+
# The AWS SDK for Rust [![Docs](https://img.shields.io/badge/docs-blue)](https://awslabs.github.io/aws-sdk-rust/) ![MSRV](https://img.shields.io/badge/msrv-{{msrv}}-red) [![Usage Guide](https://img.shields.io/badge/Developer_Guide-blue)](https://docs.aws.amazon.com/sdk-for-rust/latest/dg/welcome.html)
1616

17-
This repo contains the new AWS SDK for Rust (the SDK) and its [public roadmap](https://github.com/awslabs/aws-sdk-rust/projects/1).
17+
This repo contains the new AWS SDK for Rust (the SDK) and its [public roadmap](https://github.com/orgs/awslabs/projects/50/views/1).
1818

1919
**Please Note: The SDK is currently released as a developer preview and is intended strictly for feedback purposes only. Do not use this SDK for production workloads.**
2020

2121
The SDK is code generated from [Smithy models](https://awslabs.github.io/smithy/) that represent each AWS service. The code used to generate the SDK can be found in [smithy-rs](https://github.com/awslabs/smithy-rs).
2222

2323
## Getting Started with the SDK
2424

25-
> Examples are availble for many services and operations, check out the [examples folder](./examples).
25+
> Examples are available for many services and operations, check out the [examples folder](./examples).
2626

2727
> For a step-by-step guide including several advanced use cases, check out the [Developer Guide](https://docs.aws.amazon.com/sdk-for-rust/latest/dg/welcome.html).
2828

@@ -33,8 +33,8 @@ The SDK provides one crate per AWS service. You must add [Tokio](https://crates.
3333

3434
```toml
3535
[dependencies]
36-
aws-config = "{{sdk_version}}"
37-
aws-sdk-dynamodb = "{{sdk_version}}"
36+
aws-config = "{{sdk_version_aws_config}}"
37+
aws-sdk-dynamodb = "{{sdk_version_aws_sdk_dynamodb}}"
3838
tokio = { version = "1", features = ["full"] }
3939
```
4040

aws/sdk-codegen/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ dependencies {
3131
testImplementation("io.kotest:kotest-assertions-core-jvm:$kotestVersion")
3232
}
3333

34-
val generateAwsSdkVersion by tasks.registering {
34+
val generateAwsRuntimeCrateVersion by tasks.registering {
3535
// generate the version of the runtime to use as a resource.
3636
// this keeps us from having to manually change version numbers in multiple places
3737
val resourcesDir = "$buildDir/resources/main/software/amazon/smithy/rustsdk"
3838
val versionFile = file("$resourcesDir/sdk-crate-version.txt")
3939
outputs.file(versionFile)
40-
val crateVersion = project.properties["aws.sdk.version"]?.toString()!!
40+
val crateVersion = project.properties["smithy.rs.runtime.crate.version"]?.toString()!!
4141
inputs.property("crateVersion", crateVersion)
4242
sourceSets.main.get().output.dir(resourcesDir)
4343
doLast {
@@ -47,7 +47,7 @@ val generateAwsSdkVersion by tasks.registering {
4747

4848
tasks.compileKotlin {
4949
kotlinOptions.jvmTarget = "1.8"
50-
dependsOn(generateAwsSdkVersion)
50+
dependsOn(generateAwsRuntimeCrateVersion)
5151
}
5252

5353
tasks.compileTestKotlin {

aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/AwsReadmeDecorator.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class AwsReadmeDecorator : RustCodegenDecorator<ClientCodegenContext> {
3535
mapOf("package" to mapOf("readme" to "README.md"))
3636

3737
override fun extras(codegenContext: ClientCodegenContext, rustCrate: RustCrate) {
38+
val awsConfigVersion = SdkSettings.from(codegenContext.settings).awsConfigVersion
3839
rustCrate.withFile("README.md") { writer ->
3940
val description = normalizeDescription(
4041
codegenContext.moduleName,
@@ -62,7 +63,7 @@ class AwsReadmeDecorator : RustCodegenDecorator<ClientCodegenContext> {
6263
6364
```toml
6465
[dependencies]
65-
aws-config = "${codegenContext.settings.moduleVersion}"
66+
aws-config = "$awsConfigVersion"
6667
$moduleName = "${codegenContext.settings.moduleVersion}"
6768
tokio = { version = "1", features = ["full"] }
6869
```

aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/SdkSettings.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,9 @@ class SdkSettings private constructor(private val awsSdk: ObjectNode?) {
3636
/** Path to AWS SDK integration tests */
3737
val integrationTestPath: String get() =
3838
awsSdk?.getStringMember("integrationTestPath")?.orNull()?.value ?: "aws/sdk/integration-tests"
39+
40+
/** Version number of the `aws-config` crate */
41+
val awsConfigVersion: String get() =
42+
awsSdk?.getStringMember("awsConfigVersion")?.orNull()?.value
43+
?: throw IllegalStateException("missing `awsConfigVersion` codegen setting")
3944
}

aws/sdk/build.gradle.kts

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ val awsServices: AwsServices by lazy { discoverServices(properties.get("aws.sdk.
5555
val eventStreamAllowList: Set<String> by lazy { eventStreamAllowList() }
5656
val crateVersioner by lazy { aws.sdk.CrateVersioner.defaultFor(rootProject, properties) }
5757

58-
fun getSdkVersion(): String = properties.get("aws.sdk.version") ?: throw Exception("SDK version missing")
5958
fun getRustMSRV(): String = properties.get("rust.msrv") ?: throw Exception("Rust MSRV missing")
6059
fun getPreviousReleaseVersionManifestPath(): String? = properties.get("aws.sdk.previous.release.versions.manifest")
6160

@@ -73,8 +72,10 @@ fun eventStreamAllowList(): Set<String> {
7372
}
7473

7574
fun generateSmithyBuild(services: AwsServices): String {
75+
val awsConfigVersion = properties.get("smithy.rs.runtime.crate.version")
76+
?: throw IllegalStateException("missing smithy.rs.runtime.crate.version for aws-config version")
7677
val serviceProjections = services.services.map { service ->
77-
val files = service.files().map { extraFile ->
78+
val files = service.modelFiles().map { extraFile ->
7879
software.amazon.smithy.utils.StringUtils.escapeJavaString(
7980
extraFile.absolutePath,
8081
""
@@ -99,14 +100,15 @@ fun generateSmithyBuild(services: AwsServices): String {
99100
},
100101
"service": "${service.service}",
101102
"module": "$moduleName",
102-
"moduleVersion": "${crateVersioner.decideCrateVersion(moduleName)}",
103+
"moduleVersion": "${crateVersioner.decideCrateVersion(moduleName, service)}",
103104
"moduleAuthors": ["AWS Rust SDK Team <[email protected]>", "Russell Cohen <[email protected]>"],
104105
"moduleDescription": "${service.moduleDescription}",
105106
${service.examplesUri(project)?.let { """"examples": "$it",""" } ?: ""}
106107
"moduleRepository": "https://github.com/awslabs/aws-sdk-rust",
107108
"license": "Apache-2.0",
108109
"customizationConfig": {
109110
"awsSdk": {
111+
"awsConfigVersion": "$awsConfigVersion",
110112
"defaultConfigPath": "${services.defaultConfigPath}",
111113
"endpointsConfigPath": "${services.endpointsConfigPath}",
112114
"integrationTestPath": "${project.projectDir.resolve("integration-tests")}"
@@ -242,7 +244,7 @@ tasks.register("relocateAwsRuntime") {
242244
// Patch the Cargo.toml files
243245
CrateSet.AWS_SDK_RUNTIME.forEach { moduleName ->
244246
patchFile(sdkOutputDir.resolve("$moduleName/Cargo.toml")) { line ->
245-
rewriteAwsSdkCrateVersion(properties, line.let(::rewritePathDependency))
247+
rewriteRuntimeCrateVersion(properties, line.let(::rewritePathDependency))
246248
}
247249
}
248250
}
@@ -253,7 +255,7 @@ tasks.register("relocateRuntime") {
253255
// Patch the Cargo.toml files
254256
CrateSet.AWS_SDK_SMITHY_RUNTIME.forEach { moduleName ->
255257
patchFile(sdkOutputDir.resolve("$moduleName/Cargo.toml")) { line ->
256-
rewriteSmithyRsCrateVersion(properties, line)
258+
rewriteRuntimeCrateVersion(properties, line)
257259
}
258260
}
259261
}
@@ -312,15 +314,19 @@ tasks.register<ExecRustBuildTool>("fixManifests") {
312314
tasks.register<ExecRustBuildTool>("hydrateReadme") {
313315
description = "Run the publisher tool's `hydrate-readme` sub-command to create the final AWS Rust SDK README file"
314316

317+
dependsOn("generateVersionManifest")
318+
315319
inputs.dir(publisherToolPath)
316-
outputs.dir(outputDir)
320+
inputs.file(rootProject.projectDir.resolve("aws/SDK_README.md.hb"))
321+
outputs.file(outputDir.resolve("README.md").absolutePath)
317322

318323
toolPath = publisherToolPath
319324
binaryName = "publisher"
320325
arguments = listOf(
321326
"hydrate-readme",
322-
"--sdk-version", getSdkVersion(),
327+
"--versions-manifest", outputDir.resolve("versions.toml").toString(),
323328
"--msrv", getRustMSRV(),
329+
"--input", rootProject.projectDir.resolve("aws/SDK_README.md.hb").toString(),
324330
"--output", outputDir.resolve("README.md").absolutePath
325331
)
326332
}
@@ -352,8 +358,6 @@ tasks.register<ExecRustBuildTool>("generateVersionManifest") {
352358
val previousReleaseManifestPath = getPreviousReleaseVersionManifestPath()?.let { manifestPath ->
353359
add("--previous-release-versions")
354360
add(manifestPath)
355-
add("--release-tag")
356-
add("v" + getSdkVersion())
357361
}
358362
}
359363
}

buildSrc/src/main/kotlin/ManifestPatcher.kt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,11 @@ fun rewriteCrateVersion(line: String, version: String): String = line.replace(
1010
"version = \"$version\""
1111
)
1212

13-
/**
14-
* AWS runtime crate versions are all `0.0.0-smithy-rs-head`. When copying over to the AWS SDK,
15-
* these should be changed to the AWS SDK version.
16-
*/
17-
fun rewriteAwsSdkCrateVersion(properties: PropertyRetriever, line: String): String =
18-
rewriteCrateVersion(line, properties.get("aws.sdk.version")!!)
19-
2013
/**
2114
* Smithy runtime crate versions in smithy-rs are all `0.0.0-smithy-rs-head`. When copying over to the AWS SDK,
2215
* these should be changed to the smithy-rs version.
2316
*/
24-
fun rewriteSmithyRsCrateVersion(properties: PropertyRetriever, line: String): String =
17+
fun rewriteRuntimeCrateVersion(properties: PropertyRetriever, line: String): String =
2518
rewriteCrateVersion(line, properties.get("smithy.rs.runtime.crate.version")!!)
2619

2720
/** Patches a file with the result of the given `operation` being run on each line */

0 commit comments

Comments
 (0)