Skip to content

Commit fbdf459

Browse files
Merge branch 'main' into RFC30/tests
1 parent 149711f commit fbdf459

File tree

1,355 files changed

+208492
-66417
lines changed

Some content is hidden

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

1,355 files changed

+208492
-66417
lines changed

.cargo/config.toml

-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
[build]
22
# Share one `target` directory at the project root for all Cargo projects and workspaces in smithy-rs
33
target-dir = "target"
4-
5-
# TODO(https://github.com/awslabs/smithy-rs/issues/2766): The sparse registry config can be removed when upgrading to Rust 1.70
6-
[registries.crates-io]
7-
protocol = "sparse"

.github/scripts/get-or-create-release-branch.sh

+41-32
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ set -eux
1414
# is the beginning of a new release series.
1515

1616
if [ -z "$SEMANTIC_VERSION" ]; then
17-
echo "'SEMANTIC_VERSION' must be populated."
18-
exit 1
17+
echo "'SEMANTIC_VERSION' must be populated."
18+
exit 1
1919
fi
2020

2121
if [ -z "$1" ]; then
22-
echo "You need to specify the path of the file where you want to collect the output"
23-
exit 1
22+
echo "You need to specify the path of the file where you want to collect the output"
23+
exit 1
2424
else
25-
output_file="$1"
25+
output_file="$1"
2626
fi
2727

2828
# Split on the dots
@@ -31,41 +31,50 @@ major=${version_array[0]}
3131
minor=${version_array[1]}
3232
patch=${version_array[2]}
3333
if [[ "${major}" == "" || "${minor}" == "" || "${patch}" == "" ]]; then
34-
echo "'${SEMANTIC_VERSION}' is not a valid semver tag"
35-
exit 1
34+
echo "'${SEMANTIC_VERSION}' is not a valid semver tag"
35+
exit 1
3636
fi
3737
if [[ $major == 0 ]]; then
38-
branch_name="smithy-rs-release-${major}.${minor}.x"
39-
if [[ $patch == 0 ]]; then
40-
echo "new_release_series=true" >"${output_file}"
41-
fi
38+
branch_name="smithy-rs-release-${major}.${minor}.x"
39+
if [[ $patch == 0 ]]; then
40+
echo "new_release_series=true" >"${output_file}"
41+
fi
4242
else
43-
branch_name="smithy-rs-release-${major}.x.y"
44-
if [[ $minor == 0 && $patch == 0 ]]; then
45-
echo "new_release_series=true" >"${output_file}"
46-
fi
43+
branch_name="smithy-rs-release-${major}.x.y"
44+
if [[ $minor == 0 && $patch == 0 ]]; then
45+
echo "new_release_series=true" >"${output_file}"
46+
fi
4747
fi
4848

4949
if [[ "${DRY_RUN}" == "true" ]]; then
50-
branch_name="${branch_name}-preview"
50+
branch_name="${branch_name}-preview"
5151
fi
5252
echo "release_branch=${branch_name}" >"${output_file}"
5353

54-
if [[ "${DRY_RUN}" == "true" ]]; then
55-
git push --force origin "HEAD:refs/heads/${branch_name}"
56-
else
57-
commit_sha=$(git rev-parse --short HEAD)
58-
if ! git ls-remote --exit-code --heads origin "${branch_name}"; then
59-
# The release branch does not exist.
60-
# We need to make sure that the commit SHA that we are releasing is on `main`.
61-
git fetch origin main
62-
if git branch --contains "${commit_sha}" | grep main; then
63-
# We can then create the release branch and set the current commit as its tip
64-
git checkout -b "${branch_name}"
65-
git push origin "${branch_name}"
66-
else
67-
echo "You must choose a commit from main to create a new release branch!"
68-
exit 1
69-
fi
54+
commit_sha=$(git rev-parse --short HEAD)
55+
# the git repo is in a weird state because **main has never been checked out**!
56+
# This prevents the `git branch --contains` from working because there is no _local_ ref for main
57+
git checkout main
58+
git checkout "${commit_sha}"
59+
if ! git ls-remote --exit-code --heads origin "${branch_name}"; then
60+
# The release branch does not exist.
61+
# We need to make sure that the commit SHA that we are releasing is on `main`.
62+
git fetch origin main
63+
echo "Branches: "
64+
git branch --contains "${commit_sha}"
65+
git show origin/main | head -n 1
66+
if git branch --contains "${commit_sha}" | grep main; then
67+
# We can then create the release branch and set the current commit as its tip
68+
if [[ "${DRY_RUN}" == "true" ]]; then
69+
git push --force origin "HEAD:refs/heads/${branch_name}"
70+
else
71+
git checkout -b "${branch_name}"
72+
git push origin "${branch_name}"
7073
fi
74+
else
75+
echo "You must choose a commit from main to create a new release branch!"
76+
exit 1
77+
fi
78+
else
79+
echo "Patch release ${branch_name} already exists"
7180
fi

