Skip to content

Commit

Permalink
Merge branch 'main' into gradle-7
Browse files Browse the repository at this point in the history
  • Loading branch information
rcoh authored Jun 22, 2022
2 parents ab0e580 + 9f47071 commit 539448f
Show file tree
Hide file tree
Showing 340 changed files with 22,200 additions and 5,564 deletions.
78 changes: 1 addition & 77 deletions .github/workflows/pull-request-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,85 +120,10 @@ jobs:
run: |
aws s3 cp target/doc "s3://${S3_BUCKET_NAME}/docs/${{ github.event.pull_request.head.sha }}" --recursive
generate-server-benchmark:
name: Generate server benchmark
runs-on: ubuntu-latest
outputs:
bot-message: ${{ steps.run-benchmark.outputs.bot-message }}
steps:
- name: Checkout PR
uses: actions/checkout@v3
with:
path: pull-request
- name: Checkout origin/main
uses: actions/checkout@v3
with:
repository: awslabs/smithy-rs
path: origin-main
ref: main
- name: Checkout wrk
uses: actions/checkout@v3
with:
repository: wg/wrk
path: wrk-build
ref: 4.2.0
- uses: actions/cache@v2
name: Gradle Cache
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
# Pinned to the commit hash of v1.3.0
- name: Rust Cache
uses: Swatinem/rust-cache@842ef286fff290e445b90b4002cc9807c3669641
with:
sharedKey: ${{ runner.os }}-${{ env.rust_version }}-${{ github.job }}
target-dir: ./target
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: ${{ env.java_version }}
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.rust_version }}
components: ${{ env.rust_toolchain_components }}
default: true
- name: Install benchmarks dependencies
run: sudo apt-get update && sudo apt-get install -y ${{ env.apt_dependencies }}
# Ubuntu 20.04 doesn't have wrk packaged, hence we need to build it 🤦
# This will go away as soon as GitHub supports Ubuntu 21.10.
- name: Install wrk
run: cd wrk-build && make -j8 wrk && sudo cp wrk /usr/local/bin
- name: Run benchmark
id: run-benchmark
run: |
mkdir -p ~/.wrk-api-bench
# run the benchmark on origin/main
pushd origin-main/rust-runtime/aws-smithy-http-server/examples
make && RUN_BENCHMARKS=1 cargo test --release
popd
# run the benchmark on current ref
pushd pull-request/rust-runtime/aws-smithy-http-server/examples
make && RUN_BENCHMARKS=1 cargo test --release
popd
# Uncomment this for debugging purposes. It will print out the
# content of all the benchmarks found in the cache + the last one
# produced by the current run.
# for x in ~/.wrk-api-bench/*; do echo "Benchmark $x content:"; jq . "$x"; echo; done
# Ensure the output is available for the PR bot.
echo "::set-output name=bot-message::$(cat /tmp/smithy_rs_benchmark_deviation.txt)"
post-bot-comment:
needs:
- generate-diff
- generate-doc-preview
- generate-server-benchmark
runs-on: ubuntu-latest
name: Post bot comment
permissions:
Expand Down Expand Up @@ -226,6 +151,5 @@ jobs:
owner: context.repo.owner,
repo: context.repo.repo,
body: '${{ steps.bot-messages.outputs.codegen-diff }}\n\n' +
'${{ needs.generate-doc-preview.outputs.bot-message }}\n\n' +
'${{ needs.generate-server-benchmark.outputs.bot-message }}\n\n'
'${{ needs.generate-doc-preview.outputs.bot-message }}\n\n'
})
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
<!-- Do not manually edit this file, use `update-changelogs` -->
v0.43.0 (June 9th, 2022)
========================
**New this release:**
- 🎉 ([smithy-rs#1381](https://github.com/awslabs/smithy-rs/issues/1381), @alonlud) Add ability to sign a request with all headers, or to change which headers are excluded from signing
- 🎉 ([smithy-rs#1390](https://github.com/awslabs/smithy-rs/issues/1390)) Add method `ByteStream::into_async_read`. This makes it easy to convert `ByteStream`s into a struct implementing `tokio:io::AsyncRead`. Available on **crate feature** `rt-tokio` only.
- ([smithy-rs#1404](https://github.com/awslabs/smithy-rs/issues/1404), @petrosagg) Add ability to specify a different rust crate name than the one derived from the package name
- ([smithy-rs#1404](https://github.com/awslabs/smithy-rs/issues/1404), @petrosagg) Switch to [RustCrypto](https://github.com/RustCrypto)'s implementation of MD5.

**Contributors**
Thank you for your contributions! ❤
- @alonlud ([smithy-rs#1381](https://github.com/awslabs/smithy-rs/issues/1381))
- @petrosagg ([smithy-rs#1404](https://github.com/awslabs/smithy-rs/issues/1404))

v0.42.0 (May 13th, 2022)
========================
**Breaking Changes:**
Expand Down
65 changes: 38 additions & 27 deletions CHANGELOG.next.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,38 +11,49 @@
# meta = { "breaking" = false, "tada" = false, "bug" = false }
# author = "rcoh"

[[smithy-rs]]
message = "Add ability to sign a request with all headers, or to change which headers are excluded from signing"
references = ["smithy-rs#1381"]
meta = { "breaking" = false, "tada" = true, "bug" = false }
author = "alonlud"
[[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 method `ByteStream::into_async_read`. This makes it easy to convert `ByteStream`s into a struct implementing `tokio:io::AsyncRead`. Available on **crate feature** `rt-tokio` only."
references = ["smithy-rs#1390"]
meta = { "breaking" = false, "tada" = true, "bug" = false }
author = "Velfi"
[[smithy-rs]]
message = """
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.
"""
references = ["smithy-rs#1460"]
meta = { "breaking" = false, "tada" = false, "bug" = false }
author = "Velfi"

[[smithy-rs]]
message = "Add method `ByteStream::into_async_read`. This makes it easy to convert `ByteStream`s into a struct implementing `tokio:io::AsyncRead`. Available on **crate feature** `rt-tokio` only."
references = ["smithy-rs#1390"]
meta = { "breaking" = false, "tada" = true, "bug" = false }
author = "Velfi"
[[aws-sdk-rust]]
message = "Add `Debug` implementation to several types in `aws-config`"
references = ["smithy-rs#1421"]
meta = { "breaking" = false, "tada" = false, "bug" = false }
author = "jdisanti"

[[smithy-rs]]
message = "Add ability to specify a different rust crate name than the one derived from the package name"
references = ["smithy-rs#1404"]
meta = { "breaking" = false, "tada" = false, "bug" = false }
author = "petrosagg"
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"

[[smithy-rs]]
message = "Switch to [RustCrypto](https://github.com/RustCrypto)'s implementation of MD5."
references = ["smithy-rs#1404"]
meta = { "breaking" = false, "tada" = false, "bug" = false }
author = "petrosagg"
message = """
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.
"""
references = ["aws-sdk-rust#554"]
meta = { "breaking" = false, "tada" = false, "bug" = true }
author = "Velfi"

[[aws-sdk-rust]]
message = "Switch to [RustCrypto](https://github.com/RustCrypto)'s implementation of MD5."
references = ["smithy-rs#1404"]
meta = { "breaking" = false, "tada" = false, "bug" = false }
author = "petrosagg"
message = """
Fix bug in retry policy where user configured timeouts were not retried. With this fix, setting
[`with_call_attempt_timeout`](https://docs.rs/aws-smithy-types/0.43.0/aws_smithy_types/timeout/struct.Api.html#method.with_call_attempt_timeout)
will lead to a retry when retries are enabled.
"""
meta = { "breaking" = false, "tada" = false, "bug" = true }
references = ["aws-sdk-rust#558", "smithy-rs#1478"]
author = "rcoh"
8 changes: 7 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ Contributions via pull requests are much appreciated. Before sending us a pull r

1. You are working against the latest source on the *main* branch.
2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already.
3. You open an issue to discuss any significant work - we would hate for your time to be wasted.
3. **You open an issue to discuss any significant work** - we would hate for your time to be wasted. Alternatively, you
may submit an RFC. You can learn about our RFC process [here](./design/src/rfcs/overview.md).

To send us a pull request, please:

Expand Down Expand Up @@ -57,3 +58,8 @@ If you discover a potential security issue in this project we ask that you notif
## Licensing

See the [LICENSE](LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution.

## More helpful information for contributors

Part of our [design docs](./design/src/overview.md) are dedicated to helpful information for contributors.
[Take a look](./design/src/contributing/overview.md).
12 changes: 12 additions & 0 deletions aws/SDK_CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
<!-- Do not manually edit this file, use `update-changelogs` -->
v0.13.0 (June 9th, 2022)
========================
**New this release:**
- 🎉 ([smithy-rs#1390](https://github.com/awslabs/smithy-rs/issues/1390)) Add method `ByteStream::into_async_read`. This makes it easy to convert `ByteStream`s into a struct implementing `tokio:io::AsyncRead`. Available on **crate feature** `rt-tokio` only.
- 🎉 ([smithy-rs#1356](https://github.com/awslabs/smithy-rs/issues/1356), @jszwedko) Add support for `credential_process` in AWS configs for fetching credentials from an external process.
- ([smithy-rs#1404](https://github.com/awslabs/smithy-rs/issues/1404), @petrosagg) Switch to [RustCrypto](https://github.com/RustCrypto)'s implementation of MD5.

**Contributors**
Thank you for your contributions! ❤
- @jszwedko ([smithy-rs#1356](https://github.com/awslabs/smithy-rs/issues/1356))
- @petrosagg ([smithy-rs#1404](https://github.com/awslabs/smithy-rs/issues/1404))

v0.12.0 (May 13th, 2022)
========================
**New this release:**
Expand Down
6 changes: 3 additions & 3 deletions aws/rust-runtime/aws-config/src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl<T, E> ExpiringCache<T, E>
where
T: Clone,
{
pub fn new(buffer_time: Duration) -> Self {
pub(crate) fn new(buffer_time: Duration) -> Self {
ExpiringCache {
buffer_time,
value: Arc::new(RwLock::new(OnceCell::new())),
Expand All @@ -64,7 +64,7 @@ where
/// and the others will await that thread's result rather than multiple refreshes occurring.
/// The function given to acquire a value future, `f`, will not be called
/// if another thread is chosen to load the value.
pub async fn get_or_load<F, Fut>(&self, f: F) -> Result<T, E>
pub(crate) async fn get_or_load<F, Fut>(&self, f: F) -> Result<T, E>
where
F: FnOnce() -> Fut,
Fut: Future<Output = Result<(T, SystemTime), E>>,
Expand All @@ -75,7 +75,7 @@ where
}

/// If the value is expired, clears the cache. Otherwise, yields the current value.
pub async fn yield_or_clear_if_expired(&self, now: SystemTime) -> Option<T> {
pub(crate) async fn yield_or_clear_if_expired(&self, now: SystemTime) -> Option<T> {
// Short-circuit if the value is not expired
if let Some((value, expiry)) = self.value.read().await.get() {
if !expired(*expiry, self.buffer_time, now) {
Expand Down
Loading

0 comments on commit 539448f

Please sign in to comment.