Commit Graph

2705 Commits

Author SHA1 Message Date
AWS SDK Rust Bot 191c5771e3
Fix constraint-related errors in Rpcv2CBOR server implementation (#3794) 2024-10-01 14:04:57 +01:00
AWS SDK Rust Bot 27ca7f1671
Merge branch 'main' into fahadzub/cbor-constraint 2024-10-01 12:32:52 +01:00
Fahad Zubair 684c15f39c
Set MSRV in rust-toolchain.toml using the gradle.property (#3841)
The `rust-toolchain.toml` file for tests now uses the `rust.msrv` value
from the `gradle.properties` file.

This PR also fixes an issue where the `rust-toolchain.toml` file was not
created in the overridden test directory when `overrideTestDir` was set.
This caused the installed compiler version to be used, resulting in
errors with the latest compiler and preventing the use of
`overrideTestDir`.

Closes: #2048

---------

Co-authored-by: Fahad Zubair <fahadzub@amazon.com>
2024-10-01 05:02:27 +00:00
ysaito1001 abd28bc71e
Use correct env var name in a doc comment for Assume Role session name (#3854)
## Motivation and Context
The correct environment variable name for Assume Role session name is
`AWS_ROLE_SESSION_NAME`. We do use the correct name throughout the
codebase except for a doc comment. This PR will fix it.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-09-30 19:45:56 +00:00
Russell Cohen 12cf9160c4
Update serde implementation to support out of range floats (#3825)
## Motivation and Context
Fix serde behavior to match generated code. This is important to avoid
loosing data during serialization, especially as out-of-range floats
often indicate an error.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-09-30 17:20:20 +00:00
Fahad Zubair 35a90991e3
Merge branch 'main' into fahadzub/cbor-constraint 2024-09-30 11:34:39 -04:00
Fahad Zubair d8fbf47d21
`aws_smithy_http_server::*` should be re-exported from generated crates (#3839)
Many customers have reported the need to explicitly depend on the
`aws-smithy-http-server` crate in their service handler code. When they
re-generate the crate, they often encounter version mismatches between
the `aws-smithy-http-server` crate used in the generated code and the
one they use in their service handler. This version discrepancy leads to
compilation errors, requiring them to manually adjust the crate
versions, which adds friction to their development workflow.

To resolve this issue, we now re-export all relevant types from
`aws-smithy-http-server` within the generated crates. By doing so,
customers can use these re-exported types directly, eliminating the need
to depend on `aws-smithy-http-server` in their handler code.

Additionally, the generated crates no longer have the `aws-lambda`
feature flag enabled by default. This prevents the `aws-lambda` feature
from being automatically enabled in `aws-smithy-http-server` when the
SDK is not intended for AWS Lambda.

---------

Co-authored-by: Fahad Zubair <fahadzub@amazon.com>
2024-09-30 14:04:12 +00:00
Fahad Zubair fcf670dffa
Merge branch 'main' into fahadzub/cbor-constraint 2024-09-30 05:35:34 -04:00
Zelda Hessler 37c1cc0b31
add codegen test for sigv4a EPR (#3848)
exactly what it says on the tin. Let me know if we should have any other
tests verifying the function of sigv4a auth schemes.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-09-26 16:03:04 +00:00
AWS SDK Rust Bot a64982a415
Merge smithy-rs-release-1.x.y into main (#3849) 2024-09-26 10:46:01 -05:00
AWS SDK Rust Bot 59597c2a29 Synchronize the SDK lockfile 2024-09-26 14:56:37 +00:00
AWS SDK Rust Bot 3e6f125a57 Update changelog 2024-09-26 14:51:20 +00:00
Landon James 2f29209c1e
Updating Smithy to 1.51.0 (#3847)
## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here -->
Updating Smithy to 1.51.0 to get the updated `httpChecksum` trait
changes

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._

---------

Co-authored-by: ysaito1001 <awsaito@amazon.com>
2024-09-25 16:59:38 +00:00
ysaito1001 da741dca5b
Add workflows to manually/weekly update the runtime lockfiles and the SDK lockfile (#3844)
## Motivation and Context
This PR introduces GitHub workflows to automate the process of running
`cargo update` on lockfiles and creating PRs in this repository.
- Scheduled workflow: This workflow runs weekly to ensure dependencies
are updated to the latest semver-compliant versions.
- Manual workflow: This workflow provides the same functionality but can
be triggered on-demand. It includes an option to force updates on [known
broken
dependencies](6b42eb5ca0/aws/sdk/build.gradle.kts (L503-L504)).

## Testing
- Did NOT run a scheduled workflow, assuming that's a thin wrapper
around what has been verified. We can afford a "see what happens and fix
if necessary" approach once this PR is merged into main.
- Manually triggered a workflow, successfully opening PRs with updated
lockfiles ([ex1](https://github.com/smithy-lang/smithy-rs/pull/3842),
[ex2](https://github.com/smithy-lang/smithy-rs/pull/3843)).
- Manually triggered a workflow, forcing updates on broken dependencies
(didn't open a PR to avoid noise, but confirmed `minicbor` was [updated
to
0.24.4](088cbe9f52/rust-runtime/Cargo.lock (L2245-L2246))).

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-09-25 13:30:43 +00:00
Fahad Zubair 6ec8db1786
Add -L to the curl command to download openssl-1.0.2 (#3846)
The GitHub workflow for `exotic platform` downloads the `openssl.sh`
script, which tries to download
`https://www.openssl.org/source/openssl-1.0.2t.tar.gz`, but the file has
been permanently moved. This PR updates the `curl` command to include
the `-L` option.

Co-authored-by: Fahad Zubair <fahadzub@amazon.com>
2024-09-25 05:51:29 +00:00
Landon James 6b42eb5ca0
Update `SmokeTestDecoratorTest` (#3840)
## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here -->
Add tests the were skipped in
https://github.com/smithy-lang/smithy-rs/pull/3836 in favor of merging
and unblocking customer.

## Description
<!--- Describe your changes in detail -->
Testing our smoketest generator with the `UseDualStack` and `UseFips`
endpoint built-ins. Previously the smoketest generator assumed that
these were always available, but they are only available if those
built-ins are included in the endpoints rule set of the model. We now
test the smoke test with both of these built-ins, with each by itself,
and with neither.

## Testing
<!--- Please describe in detail how you tested your changes -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->


## Checklist
Just a test change, no changelog

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._

---------

Co-authored-by: ysaito1001 <awsaito@amazon.com>
2024-09-18 20:32:33 +00:00
ysaito1001 b62000e4d7
Synchronize the SDK lockfile during release (#3838)
## Description
This PR introduces an additional step to the
`generate-smithy-rs-release` script to synchronize the SDK lockfile with
the runtime lockfiles and the Cargo dependencies specified in
[CargoDependency.kt](https://github.com/smithy-lang/smithy-rs/blob/main/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/rustlang/CargoDependency.kt).
For more details on why we synchronize the SDK lockfile, please refer to
the sdk-lockfiles
[README](https://github.com/smithy-lang/smithy-rs/tree/main/tools/ci-build/sdk-lockfiles).

We've decided to synchronize the SDK lockfile during release for the
following reasons:
- Synchronization occurs behind the scenes, avoiding disruptions to the
development workflow, unlike enforcing this check during pre-commit
- It is a single-sourced place for synchronizing the SDK lockfile

## Testing
Tested with the following scenario:
1. Added a dummy dependency to `aws-smithy-runtime` and updated
`rust-runtime/Cargo.lock`
```
--- a/rust-runtime/aws-smithy-runtime/Cargo.toml
+++ b/rust-runtime/aws-smithy-runtime/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "aws-smithy-runtime"
-version = "1.7.1"
+version = "1.7.2"
 authors = ["AWS Rust SDK Team <aws-sdk-rust@amazon.com>", "Zelda Hessler <zhessler@amazon.com>"]
 description = "The new smithy runtime crate"
 edition = "2021"
@@ -41,6 +41,7 @@ hyper-rustls = { version = "0.24", features = ["rustls-native-certs", "http2"],
 once_cell = "1.18.0"
 pin-project-lite = "0.2.7"
 pin-utils = "0.1.0"
+predicates = "3.1.2"
```
2. `sdk-lockfiles audit` failed as expected
```
➜  smithy-rs git:(ysaito/sync-sdk-lockfile-during-release) sdk-lockfiles audit
2024-09-17T21:48:12.346747Z  INFO sdk_lockfiles::audit: checking whether `rust-runtime/Cargo.lock` is covered by the SDK lockfile...
2024-09-17T21:48:12.381919Z  INFO sdk_lockfiles::audit: checking whether `aws/rust-runtime/Cargo.lock` is covered by the SDK lockfile...
2024-09-17T21:48:12.382360Z  INFO sdk_lockfiles::audit: checking whether `aws/rust-runtime/aws-config/Cargo.lock` is covered by the SDK lockfile...
`difflib` (0.4.0), used by `rust-runtime/Cargo.lock`, is not contained in the SDK lockfile!
`float-cmp` (0.9.0), used by `rust-runtime/Cargo.lock`, is not contained in the SDK lockfile!
`normalize-line-endings` (0.3.0), used by `rust-runtime/Cargo.lock`, is not contained in the SDK lockfile!
`predicates` (3.1.2), used by `rust-runtime/Cargo.lock`, is not contained in the SDK lockfile!
`predicates-core` (1.0.8), used by `rust-runtime/Cargo.lock`, is not contained in the SDK lockfile!
Error: there are lockfile audit failures
```
3. Ran [a dry-run
release](https://github.com/smithy-lang/smithy-rs/actions/runs/10914801466)
4. Confirmed that [the SDK lockfile was synchronized during Generate
release
artifacts](https://github.com/smithy-lang/smithy-rs/actions/runs/10914801466/job/30294275147#step:4:390)
5. Confirmed that [the diffs in the SDK
lockfile](d57a7896d3)
only contained updating the `aws-smithy-runtime` crate version and
adding dummy dependencies.
6. `sdk-lockfiles audit` succeeded in the release artifacts
```
➜  smithy-rs git:(ysaito/sync-sdk-lockfile-during-release) ✗ sdk-lockfiles audit --smithy-rs-path ~/Downloads/smithy-rs-release/smithy-rs
2024-09-17T21:54:15.491070Z  INFO sdk_lockfiles::audit: checking whether `rust-runtime/Cargo.lock` is covered by the SDK lockfile...
2024-09-17T21:54:15.521851Z  INFO sdk_lockfiles::audit: checking whether `aws/rust-runtime/Cargo.lock` is covered by the SDK lockfile...
2024-09-17T21:54:15.522278Z  INFO sdk_lockfiles::audit: checking whether `aws/rust-runtime/aws-config/Cargo.lock` is covered by the SDK lockfile...
SUCCESS
```
----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-09-18 19:56:57 +00:00
Zelda Hessler 1cecc3baa6
Fix request compression (#3820)
## Description
<!--- Describe your changes in detail -->
This PR includes several fixes for request compression:
- `aws_smithy_compression::body::compress::CompressedBody` will no
longer incorrectly return the inner body's `SizeHint`, returning
`SizeHint::default()` instead.
- Fixed a bug where compressed payloads would have an incorrect content
length, causing those requests to hang.
- Compress in-memory request payloads instead of the previous lazy
approach.

## Testing
<!--- Please describe in detail how you tested your changes -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->
Tests are included. Additionally, I ran a reproducer for a user issues
to ensure that their use case works:

```
#[tokio::test]
async fn use_case_reproducer() {
    tracing_subscriber::fmt::init();
    let shared_config = aws_config::from_env()
        .region(aws_sdk_cloudwatch::config::Region::new("us-west-2"))
        .load()
        .await;
    let service_config = aws_sdk_cloudwatch::config::Config::from(&shared_config)
        .to_builder()
        .request_min_compression_size_bytes(1)
        .build();
    let client = Client::from_conf(service_config);

    tracing::info!("sending metrics...");
    client
        .put_metric_data()
        .namespace("CloudWatchTestMetricsBrivinc")
        .metric_data(
            aws_sdk_cloudwatch::types::MetricDatum::builder()
                .metric_name(format!("MyMetricNameIsALittleLong"))
                .value(0.0)
                .build(),
        )
        .send()
        .await
        .unwrap();
}
``` 

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._

---------

Co-authored-by: ysaito1001 <awsaito@amazon.com>
2024-09-18 17:06:58 +00:00
Fahad Zubair 9977516f1f
Merge branch 'main' into fahadzub/cbor-constraint 2024-09-18 06:37:02 -04:00
ysaito1001 ec226c0223
Address post-merge feedback on smithy-rs#3827 (#3834)
## Motivation and Context
Primarily for @drganjoo providing feedback on smithy-rs#3827 (thanks),
but anyone is welcome to review the changes.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-09-17 15:03:55 +00:00
Fahad Zubair 432e0f9e4c
Merge branch 'main' into fahadzub/cbor-constraint 2024-09-17 08:39:12 -04:00
Fahad Zubair 5bbfdc2eec Add comments to clarify that the ServerProtocolBasedTransformationFactory class will be removed later on 2024-09-17 13:38:22 +01:00
Fahad Zubair c36dfb0ff0
Update codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/testutil/EventStreamTestModels.kt
Co-authored-by: david-perez <d@vidp.dev>
2024-09-17 13:20:48 +01:00
Fahad Zubair 13c0c783ca
Update codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/RpcV2Cbor.kt
Co-authored-by: david-perez <d@vidp.dev>
2024-09-17 13:20:39 +01:00
Fahad Zubair 8bf71f1766
Update .changelog/2155171.md
Co-authored-by: david-perez <d@vidp.dev>
2024-09-17 13:20:25 +01:00
Fahad Zubair 3e74cc83b4
Update .changelog/2155171.md
Co-authored-by: david-perez <d@vidp.dev>
2024-09-17 13:20:12 +01:00
AWS SDK Rust Bot bb8cc9a2eb
Merge smithy-rs-release-1.x.y into main (#3837) 2024-09-16 20:58:01 -07:00
AWS SDK Rust Bot e96640bd33 Update changelog 2024-09-17 03:24:57 +00:00
Landon James c622e5e97b
Update Smoketest codegen to be endpoint param aware (#3836)
## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here -->
Smoketests for service were failing because the smoke test assumed that
`use_dual_stack` would be present. But the service's endpoint rules did
not use that bulit-in so it was not.

## Description
<!--- Describe your changes in detail -->
Check if the service actually uses the fips or dual stack built-ins
before adding them to the test.

## Testing
<!--- Please describe in detail how you tested your changes -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->
Did not add tests for this because the current `SmokeTestsDecoratorTest`
isn't actually working and fixing it is going to be a bit of work. Want
to get this in to unblock customer ASAP and will go back and update the
tests once they are unblocked.

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] For changes to the smithy-rs codegen or runtime crates, I have
created a changelog entry Markdown file in the `.changelog` directory,
specifying "client," "server," or both in the `applies_to` key.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._

---------

Co-authored-by: ysaito1001 <awsaito@amazon.com>
2024-09-17 01:35:44 +00:00
Landon James d288ef9d07
Remove stalled stream protection from transcribestreaming (#3831)
## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here -->
https://github.com/awslabs/aws-sdk-rust/issues/1181

## Checklist
- [x] For changes to the AWS SDK, generated SDK code, or SDK runtime
crates, I have created a changelog entry Markdown file in the
`.changelog` directory, specifying "aws-sdk-rust" in the `applies_to`
key.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-09-16 21:53:31 +00:00
ysaito1001 4230687cfe
Add a tool `sdk-lockfiles` to audit lockfiles (#3827)
## Motivation and Context
See
[README](b9f3633526/tools/ci-build/sdk-lockfiles/README.md)

A later PR will use this tool to enforce the check (likely during the
execution of pre-commit-hooks).

## Testing
- Added unit tests for the tool
- Ran the tool against currently checked-in lockflies in the `main`
branch and ensured the SDK lockfile contained dependencies listed in the
other runtime lockfiles.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-09-12 23:08:45 +00:00
ysaito1001 3499f60e1d
Enhance gradle tasks for managing lockfiles (#3829)
## Description
This PR introduces and updates gradle tasks for managing lockfiles. Here
are the highlights:
- [The SDK
lockfile](https://github.com/smithy-lang/smithy-rs/blob/main/aws/sdk/Cargo.lock)
can now be generated directly within the `smithy-rs` repository without
the `aws-sdk-rust` repository.
- The SDK lockfile can be synchronized with runtime lockfiles, updating
only new dependencies while preserving the versions of existing ones.
- To prevent updating broken dependencies to the latest versions, we
track the last known good versions and downgrade them to those versions.

New/updated gradle tasks are intended for automation:
- This existing task no longer requires `-Paws-sdk-rust-path`. We plan
to incorporate it into a weekly GitHub Action to automate lockfile
updates:
```
./gradlew aws:sdk:cargoUpdateAllLockfiles
```
- This new task synchronizes the SDK lockfile with runtime lockfiles. We
plan to integrate it into pre-commit hooks:
```
./gradlew aws:sdk:syncAwsSdkLockfile  
```

In addition, this PR has updated the SDK lockfile by executing
`./gradlew aws:sdk:syncAwsSdkLockfile`. The updated lockfile no longer
includes many SDK crates that are unused in CI/CD processes. The new SDK
lockfile is in sync with the runtime lockfiles:
```
➜  smithy-rs git:(ysaito/enhance-gradle-tasks-for-lockfile) sdk-lockfiles audit
2024-09-12T16:02:25.193765Z  INFO sdk_lockfiles::audit: checking whether `rust-runtime/Cargo.lock` is covered by the SDK lockfile...
2024-09-12T16:02:25.224862Z  INFO sdk_lockfiles::audit: checking whether `aws/rust-runtime/Cargo.lock` is covered by the SDK lockfile...
2024-09-12T16:02:25.225389Z  INFO sdk_lockfiles::audit: checking whether `aws/rust-runtime/aws-config/Cargo.lock` is covered by the SDK lockfile...
SUCCESS
```

## Testing
I have verified the change against basic use cases:

#### When running `cargoUpdateAllLockfiles`, dependencies will be
updated to their latest versions, while broken crates will be pinned to
the last known good versions.

<details>
<summary> Expand for more details...</summary>

When we execute  
```
smithy-rs git:(ysaito/enhance-gradle-tasks-for-lockfile) ✗ ./gradlew aws:sdk:cargoUpdateAllLockfiles
...
BUILD SUCCESSFUL in 1m 7s
```
all lockfiles include the latest versions of dependencies, except for
those that are pinned due to being broken. Currently, minicbor is
[pinned to
0.24.2](7f1d992214/aws/sdk/build.gradle.kts (L503-L504)):
```
➜  smithy-rs git:(ysaito/enhance-gradle-tasks-for-lockfile) ✗ git status
On branch ysaito/enhance-gradle-tasks-for-lockfile
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   aws/rust-runtime/Cargo.lock
	modified:   aws/rust-runtime/aws-config/Cargo.lock
	modified:   aws/sdk/Cargo.lock
	modified:   rust-runtime/Cargo.lock

no changes added to commit (use "git add" and/or "git commit -a")
```
```
➜  smithy-rs git:(ysaito/enhance-gradle-tasks-for-lockfile) ✗ cat aws/sdk/Cargo.lock | rg -C1 minicbor
...
---
[[package]]
name = "minicbor"
version = "0.24.2"
---
...

➜  smithy-rs git:(ysaito/enhance-gradle-tasks-for-lockfile) ✗ cat rust-runtime/Cargo.lock | rg -C1 minicbor
...
---
[[package]]
name = "minicbor"
version = "0.24.2"
---
...
```
Finally, the `sdk-lockfiles audit` command should run successfully after
updating all lockfiles:
```
➜  smithy-rs git:(ysaito/enhance-gradle-tasks-for-lockfile) ✗ sdk-lockfiles audit                       
2024-09-12T15:35:47.890530Z  INFO sdk_lockfiles::audit: checking whether `rust-runtime/Cargo.lock` is covered by the SDK lockfile...
2024-09-12T15:35:47.922468Z  INFO sdk_lockfiles::audit: checking whether `aws/rust-runtime/Cargo.lock` is covered by the SDK lockfile...
2024-09-12T15:35:47.922898Z  INFO sdk_lockfiles::audit: checking whether `aws/rust-runtime/aws-config/Cargo.lock` is covered by the SDK lockfile...
SUCCESS
```

I also specified multiple broken dependencies and verified they were all
downgraded to the specified versions.

</details>

#### When a new dependency is added to a runtime crate, running
`syncAwsSdkLockfile` will ensure that this new dependency is included in
the SDK lockfile.

<details>
<summary> Expand for more details...</summary>

For instance, with [this hypothetical new
dependency](https://github.com/smithy-lang/smithy-rs/pull/3826/files#diff-1ff3734bb74b7c43e3bd74b410f7058c6d40dbe9380458f642201035f9217457):
```
smithy-rs git:(ysaito/enhance-gradle-tasks-for-lockfile) ✗ sdk-lockfiles audit
2024-09-12T15:40:52.795951Z  INFO sdk_lockfiles::audit: checking whether `rust-runtime/Cargo.lock` is covered by the SDK lockfile...
2024-09-12T15:40:52.827407Z  INFO sdk_lockfiles::audit: checking whether `aws/rust-runtime/Cargo.lock` is covered by the SDK lockfile...
2024-09-12T15:40:52.827835Z  INFO sdk_lockfiles::audit: checking whether `aws/rust-runtime/aws-config/Cargo.lock` is covered by the SDK lockfile...
`jiff` (0.1.13), used by `rust-runtime/Cargo.lock`, is not contained in SDK lockfile!
Error: there are lockfile audit failures
```
If we then execute  
```
smithy-rs git:(ysaito/enhance-gradle-tasks-for-lockfile) ✗ ./gradlew aws:sdk:syncAwsSdkLockfile
...
BUILD SUCCESSFUL in 1m 17s
```
the SDK lockfile will be updated to reflect only the change from
`rust-runtime/Cargo.lock`:
```
smithy-rs git:(ysaito/enhance-gradle-tasks-for-lockfile) ✗ git diff aws/sdk/Cargo.lock 
diff --git a/aws/sdk/Cargo.lock b/aws/sdk/Cargo.lock
index bc3870e20..c52040432 100644
--- a/aws/sdk/Cargo.lock
+++ b/aws/sdk/Cargo.lock
@@ -1627,6 +1627,7 @@ dependencies = [
  "aws-smithy-types 1.2.6",
  "chrono",
  "futures-core",
+ "jiff",
  "time",
 ]
 
@@ -2895,6 +2896,12 @@ version = "1.0.11"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b"
 
+[[package]]
+name = "jiff"
+version = "0.1.13"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8a45489186a6123c128fdf6016183fcfab7113e1820eb813127e036e287233fb"
+
 [[package]]
 name = "jobserver"
 version = "0.1.32"
(END)
```
The updated SDK lockfile should now be in sync with runtime crates:
```
➜  smithy-rs git:(ysaito/enhance-gradle-tasks-for-lockfile) ✗ sdk-lockfiles audit
2024-09-12T15:41:28.004702Z  INFO sdk_lockfiles::audit: checking whether `rust-runtime/Cargo.lock` is covered by the SDK lockfile...
2024-09-12T15:41:28.034118Z  INFO sdk_lockfiles::audit: checking whether `aws/rust-runtime/Cargo.lock` is covered by the SDK lockfile...
2024-09-12T15:41:28.034555Z  INFO sdk_lockfiles::audit: checking whether `aws/rust-runtime/aws-config/Cargo.lock` is covered by the SDK lockfile...
SUCCESS
```
</details>

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-09-12 21:49:50 +00:00
Aaron Todd db1a9f19d3
deprecate http-02x presign APIs (#3823)
## Motivation and Context
* https://github.com/smithy-lang/smithy-rs/issues/1925
* https://github.com/awslabs/aws-sdk-rust/issues/977

## Description
Deprecate http-02x APIs from inlineable `PresignedRequest` API. These
should have been feature gated originally but they weren't. For now
we'll mark them deprecated and encourage people to move to the 1.x
equivalents.

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x ] For changes to the AWS SDK, generated SDK code, or SDK runtime
crates, I have created a changelog entry Markdown file in the
`.changelog` directory, specifying "aws-sdk-rust" in the `applies_to`
key.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-09-11 18:07:34 +00:00
AWS SDK Rust Bot 0f9b9aba38
Merge smithy-rs-release-1.x.y into main (#3824) 2024-09-09 11:54:23 -05:00
AWS SDK Rust Bot 336b563d3e Update changelog 2024-09-09 15:56:53 +00:00
Fahad Zubair 4e351cbd40
Merge branch 'main' into fahadzub/cbor-constraint 2024-09-09 10:18:50 -04:00
Fahad Zubair 050d9c5bb8 Add changelog and fix lint issues 2024-09-09 13:16:23 +01:00
Fahad Zubair d51cc7813b Add copyright 2024-09-09 10:05:30 +01:00
Fahad Zubair 91d80a4264 Implement `parseEventStreamErrorMetadata`, and change client test case for event stream 2024-09-08 20:24:48 +01:00
ysaito1001 064fbd79a0
Update lockfiles (#3821)
## Description
This PR updates lockfiles by running:
```
./gradlew aws:sdk:generateAllLockfiles -Paws-sdk-rust-path=/Users/awsaito/src/aws-sdk-rust
```
However, due to [the minicbor
issue](https://github.com/smithy-lang/smithy-rs/pull/3818), we still pin
it to 0.24.2 by running the following on `rust-runtime/Cargo.lock` and
`aws/sdk/Cargo.lock`:
```
RUSTFLAGS="--cfg aws_sdk_unstable" cargo update -p minicbor --precise 0.24.2
```

The rest of the changes handle miscellaneous scenarios:
- **Updated nightly version**: Upgraded to `nightly-2024-03-15` to
address a [compatibility
issue](https://github.com/serde-rs/serde/issues/2770) introduced by the
updated serde library.
- **Cleaned up use statements**: Removed redundant use statements, which
were flagged as warnings by the new nightly version.

## Testing
Tests in CI

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-09-06 17:57:59 +00:00
Zelda Hessler 4d889f7f1d
fix docgen link (#3815)
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-09-05 17:27:14 +00:00
Fahad Zubair b961f18ee3 Merge branch 'main' into fahadzub/cbor-constraint 2024-09-04 18:28:04 +01:00
ysaito1001 ed7f7e69bb
Restore `SmokeTestsDecoratorTest` (#3811)
## Motivation and Context
Restores `SmokeTestsDecoratorTest` that was temporarily removed in
https://github.com/smithy-lang/smithy-rs/pull/3808.

## Description
The said test was temporarily removed because `SmokeTestsDecorator` is
included in the [predefined
decorators](b38ccb969e/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/AwsCodegenDecorator.kt (L35))
and pulls-in the `aws-config` crate for code generation. The issue was
conflicts between the runtime crates used by `aws-config` (located in
the `aws/sdk/build` directory) and those brought-in by that predefined
decorators used by `awsSdkIntegrationTest` (located in the
`rust-runtime` and `aws/rust-runtime` directories). This PR addresses
these conflicts and restores the test functionality.

Given the challenges, the code changes are centered around the following
ideas:
- Focus solely on testing the core class, `SmokeTestsInstantiator`. By
doing this, we avoid running `SmokeTestsDecorator`, which would
otherwise pull in the `aws-config` crate.
- Initializing a config builder in smoke tests needs to be parameterized
depending on the environment; in production we use
`aws_config::load_defaults` and in testing we avoid including
`aws-config` by using a default-constructed config builder, which is
sufficient for compile-only tests.
- The generated smoke tests in `SmokeTestsDecoratorTest` require minimal
runtime crates for compilation. We need the `CodegenVisitor` but with a
different set of codegen decorators. Prior to this PR,
`awsSdkIntegrationTest` used
[RustClientCodegenPlugin](b38ccb969e/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/RustClientCodegenPlugin.kt (L46))
that in turn loaded [predefined
decorators](b38ccb969e/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/AwsCodegenDecorator.kt (L35))
on the classpath, which included `SmokeTestsDecorator`. In this PR, we
work around this by defining a minimal set of codegen decorators and
making them pluggable through `awsSdkIntegrationTest`.

## Testing
Tests in CI

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2024-09-04 16:16:32 +00:00
Fahad Zubair 2c3a4c1564
Operations with an event stream member shape must have `ValidationException` (#3814)
This PR addresses an issue where, if an operation's input includes an
event streaming member, the builder for the operation input or output
may raise a `ConstraintViolation` when `build_enforcing_all_constraints`
is called and the event streaming member field is not set. This occurs
because the member shape is required.

The standard error message that is shown when `ValidationException` is
not attached to an operation is also displayed in this case:

*Operation test#TestOperation takes in input that is constrained
(https://awslabs.github.io/smithy/2.0/spec/constraint-traits.html), and
as such can fail with a validation exception. You must model this
behavior in the operation shape in your model file.*

```smithy
use smithy.framework#ValidationException

operation TestOperation {
    ...
    errors: [..., ValidationException] // <-- Add this.
}
```
Closes: [3813](https://github.com/smithy-lang/smithy-rs/issues/3813)

---------

Co-authored-by: Fahad Zubair <fahadzub@amazon.com>
2024-09-04 15:05:23 +00:00
Fahad Zubair 763d598793 Fix formatting and comments 2024-09-04 12:13:45 +01:00
Fahad Zubair f2c11b870f Merge remote-tracking branch 'cbor-fixe/fahadzub/cbor-constraint' into fahadzub/cbor-constraint 2024-09-04 11:18:08 +01:00
Fahad Zubair 5bb92b1387 Use CBOR encoded string for marhsalling tests 2024-09-04 11:09:01 +01:00
Fahad Zubair 3fede97219 Use constraints.smithy with CBor 2024-09-04 11:08:58 +01:00
Fahad Zubair 6afc8bf266 Remove streaming trait from blob 2024-09-04 10:10:47 +01:00
AWS SDK Rust Bot ce468750db
Merge smithy-rs-release-1.x.y into main (#3819) 2024-09-03 18:07:28 -05:00