Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into davidpz/use-the-_sy…
Browse files Browse the repository at this point in the history
…mbolprovider_-and-_model_-directly-from-the-smithy-plugins
  • Loading branch information
david-perez committed Jul 6, 2022
2 parents f664633 + b1d50b5 commit a0dd263
Show file tree
Hide file tree
Showing 598 changed files with 34,541 additions and 1,229,977 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,17 @@ jobs:
actions:
- action: generate-aws-sdk
- action: generate-aws-sdk-smoketest
- action: generate-smithy-rs-runtime-bundle
- action: generate-smithy-rs-release
steps:
- uses: actions/checkout@v3
with:
path: smithy-rs
# The models from aws-sdk-rust are needed to generate the full SDK for CI
- uses: actions/checkout@v3
with:
repository: awslabs/aws-sdk-rust
path: aws-sdk-rust
# The examples from aws-doc-sdk-examples are needed to see if smithy-rs changes break examples
- uses: actions/checkout@v3
with:
repository: awsdocs/aws-doc-sdk-examples
Expand Down Expand Up @@ -61,6 +67,7 @@ jobs:
- action: check-server-codegen-integration-tests-python
- action: check-server-codegen-unit-tests-python
- action: check-server-e2e-test
- action: check-server-python-e2e-test
- action: check-style-and-lints
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -123,8 +130,10 @@ jobs:
run: |
for runtime_path in "rust-runtime" "aws/rust-runtime"; do
pushd "${runtime_path}" &>/dev/null
cargo test --all-features
cargo doc --no-deps --document-private-items --all-features
# aws-smithy-http-server-python cannot be compiled on Windows since it uses the `signal-hook` crate
# which is not really yet fully supported on the platform.
cargo test --all-features --workspace --exclude aws-smithy-http-server-python
cargo doc --no-deps --document-private-items --all-features --workspace --exclude aws-smithy-http-server-python
popd &>/dev/null
done
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pull-request-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,15 @@ jobs:
./gradlew -Paws.services=+sts,+sso,+transcribestreaming,+dynamodb :aws:sdk:assemble
# Copy the Server runtime crate(s) in
cp -r rust-runtime/aws-smithy-http-server aws/sdk/build/aws-sdk/sdk
cp -r rust-runtime/aws-smithy-http-server rust-runtime/aws-smithy-http-server-python aws/sdk/build/aws-sdk/sdk
pushd aws/sdk/build/aws-sdk
# Remove example crates from workspace
sed -i '/examples/d' Cargo.toml
# Add server runtime crates to the workspace
sed -i 's/"sdk\/sts",/"sdk\/sts","sdk\/aws-smithy-http-server",/' Cargo.toml
sed -i 's/"sdk\/sts",/"sdk\/sts","sdk\/aws-smithy-http-server","sdk\/aws-smithy-http-server-python",/' Cargo.toml
cargo doc --no-deps --all-features
popd
Expand Down
83 changes: 83 additions & 0 deletions .github/workflows/release-scripts/create-release.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

// This script is used by the release.yml GitHub Actions workflow to idempotently
// create a tagged GitHub release from the generated release manifest file.

const assert = require("assert");
const fs = require("fs");

const smithy_rs_repo = {
owner: "awslabs",
repo: "smithy-rs",
};

async function getExistingRelease(github, tag) {
try {
const response = await github.rest.repos.getReleaseByTag({ ...smithy_rs_repo, tag });
return { name: response.data.name, body: response.data.body };
} catch (error) {
if (error.status === 404) {
console.info(`No existing release found with tag '${tag}'`);
return null;
}
throw error;
}
}

function loadReleaseManifest(path) {
const releaseManifest = JSON.parse(fs.readFileSync(path));
console.info("Release manifest: ", releaseManifest);
assert(releaseManifest.tagName !== undefined, "release manifest must have a `tagName` field");
assert(releaseManifest.name !== undefined, "release manifest must have a `name` field");
assert(releaseManifest.body !== undefined, "release manifest must have a `body` field");
assert(releaseManifest.prerelease !== undefined, "release manifest must have a `prerelease` field");
return releaseManifest;
}