.github/workflows/ci-merge-queue.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
needs:
8585
- save-docker-login-token
8686
- acquire-base-image
87-
if: ${{ github.event.pull_request.head.repo.full_name == 'awslabs/smithy-rs' || toJSON(github.event.merge_group) != '{}' }}
87+
if: ${{ github.event.pull_request.head.repo.full_name == 'smithy-lang/smithy-rs' || toJSON(github.event.merge_group) != '{}' }}
8888
uses: ./.github/workflows/ci.yml
8989
with:
9090
run_sdk_examples: true

.github/workflows/ci-pr-forks.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
# it uploads the image as a build artifact for other jobs to download and use.
1919
acquire-base-image:
2020
name: Acquire Base Image
21-
if: ${{ github.event.pull_request.head.repo.full_name != 'awslabs/smithy-rs' }}
21+
if: ${{ github.event.pull_request.head.repo.full_name != 'smithy-lang/smithy-rs' }}
2222
runs-on: ubuntu-latest
2323
steps:
2424
- uses: actions/checkout@v3
@@ -39,7 +39,7 @@ jobs:
3939
# Run shared CI after the Docker build image has either been rebuilt or found in ECR
4040
ci:
4141
needs: acquire-base-image
42-
if: ${{ github.event.pull_request.head.repo.full_name != 'awslabs/smithy-rs' }}
42+
if: ${{ github.event.pull_request.head.repo.full_name != 'smithy-lang/smithy-rs' }}
4343
uses: ./.github/workflows/ci.yml
4444
with:
4545
run_sdk_examples: true

.github/workflows/ci-pr.yml

+11-5
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
# The login password is encrypted with the repo secret DOCKER_LOGIN_TOKEN_PASSPHRASE
2222
save-docker-login-token:
2323
name: Save a docker login token
24-
if: ${{ github.event.pull_request.head.repo.full_name == 'awslabs/smithy-rs' }}
24+
if: ${{ github.event.pull_request.head.repo.full_name == 'smithy-lang/smithy-rs' }}
2525
outputs:
2626
docker-login-password: ${{ steps.set-token.outputs.docker-login-password }}
2727
permissions:
@@ -51,8 +51,8 @@ jobs:
5151
acquire-base-image:
5252
name: Acquire Base Image
5353
needs: save-docker-login-token
54-
if: ${{ github.event.pull_request.head.repo.full_name == 'awslabs/smithy-rs' }}
55-
runs-on: ubuntu-latest
54+
if: ${{ github.event.pull_request.head.repo.full_name == 'smithy-lang/smithy-rs' }}
55+
runs-on: smithy_ubuntu-latest_8-core
5656
env:
5757
ENCRYPTED_DOCKER_PASSWORD: ${{ needs.save-docker-login-token.outputs.docker-login-password }}
5858
DOCKER_LOGIN_TOKEN_PASSPHRASE: ${{ secrets.DOCKER_LOGIN_TOKEN_PASSPHRASE }}
@@ -86,7 +86,7 @@ jobs:
8686
needs:
8787
- save-docker-login-token
8888
- acquire-base-image
89-
if: ${{ github.event.pull_request.head.repo.full_name == 'awslabs/smithy-rs' }}
89+
if: ${{ github.event.pull_request.head.repo.full_name == 'smithy-lang/smithy-rs' }}
9090
uses: ./.github/workflows/ci.yml
9191
with:
9292
run_sdk_examples: true
@@ -97,7 +97,7 @@ jobs:
9797
# The PR bot requires a Docker build image, so make it depend on the `acquire-base-image` job.
9898
pr_bot:
9999
name: PR Bot
100-
if: ${{ github.event.pull_request.head.repo.full_name == 'awslabs/smithy-rs' }}
100+
if: ${{ github.event.pull_request.head.repo.full_name == 'smithy-lang/smithy-rs' }}
101101
needs: acquire-base-image
102102
uses: ./.github/workflows/pull-request-bot.yml
103103
with:
@@ -114,6 +114,12 @@ jobs:
114114
needs:
115115
- save-docker-login-token
116116
- acquire-base-image
117+
# We need `always` here otherwise this job won't run if the previous job has been skipped
118+
# See https://samanpavel.medium.com/github-actions-conditional-job-execution-e6aa363d2867
119+
if: |
120+
always() &&
121+
!contains(needs.*.result, 'failure') &&
122+
!contains(needs.*.result, 'cancelled')
117123
steps:
118124
- uses: actions/checkout@v3
119125
with:

.github/workflows/ci-tls.yml

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# This workflow tests the TLS configuration of the smithy-rs client
5+
# To run on an Ubuntu machine, run each step in this order.
6+
# Each script can be run on your Ubuntu host.
7+
# You will have to install Docker and rustc/cargo manually.
8+
9+
env:
10+
rust_version: 1.68.2
11+
12+
name: Verify client TLS configuration
13+
on:
14+
pull_request:
15+
push:
16+
branches: [main]
17+
18+
jobs:
19+
verify-tls-config:
20+
name: Verify TLS configuration
21+
runs-on: ubuntu-latest
22+
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,+ssooidc
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

