Skip to content

Commit e494fb5

Browse files
authored
Stop cloning aws-doc-sdk-examples repository in CI (#4300)
2 parents 12da47b + 1ea5fe1 commit e494fb5

File tree

9 files changed

+10
-102
lines changed

9 files changed

+10
-102
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,6 @@ jobs:
6969
with:
7070
repository: awslabs/aws-sdk-rust
7171
path: aws-sdk-rust
72-
# The examples from aws-doc-sdk-examples are needed to see if smithy-rs changes break examples
73-
- uses: actions/checkout@v4
74-
with:
75-
repository: awsdocs/aws-doc-sdk-examples
76-
path: aws-doc-sdk-examples
7772
- name: Run ${{ matrix.actions.action }}
7873
uses: ./smithy-rs/.github/actions/docker-build
7974
with:

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ internal class AwsCrateDocGenerator(private val codegenContext: ClientCodegenCon
150150
#### Getting Started
151151
152152
> Examples are available for many services and operations, check out the
153-
> [examples folder in GitHub](https://github.com/awslabs/aws-sdk-rust/tree/main/examples).
153+
> [usage examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/rustv1).
154154
155155
The SDK provides one crate per AWS service. You must add [Tokio](https://crates.io/crates/tokio)
156156
as a dependency within your Rust project to execute asynchronous code. To add `$moduleName` to
@@ -209,7 +209,7 @@ internal class AwsCrateDocGenerator(private val codegenContext: ClientCodegenCon
209209
* [GitHub discussions](https://github.com/awslabs/aws-sdk-rust/discussions) - For ideas, RFCs & general questions
210210
* [GitHub issues](https://github.com/awslabs/aws-sdk-rust/issues/new/choose) - For bug reports & feature requests
211211
* [Generated Docs (latest version)](https://awslabs.github.io/aws-sdk-rust/)
212-
* [Usage examples](https://github.com/awslabs/aws-sdk-rust/tree/main/examples)${"\n"}
212+
* [Usage examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/rustv1)${"\n"}
213213
""".trimIndent(),
214214
)
215215

aws/rust-runtime/aws-config/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "aws-config"
3-
version = "1.8.6"
3+
version = "1.8.7"
44
authors = [
55
"AWS Rust SDK Team <aws-sdk-rust@amazon.com>",
66
"Russell Cohen <rcoh@amazon.com>",

aws/rust-runtime/aws-config/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ async fn example() {
3131

3232
## Getting Started
3333

34-
_Examples are available for many services and operations, check out the [examples folder in GitHub][Usage examples]._
34+
_Examples are available for many services and operations, check out the [Usage examples]._
3535

3636
The SDK provides one crate per AWS service. You must add [Tokio] as a dependency within your Rust project to execute asynchronous code. To add aws-sdk-config to your project, add the following to your Cargo.toml file where VERSION is the version of the SDK you want to use:
3737

@@ -58,13 +58,12 @@ Suggestions for additional sections or improvements for the guide are welcome. P
5858

5959
This project is licensed under the Apache-2.0 License.
6060

61-
[examples folder in GitHub]: https://github.com/awslabs/aws-sdk-rust/tree/main/examples
6261
[Tokio]: https://crates.io/crates/tokio
6362
[Guide]: https://github.com/awslabs/aws-sdk-rust/blob/main/Guide.md
6463
[GitHub discussions]: https://github.com/awslabs/aws-sdk-rust/discussions
6564
[GitHub issues]: https://github.com/awslabs/aws-sdk-rust/issues/new/choose
6665
[Generated Docs]: https://awslabs.github.io/aws-sdk-rust/
67-
[Usage examples]: https://github.com/awslabs/aws-sdk-rust/tree/main/examples
66+
[Usage examples]: https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/rustv1
6867

6968
<!-- anchor_start:footer -->
7069
This crate is part of the [AWS SDK for Rust](https://awslabs.github.io/aws-sdk-rust/) and the [smithy-rs](https://github.com/smithy-lang/smithy-rs) code generator.

aws/sdk/build.gradle.kts

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ val awsRustRuntimePath = rootProject.projectDir.resolve("aws/rust-runtime")
3838
val awsSdkPath = rootProject.projectDir.resolve("aws/sdk")
3939
val outputDir = layout.buildDirectory.dir("aws-sdk").get()
4040
val sdkOutputDir = outputDir.dir("sdk")
41-
val examplesOutputDir = outputDir.dir("examples")
4241
val checkedInSdkLockfile = rootProject.projectDir.resolve("aws/sdk/Cargo.lock")
4342
val generatedSdkLockfile = outputDir.file("Cargo.lock")
4443

@@ -110,7 +109,6 @@ fun generateSmithyBuild(services: AwsServices): String {
110109
"moduleVersion": "${crateVersioner.decideCrateVersion(moduleName, service)}",
111110
"moduleAuthors": ["AWS Rust SDK Team <aws-sdk-rust@amazon.com>", "Russell Cohen <rcoh@amazon.com>"],
112111
"moduleDescription": "${service.moduleDescription}",
113-
${service.examplesUri(project)?.let { """"examples": "$it",""" } ?: ""}
114112
"moduleRepository": "https://github.com/awslabs/aws-sdk-rust",
115113
"license": "Apache-2.0",
116114
"minimumSupportedRustVersion": "${getRustMSRV()}",
@@ -192,30 +190,6 @@ tasks.register("relocateServices") {
192190
outputs.dir(sdkOutputDir)
193191
}
194192

195-
tasks.register("relocateExamples") {
196-
description = "relocate the examples folder & rewrite path dependencies"
197-
dependsOn("jar")
198-
199-
doLast {
200-
if (awsServices.examples.isNotEmpty()) {
201-
copy {
202-
from(projectDir)
203-
awsServices.examples.forEach { example ->
204-
include("$example/**")
205-
}
206-
into(outputDir)
207-
exclude("**/target")
208-
exclude("**/rust-toolchain.toml")
209-
filter { line -> line.replace("build/aws-sdk/sdk/", "sdk/") }
210-
}
211-
}
212-
}
213-
if (awsServices.examples.isNotEmpty()) {
214-
inputs.dir(projectDir.resolve("examples"))
215-
}
216-
outputs.dir(outputDir)
217-
}
218-
219193
tasks.register("relocateTests") {
220194
description = "relocate the root integration tests and rewrite path dependencies"
221195
dependsOn("jar")
@@ -240,24 +214,6 @@ tasks.register("relocateTests") {
240214
outputs.dir(outputDir)
241215
}
242216

243-
tasks.register<ExecRustBuildTool>("fixExampleManifests") {
244-
description = "Adds dependency path and corrects version number of examples after relocation"
245-
enabled = awsServices.examples.isNotEmpty()
246-
dependsOn("relocateExamples")
247-
248-
toolPath = sdkVersionerToolPath
249-
binaryName = "sdk-versioner"
250-
arguments = listOf(
251-
"use-path-and-version-dependencies",
252-
"--sdk-path", sdkOutputDir.asFile.absolutePath,
253-
"--versions-toml", outputDir.file("versions.toml").asFile.absolutePath,
254-
outputDir.dir("examples").asFile.absolutePath,
255-
)
256-
257-
outputs.dir(outputDir)
258-
dependsOn("relocateExamples", "generateVersionManifest")
259-
}
260-
261217
/**
262218
* The aws/rust-runtime crates depend on local versions of the Smithy core runtime enabling local compilation. However,
263219
* those paths need to be replaced in the final build. We should probably fix this with some symlinking.
@@ -336,9 +292,6 @@ tasks.register("generateCargoWorkspace") {
336292
rootProject.rootDir.resolve("clippy-root.toml").copyTo(outputDir.file("clippy.toml").asFile, overwrite = true)
337293
}
338294
inputs.property("servicelist", awsServices.moduleNames.toString())
339-
if (awsServices.examples.isNotEmpty()) {
340-
inputs.dir(projectDir.resolve("examples"))
341-
}
342295
for (test in awsServices.rootTests) {
343296
inputs.dir(test.path)
344297
}
@@ -352,7 +305,6 @@ tasks.register<ExecRustBuildTool>("fixManifests") {
352305
dependsOn("relocateServices")
353306
dependsOn("relocateRuntime")
354307
dependsOn("relocateAwsRuntime")
355-
dependsOn("relocateExamples")
356308
dependsOn("relocateTests")
357309

358310
inputs.dir(publisherToolPath)
@@ -428,12 +380,10 @@ tasks.assemble.configure {
428380
"relocateServices",
429381
"relocateRuntime",
430382
"relocateAwsRuntime",
431-
"relocateExamples",
432383
"relocateTests",
433384
"generateIndexMd",
434385
"fixManifests",
435386
"generateVersionManifest",
436-
"fixExampleManifests",
437387
"hydrateReadme",
438388
"relocateChangelog",
439389
)

buildSrc/src/main/kotlin/aws/sdk/DocsLandingPage.kt

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ fun Project.docsLandingPage(
2626
write(
2727
"The AWS SDK for Rust contains one crate for each AWS service, as well as ${cratesIo("aws-config")} " +
2828
"${docsRs("aws-config")}, a crate implementing configuration loading such as credential providers. " +
29-
"For usage documentation see the [Developer Guide](https://docs.aws.amazon.com/sdk-for-rust/latest/dg/welcome.html).",
29+
"For usage documentation see the [Developer Guide](https://docs.aws.amazon.com/sdk-for-rust/latest/dg/welcome.html). " +
30+
"For code examples refer to the [Code Examples Repository](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/rustv1).",
3031
)
3132

3233
writer.write("## AWS Services")
@@ -35,7 +36,7 @@ fun Project.docsLandingPage(
3536
writer.write("| Service | Package |")
3637
writer.write("| ------- | ------- |")
3738
awsServices.services.sortedBy { it.humanName }.forEach {
38-
val items = listOfNotNull(cratesIo(it), docsRs(it), examplesLink(it, project)).joinToString(" ")
39+
val items = listOfNotNull(cratesIo(it), docsRs(it)).joinToString(" ")
3940
writer.write(
4041
"| ${it.humanName} | $items |",
4142
)
@@ -44,16 +45,6 @@ fun Project.docsLandingPage(
4445
outputPath.writeText(writer.toString())
4546
}
4647

47-
/**
48-
* Generate a link to the examples for a given service
49-
*/
50-
private fun examplesLink(
51-
service: AwsService,
52-
project: Project,
53-
) = service.examplesUri(project)?.let {
54-
"([examples]($it))"
55-
}
56-
5748
/**
5849
* Generate a link to the docs
5950
*/

buildSrc/src/main/kotlin/aws/sdk/ServiceLoader.kt

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,10 @@ class AwsServices(
3838
CrateSet.AWS_SDK_SMITHY_RUNTIME.map { "sdk/${it.name}" } +
3939
CrateSet.AWS_SDK_RUNTIME.map { "sdk/${it.name}" }
4040
// Root tests should not be included since they can't be part of the root Cargo workspace
41-
// in order to test differences in Cargo features. Examples should not be included either
42-
// because each example itself is a workspace.
41+
// in order to test differences in Cargo features.
4342
).toSortedSet()
4443
}
4544

46-
val examples: List<String> by lazy {
47-
val examplesRoot = project.projectDir.resolve("examples")
48-
examplesRoot.listFiles { file ->
49-
!file.name.startsWith(".") && file.isDirectory() && file.resolve("Cargo.toml").exists()
50-
}.orEmpty().toList().map { "examples/${it.name}" }
51-
}
52-
5345
/**
5446
* Tests in `aws/sdk/integration-tests` that are not named after a service module, and therefore,
5547
* are not included in a service's `tests/` directory. These are to be included at the SDK root
@@ -88,7 +80,7 @@ class AwsServices(
8880
/**
8981
* Returns a list of crates excluded from the workspace.
9082
*/
91-
fun excludedFromWorkspace() = examples + rootTests.map(RootTest::manifestName)
83+
fun excludedFromWorkspace() = rootTests.map(RootTest::manifestName)
9284
}
9385

9486
/**
@@ -192,18 +184,6 @@ data class AwsService(
192184
val humanName: String,
193185
) {
194186
fun modelFiles(): List<File> = listOf(modelFile) + extraFiles
195-
196-
fun Project.examples(): File = projectDir.resolve("examples").resolve(module)
197-
198-
/**
199-
* Generate a link to the examples for a given service
200-
*/
201-
fun examplesUri(project: Project) =
202-
if (project.examples().exists()) {
203-
"https://github.com/awslabs/aws-sdk-rust/tree/main/examples/$module"
204-
} else {
205-
null
206-
}
207187
}
208188

209189
fun AwsService.crate(): String = "aws-sdk-$module"

tools/ci-build/ci-create-workspace

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ cp -r "${SCRIPT_PATH}/../ci-scripts" "${ACTION_PATH}/workspace/"
2828

2929
# Copy inputs into workspace
3030
for input_name in \
31-
"aws-doc-sdk-examples" \
3231
"aws-sdk-rust" \
3332
"aws-sdk" \
3433
"aws-sdk-smoketest" \

tools/ci-scripts/generate-aws-sdk

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@ if [[ ! -d "${AWS_SDK_MODELS_PATH}" ]]; then
2121
exit 1
2222
fi
2323

24-
echo -e "${C_YELLOW}Taking examples from 'awsdocs/aws-doc-sdk-examples'...${C_RESET}"
25-
examples_revision=$(cd aws-doc-sdk-examples; git rev-parse HEAD)
26-
mv aws-doc-sdk-examples/rustv1 smithy-rs/aws/sdk/examples
27-
rm -rf smithy-rs/aws/sdk/examples/.cargo
28-
2924
echo -e "${C_YELLOW}Creating empty model metadata file since we don't have model update information...${C_RESET}"
3025
MODEL_METADATA_PATH="$(pwd)/model-metadata.toml"
3126
echo > "${MODEL_METADATA_PATH}"
@@ -35,7 +30,6 @@ cd smithy-rs
3530

3631
./gradlew \
3732
-Paws.sdk.models.path="${AWS_SDK_MODELS_PATH}" \
38-
-Paws.sdk.examples.revision="${examples_revision}" \
3933
-Paws.sdk.previous.release.versions.manifest="${PREVIOUS_RELEASE_VERSIONS_ARG}" \
4034
-Paws.sdk.model.metadata="${MODEL_METADATA_PATH}" \
4135
aws:sdk:assemble

0 commit comments

Comments
 (0)