module.exports = async ({
// GitHub API (Octokit)
github,
// Boolean indicating if this is a dry-run release or not
isDryRun,
// Release manifest file path
releaseManifestPath,
}) => {
assert(github !== undefined, "The `github` argument is required");
assert(isDryRun !== undefined, "The `isDryRun` argument is required");
assert(releaseManifestPath !== undefined, "The `releaseManifestPath` argument is required");

console.info(`Starting GitHub release creation with isDryRun: ${isDryRun}, and releaseManifestPath: '${releaseManifestPath}'`);

// Load the release manifest generated by the `changelogger` tool during build
const releaseManifest = loadReleaseManifest(releaseManifestPath);

// Idempotency check: Look up an existing GitHub release for the tag in the release manifest
const existingRelease = await getExistingRelease(github, releaseManifest.tagName);
if (existingRelease) {
console.info(`Found an existing release with tag '${releaseManifest.tagName}': `, existingRelease);
if (existingRelease.name !== releaseManifest.name || existingRelease.body !== releaseManifest.body) {
throw Error("FATAL: Existing release does not match the release manifest!");
} else {
console.info("SUCCESS: Existing release matches details in the release manifest. No work needs to be done!");
}
} else {
// Explicitly comparing against `false` to avoid accidental publish in the event that
// the `isDryRun` argument wasn't passed in correctly from the GitHub Actions workflow.
if (isDryRun === false) {
console.info("Not a dry-run; creating a new release...");
const response = await github.rest.repos.createRelease({
...smithy_rs_repo,
tag_name: releaseManifest.tagName,
name: releaseManifest.name,
body: releaseManifest.body,
prerelease: releaseManifest.prerelease,
});
console.info(`SUCCESS: Created release with ID: ${response.data.id}, URL: ${response.data.html_url} `);
} else {
console.info("SUCCESS: Exiting early since this is a dry-run release.");
}
}
};
95 changes: 95 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

# This workflow performs a release of smithy-rs. It is manually
# kicked off via GitHub Actions workflow dispatch.

# Allow only one release to run at a time
concurrency:
group: release-smithy-rs
cancel-in-progress: true

env:
rust_version: 1.58.1

name: Release smithy-rs
on:
workflow_dispatch:
inputs:
dry_run:
description: Dry runs will only produce release artifacts, but will not cut a release tag in GitHub nor publish to crates.io
required: true
type: boolean
default: true

jobs:
release-ci:
name: Prerelease checks
uses: ./.github/workflows/ci.yml