.github/workflows/ci.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ on:
2929
required: false
3030

3131
env:
32-
rust_version: 1.68.2
32+
rust_version: 1.70.0
3333
rust_toolchain_components: clippy,rustfmt
3434
ENCRYPTED_DOCKER_PASSWORD: ${{ secrets.ENCRYPTED_DOCKER_PASSWORD }}
3535
DOCKER_LOGIN_TOKEN_PASSPHRASE: ${{ secrets.DOCKER_LOGIN_TOKEN_PASSPHRASE }}
@@ -84,9 +84,6 @@ jobs:
8484
test:
8585
- action: check-aws-sdk-adhoc-tests
8686
runner: ubuntu-latest
87-
# TODO(enableNewSmithyRuntimeCleanup): Remove `check-aws-sdk-orchestrator-impl` when cleaning up middleware
88-
- action: check-aws-sdk-orchestrator-impl
89-
runner: smithy_ubuntu-latest_8-core
9087
- action: check-client-codegen-integration-tests
9188
runner: smithy_ubuntu-latest_8-core
9289
- action: check-client-codegen-unit-tests
@@ -189,6 +186,9 @@ jobs:
189186
with:
190187
toolchain: ${{ env.rust_version }}
191188
components: ${{ env.rust_toolchain_components }}
189+
# To fix OpenSSL not found on Windows: https://github.com/sfackler/rust-openssl/issues/1542
190+
- run: echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append
191+
- run: vcpkg install openssl:x64-windows-static-md
192192
- name: Run tests
193193
shell: bash
194194
run: |

.github/workflows/claim-crate-names.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ concurrency:
1010
cancel-in-progress: true
1111

1212
env:
13-
rust_version: 1.68.2
13+
rust_version: 1.70.0
1414

1515
name: Claim unpublished crate names on crates.io
1616
run-name: ${{ github.workflow }}

.github/workflows/github-pages.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
name: Update GitHub Pages
99

1010
env:
11-
rust_version: 1.68.2
11+
rust_version: 1.70.0
1212

1313
# Allow only one doc pages build to run at a time for the entire smithy-rs repo
1414
concurrency:
@@ -37,7 +37,7 @@ jobs:
3737
3838
pushd design &>/dev/null
3939
cargo install mdbook
40-
cargo install mdbook-mermaid
40+
cargo install --locked mdbook-mermaid
4141
mdbook build --dest-dir ../../output
4242
popd &>/dev/null
4343

.github/workflows/pull-request-bot.yml

+6-7
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,11 @@ concurrency:
2828

2929
env:
3030
java_version: 11
31-
rust_version: 1.68.2
3231
rust_toolchain_components: clippy,rustfmt
3332
apt_dependencies: libssl-dev gnuplot jq
34-
3533
jobs:
3634
generate-diff:
37-
runs-on: ubuntu-latest
35+
runs-on: smithy_ubuntu-latest_8-core
3836
name: Generate diff and upload to S3
3937
env:
4038
AWS_REGION: us-west-2
@@ -69,7 +67,7 @@ jobs:
6967
fi
7068
7169
generate-doc-preview:
72-
runs-on: ubuntu-latest
70+
runs-on: smithy_ubuntu-latest_8-core
7371
name: Generate rustdoc preview and upload to S3
7472
env:
7573
AWS_REGION: us-west-2
@@ -100,14 +98,14 @@ jobs:
10098
java-version: ${{ env.java_version }}
10199
- uses: dtolnay/rust-toolchain@master
102100
with:
103-
toolchain: ${{ env.rust_version }}
101+
toolchain: nightly
104102
- name: Generate doc preview
105103
id: generate-preview
106104
# Only generate three of the smallest services since the doc build can be very large. STS and SSO must be
107105
# included since aws-config depends on them. Transcribe Streaming and DynamoDB (paginators/waiters) were chosen
108106
# below to stay small while still representing most features. Combined, they are about ~20MB at time of writing.
109107
run: |
110-
./gradlew -Paws.services=+sts,+sso,+transcribestreaming,+dynamodb :aws:sdk:assemble
108+
./gradlew -Paws.services=+sts,+sso,+ssooidc,+transcribestreaming,+dynamodb :aws:sdk:assemble
111109
112110
# Copy the Server runtime crate(s) in
113111
cp -r rust-runtime/aws-smithy-http-server rust-runtime/aws-smithy-http-server-python rust-runtime/aws-smithy-http-server-typescript aws/sdk/build/aws-sdk/sdk
@@ -120,7 +118,8 @@ jobs:
120118
# Add server runtime crates to the workspace
121119
sed -i 's/"sdk\/sts",/"sdk\/sts","sdk\/aws-smithy-http-server","sdk\/aws-smithy-http-server-python","sdk\/aws-smithy-http-server-typescript",/' Cargo.toml
122120
123-
cargo doc --no-deps --all-features
121+
RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --all-features --no-deps
122+
124123
popd
125124
./tools/ci-scripts/generate-doc-preview-index.sh ${{ inputs.base_revision }}
126125

0 commit comments

Comments
 (0)