Unverified Commit 9943a1fe authored by AWS SDK Rust Bot's avatar AWS SDK Rust Bot Committed by GitHub
Browse files

Fix re-export of `SdkError` (#2931)

parents 9570983e 790de792
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@ jobs:
    name: Acquire Base Image
    needs: save-docker-login-token
    if: ${{ github.event.pull_request.head.repo.full_name == 'awslabs/smithy-rs' }}
    runs-on: ubuntu-latest
    runs-on: smithy_ubuntu-latest_8-core
    env:
      ENCRYPTED_DOCKER_PASSWORD: ${{ needs.save-docker-login-token.outputs.docker-login-password }}
      DOCKER_LOGIN_TOKEN_PASSPHRASE: ${{ secrets.DOCKER_LOGIN_TOKEN_PASSPHRASE }}
+14 −1
Original line number Diff line number Diff line
# This workflow updates the `next` branch with freshly generated
# code from the latest smithy-rs and models that reside in aws-sdk-rust.

# Allow only one release to run at a time
concurrency:
  group: update-aws-sdk-next
  cancel-in-progress: true

name: Update `aws-sdk-rust/next`
on:
  workflow_dispatch:
    inputs:
      generate_ref:
        description: |
          Which branch/commit/tag of smithy-rs to use to generate aws-sdk-rust/next. Defaults to `main`.
        required: true
        type: string
        default: main

jobs:
  update-next:
@@ -13,7 +26,7 @@ jobs:
      uses: actions/checkout@v3
      with:
        repository: awslabs/smithy-rs
        ref: main
        ref: ${{ inputs.generate_ref }}
        path: smithy-rs
    - name: Check out `aws-sdk-rust`
      uses: actions/checkout@v3
+12 −0
Original line number Diff line number Diff line
@@ -35,6 +35,18 @@ references = ["smithy-rs#2907", "aws-sdk-rust#864"]
meta = { "breaking" = false, "tada" = false, "bug" = true }
author = "jdisanti"

[[aws-sdk-rust]]
message = "Fixed re-exported `SdkError` type. The previous release had the wrong type for `SdkError`, which caused projects to fail to compile when upgrading."
references = ["smithy-rs#2931", "aws-sdk-rust#875"]
meta = { "breaking" = true, "tada" = false, "bug" = true }
author = "jdisanti"

[[smithy-rs]]
message = "Fixed re-exported `SdkError` type. The previous release had the wrong type for `SdkError` when generating code for orchestrator mode, which caused projects to fail to compile when upgrading."
references = ["smithy-rs#2931", "aws-sdk-rust#875"]
meta = { "breaking" = true, "tada" = false, "bug" = true, "target" = "client" }
author = "jdisanti"

[[smithy-rs]]
message = "Logging via `#[instrument]` in the `aws_smithy_runtime::client::orchestrator` module is now emitted at the `DEBUG` level to reduce the amount of logging when emitted at the `INFO` level."
references = ["smithy-rs#2934", "aws-sdk-rust#872"]
+6 −17
Original line number Diff line number Diff line
@@ -3,7 +3,6 @@
 * SPDX-License-Identifier: Apache-2.0
 */

import aws.sdk.AwsExamplesLayout
import aws.sdk.AwsServices
import aws.sdk.Membership
import aws.sdk.discoverServices
@@ -246,22 +245,12 @@ tasks.register<ExecRustBuildTool>("fixExampleManifests") {

    toolPath = sdkVersionerToolPath
    binaryName = "sdk-versioner"
    arguments = when (AwsExamplesLayout.detect(project)) {
        AwsExamplesLayout.Flat -> listOf(
            "use-path-and-version-dependencies",
            "--isolate-crates",
            "--sdk-path", "../../sdk",
            "--versions-toml", outputDir.resolve("versions.toml").absolutePath,
            outputDir.resolve("examples").absolutePath,
        )
        AwsExamplesLayout.Workspaces -> listOf(
    arguments = listOf(
        "use-path-and-version-dependencies",
            "--isolate-crates",
        "--sdk-path", sdkOutputDir.absolutePath,
        "--versions-toml", outputDir.resolve("versions.toml").absolutePath,
        outputDir.resolve("examples").absolutePath,
    )
    }

    outputs.dir(outputDir)
    dependsOn("relocateExamples", "generateVersionManifest")
+3 −41
Original line number Diff line number Diff line
@@ -19,38 +19,6 @@ data class RootTest(
    val manifestName: String,
)

// TODO(https://github.com/awslabs/smithy-rs/issues/2810): We can remove the `Flat` layout after the switch
// to `Workspaces` has been released. This can be checked by looking at the `examples/` directory in aws-sdk-rust's
// main branch.
//
// The `Flat` layout is retained for backwards compatibility so that the next release process can succeed.
enum class AwsExamplesLayout {
    /**
     * Directory layout for examples used prior to June 26, 2023,
     * where each example was in the `rust_dev_preview/` root directory and
     * was considered to be its own workspace.
     *
     * This layout had issues with CI in terms of time to compile and disk space required
     * since the dependencies would get recompiled for every example.
     */
    Flat,

    /**
     * Current directory layout where there are a small number of workspaces
     * rooted in `rust_dev_preview/`.
     */
    Workspaces,
    ;

    companion object {
        fun detect(project: Project): AwsExamplesLayout = if (project.projectDir.resolve("examples/Cargo.toml").exists()) {
            AwsExamplesLayout.Flat
        } else {
            AwsExamplesLayout.Workspaces
        }
    }
}

class AwsServices(
    private val project: Project,
    services: List<AwsService>,
@@ -77,16 +45,10 @@ class AwsServices(

    val examples: List<String> by lazy {
        val examplesRoot = project.projectDir.resolve("examples")
        if (AwsExamplesLayout.detect(project) == AwsExamplesLayout.Flat) {
            examplesRoot.listFiles { file -> !file.name.startsWith(".") }.orEmpty().toList()
                .filter { file -> manifestCompatibleWithGeneratedServices(file) }
                .map { "examples/${it.name}" }
        } else {
        examplesRoot.listFiles { file ->
            !file.name.startsWith(".") && file.isDirectory() && file.resolve("Cargo.toml").exists()
        }.orEmpty().toList().map { "examples/${it.name}" }
    }
    }

    /**
     * Tests in `aws/sdk/integration-tests` that are not named after a service module, and therefore,
Loading