release:
name: Release
needs:
- release-ci
runs-on: ubuntu-latest
steps:
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.rust_version }}
default: true
- name: Checkout smithy-rs
uses: actions/checkout@v3
with:
path: smithy-rs
token: ${{ secrets.RELEASE_AUTOMATION_BOT_PAT }}
- name: Generate release artifacts
uses: ./smithy-rs/.github/actions/docker-build
with:
action: generate-smithy-rs-release
- name: Download all artifacts
uses: ./smithy-rs/.github/actions/download-all-artifacts
- name: Push smithy-rs changes
shell: bash
working-directory: smithy-rs-release/smithy-rs
run: |
if [[ "${{ inputs.dry_run }}" == "true" ]]; then
echo "Pushing a preview of the release to the smithy-rs-release-preview branch"
git push --force origin HEAD:smithy-rs-release-preview
else
echo "Pushing release commits..."
git push origin
fi
- name: Tag release
uses: actions/github-script@v6
with:
github-token: ${{ secrets.RELEASE_AUTOMATION_BOT_PAT }}
script: |
const createReleaseScript = require("./smithy-rs/.github/workflows/release-scripts/create-release.js");
await createReleaseScript({
github,
isDryRun: ${{ inputs.dry_run }},
releaseManifestPath: "smithy-rs-release/smithy-rs-release-manifest.json"
});
- name: Publish to crates.io
shell: bash
working-directory: smithy-rs-release/crates-to-publish
env:
RELEASE_AUTOMATION_BOT_CRATESIO_TOKEN: ${{ secrets.RELEASE_AUTOMATION_BOT_CRATESIO_TOKEN }}
run: |
cargo login -- "${RELEASE_AUTOMATION_BOT_CRATESIO_TOKEN}"
cargo install --path "$(realpath ../smithy-rs/tools/publisher)"
# Verify the publisher tool installed successfully
publisher --version
if [[ "${{ inputs.dry_run }}" == "true" ]]; then
if [[ ! -f aws-smithy-types/Cargo.toml ]]; then
echo "Crates to publish not found!"
exit 1
fi
# The following owner list command fails without a valid crates.io auth token
echo "Checking cargo auth token..."
cargo owner --list aws-smithy-types
else
publisher publish -y --location .
fi
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,33 @@
<!-- Do not manually edit this file. Use the `changelogger` tool. -->
v0.45.0 (June 28th, 2022)
=========================
**Breaking Changes:**
- ⚠ ([smithy-rs#932](https://github.com/awslabs/smithy-rs/issues/932)) Replaced use of `pin-project` with equivalent `pin-project-lite`. For pinned enum tuple variants and tuple structs, this
change requires that we switch to using enum struct variants and regular structs. Most of the structs and enums that
were updated had only private fields/variants and so have the same public API. However, this change does affect the
public API of `aws_smithy_http_tower::map_request::MapRequestFuture<F, E>`. The `Inner` and `Ready` variants contained a
single value. Each have been converted to struct variants and the inner value is now accessible by the `inner` field
instead of the `0` field.

**New this release:**
- 🎉 ([smithy-rs#1411](https://github.com/awslabs/smithy-rs/issues/1411), [smithy-rs#1167](https://github.com/awslabs/smithy-rs/issues/1167)) Upgrade to Gradle 7. This change is not a breaking change, however, users of smithy-rs will need to switch to JDK 17
- 🐛 ([smithy-rs#1505](https://github.com/awslabs/smithy-rs/issues/1505), @kiiadi) Fix issue with codegen on Windows where module names were incorrectly determined from filenames

**Contributors**
Thank you for your contributions! ❤
- @kiiadi ([smithy-rs#1505](https://github.com/awslabs/smithy-rs/issues/1505))
<!-- Do not manually edit this file, use `update-changelogs` -->
v0.44.0 (June 22nd, 2022)
=========================
**New this release:**
- ([smithy-rs#1460](https://github.com/awslabs/smithy-rs/issues/1460)) Fix a potential bug with `ByteStream`'s implementation of `futures_core::stream::Stream` and add helpful error messages
for users on 32-bit systems that try to stream HTTP bodies larger than 4.29Gb.
- 🐛 ([smithy-rs#1427](https://github.com/awslabs/smithy-rs/issues/1427), [smithy-rs#1465](https://github.com/awslabs/smithy-rs/issues/1465), [smithy-rs#1459](https://github.com/awslabs/smithy-rs/issues/1459)) Fix RustWriter bugs for `rustTemplate` and `docs` utility methods
- 🐛 ([aws-sdk-rust#554](https://github.com/awslabs/aws-sdk-rust/issues/554)) Requests to Route53 that return `ResourceId`s often come with a prefix. When passing those IDs directly into another
request, the request would fail unless they manually stripped the prefix. Now, when making a request with a prefixed ID,
the prefix will be stripped automatically.


v0.43.0 (June 9th, 2022)
========================
**New this release:**
Expand Down
25 changes: 11 additions & 14 deletions CHANGELOG.next.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,16 @@
# author = "rcoh"

[[aws-sdk-rust]]
message = "Fix bug in profile file credential provider where a missing `default` profile lead to an unintended error."
references = ["aws-sdk-rust#547", "smithy-rs#1458"]
meta = { "breaking" = false, "tada" = false, "bug" = true }
author = "rcoh"

[[aws-sdk-rust]]
message = "Add `Debug` implementation to several types in `aws-config`"
references = ["smithy-rs#1421"]
message = """
Add support for aws-chunked content encoding. Only single-chunk encoding is supported. Multiple chunks and
chunk signing are not supported at this time.
"""
references = ["smithy-rs#1263"]
meta = { "breaking" = false, "tada" = false, "bug" = false }
author = "jdisanti"
author = "Velfi"

[[smithy-rs]]
message = "Fix RustWriter bugs for `rustTemplate` and `docs` utility methods"
references = ["smithy-rs#1427", "smithy-rs#1465", "smithy-rs#1459"]
meta = { "breaking" = false, "tada" = false, "bug" = true }
author = "rcoh"
[[aws-sdk-rust]]
message = "Re-export aws_types::SdkConfig in aws_config"
references = ["smithy-rs#1457"]
meta = { "breaking" = false, "tada" = true, "bug" = false }
author = "calavera"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The latest unreleased SDK build can be found in [aws-sdk-rust/next](https://gith
Setup
-----

1. `./gradlew` will setup gradle for you. JDK 11 is required.
1. `./gradlew` will setup gradle for you. JDK 17 is required.
2. Running tests requires a working Rust installation. See [Rust docs](https://www.rust-lang.org/learn/get-started) for
installation instructions on your platform. Minimum supported Rust version is the latest released Rust version, although older versions may work.

Expand Down
Loading

0 comments on commit a0dd263

Please sign in to comment.