Commit Graph

87 Commits

Author SHA1 Message Date
AWS SDK Rust Bot 6eaacaa966 Upgrade the smithy-rs runtime crates version to 0.56.0 2023-08-01 22:08:16 +00:00
Zelda Hessler d4a2308e94
update MSRV to 1.69.0 (#2893)
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-08-01 19:37:59 +00:00
John DiSanti 682dc7fb40
Upgrade Smithy to 1.35 (#2892)
_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: david-perez <d@vidp.dev>
2023-08-01 17:06:29 +00:00
John DiSanti cfff41a883
Upgrade MSRV to 1.68.2 (#2745)
## Motivation and Context
This PR upgrades the MSRV to 1.68.2.

## Checklist
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_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: Zelda Hessler <zhessler@amazon.com>
Co-authored-by: 82marbag <69267416+82marbag@users.noreply.github.com>
2023-06-13 15:23:04 +00:00
John DiSanti 1a65a44e53
Upgrade MSRV to Rust 1.67.1 (#2611)
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
2023-04-21 17:26:27 +00:00
ysaito1001 92b0704d20
Allow SDK to be built with unknown traits in models (upgrading Smithy to 1.29.0 as part of it) (#2547)
## Motivation and Context
Addresses https://github.com/awslabs/smithy-rs/issues/2104

## Description
This PR allows us to build `aws-sdk-rust` even with unknown traits
present in the AWS models. This requires `Smithy` 1.29.0 that includes
[support](https://github.com/awslabs/smithy/pull/1685) for an extension
property,
[allowUnknownTraits](https://smithy.io/2.0/guides/building-models/gradle-plugin.html?highlight=allowunknowntraits#smithy-extension-properties).

## Testing
Manually added a unknown trait into an AWS model like so:
```
diff --git a/aws/sdk/aws-models/sts.json b/aws/sdk/aws-models/sts.json
--- a/aws/sdk/aws-models/sts.json
+++ b/aws/sdk/aws-models/sts.json
@@ -69,6 +69,7 @@
                 "aws.auth#sigv4": {
                     "name": "sts"
                 },
+                "aws.protocols#awsQuery2": {},
                 "aws.protocols#awsQuery": {},
```
and confirmed `/gradlew :aws:sdk:assemble` built SDK successfully. Also
verified that without `allowUnknownTraits = true` in
`aws/sdk/build.gradle.kts`, `/gradlew :aws:sdk:assemble` failed with the
above unknown trait.

----

_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: Yuki Saito <awsaito@amazon.com>
2023-04-20 19:45:09 +00:00
Russell Cohen 7c42e6bed8
Upgrade to Smithy 1.28.1 (#2463)
* Upgrade to Smithy 1.28.1

* fix a couple of failing protocol tests

* Adhere to new ValidationException message format

* Add RestJsonMalformed to FailingTest

* Add various fixes

---------

Co-authored-by: Harry Barber <hlbarber@amazon.co.uk>
Co-authored-by: Harry Barber <106155934+hlbarber@users.noreply.github.com>
2023-03-17 18:18:07 +00:00
Zelda Hessler 92952cbe51
Update MSRV to 1.66.1 (#2468)
* update: MSRV to 1.66.1

* add: CHANGELOG.next.toml entry

* update: Dockerfile too

* fix: clippy lints

* fix: sigv4 event_stream.rs clippy lint
update: codegen clippy lint allowlist

* fix: doc lint that's nightly only
add: docs for aws-smithy-http
add: docs for aws-smithy-client
add: docs for aws-smithy-async

* add: more missing docs.

* fix: add more missing docs

* remove: unnecessary & in HttpBindingGenerator
fix: lint name

* fix: another doc import

* fix: test broken by changing compiler error

* fix: even more lints\nadd: lint warns to all smithy runtime crates

* fix: broken doc links

* fix: clippy bug

* fix: don't use modules named lib in codegen tests

* fix: the paginator_canary.rs unnecessary cast
2023-03-16 21:58:14 +00:00
Russell Cohen c3c747a1ed
Upgrade to Smithy 1.27.2 (#2226)
* Upgrade to Smithy 1.27.1

* Fix bugs exposed by 1.27.1

* Fix rules engine customization

* update rfc3339 parsing test

* refactor timestamp format & remove upstreamed test

* Update changelog

* rename test

* fix datetime parsing on server and clients

* fix up a few more failing tests

* precommit lints

* Fix bad merge
2023-03-14 21:14:27 +00:00
John DiSanti 85d2ace0d6
Upgrade Kotlin and Ktlint (#2392)
* Upgrade Kotlin to 1.7.21

* Upgrade Ktlint to 0.48.2

* Run `pre-commit run --all-files` to fix broken Ktlints

* Fix string comparison broken by code formatting
2023-02-22 18:21:06 +00:00
John DiSanti d48878ee01
Implement request ID access for SDK clients RFC (#2129)
* Add `RequestId` trait
* Implement `RequestId` for generated AWS client errors
* Move `RustWriter.implBlock` out of `StructureGenerator`
* Create structure/builder customization hooks
* Customize `_request_id` into AWS outputs
* Set request ID on outputs
* Refactor SDK service decorators
* Refactor S3's extended request ID implementation
* Combine `Error` and `ErrorKind`
* Add test for service error conversion
* Move error generators into `codegen-client` and fix tests
* Re-export `ErrorMetadata`
* Add request IDs to trace logs
* Simplify some error trait handling
* Rename `ClientContextParamDecorator` to `ClientContextConfigCustomization`
* Add deprecated alias to guide customers through upgrading
* Rename the `ErrorMetadata` trait to `ProvideErrorMetadata`
* Rename `aws_smithy_types::Error` to `ErrorMetadata`
2023-02-10 17:36:48 -08:00
Nugine de186678ee
Bump Rust MSRV to 1.63.0 (#2222)
Co-authored-by: Zelda Hessler <zhessler@amazon.com>
Co-authored-by: John DiSanti <jdisanti@amazon.com>
2023-02-10 12:59:31 -08:00
Luca Palmieri d9c0b2e636
Change the release flow to use release branches (#2253)
* What happens if we comment out the runtime crate version from gradle.properties?

* Allow running the release and the CI workflows from an arbitrary commit.

* Does a fake version work?

* Pass `git_ref` from the release workflow.

* It needs to be a valid semver version.

* Sketch new command to upgrade version in gradle.properties

* Command implementation

* Plug the new publisher command into the `release` action.

* Plumb end-to-end

* Fix copyright header.

* Fix lint.

* Temporarily comment out the sanity check.

* Ignore sanity check

* Add a command that prints out the template for CHANGELOG.next.toml

* Add branch check + empty TOML generation.

* Add copyright headers.

* Fix imports.

* Remove sanity check.

* Move script to a file.

* Add a check to validate the tag.

* Remove second build step.

* Move to .github/scripts folder.

* Make the script easier to run locally

* Fail if anything fails.

* Add comment.

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

Co-authored-by: david-perez <d@vidp.dev>

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

Co-authored-by: david-perez <d@vidp.dev>

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

Co-authored-by: david-perez <d@vidp.dev>

* Update .github/workflows/ci.yml

Co-authored-by: david-perez <d@vidp.dev>

* Remove touch.

* Fix indentation and branch name.

* Update .github/workflows/ci.yml

Co-authored-by: david-perez <d@vidp.dev>

* Update .github/workflows/release.yml

Co-authored-by: david-perez <d@vidp.dev>

* Update .github/workflows/release.yml

Co-authored-by: david-perez <d@vidp.dev>

* Explicit flags.

* Use the path that was provided.

* Format

---------

Co-authored-by: david-perez <d@vidp.dev>
2023-02-01 17:10:18 +00:00
Julian Antonielli 31ea931eba
Bump version to 0.54.1 in `gradle.properties` (#2249)
Co-authored-by: Julian Antonielli <jjantdev@amazon.co.uk>
Co-authored-by: AWS SDK Rust Bot <97246200+aws-sdk-rust-ci@users.noreply.github.com>
2023-01-25 14:54:16 +00:00
Zelda Hessler b08c0613cd
update: smithy.rs.runtime.crate.version for release (#2220) 2023-01-17 21:06:21 +00:00
david-perez 7503dabff4
Bump `gradle.properties` runtime crates version to 0.53.1 (#2203) 2023-01-12 13:11:53 +01:00
82marbag 40da9a32b3
Update gradle.properties (#2199) 2023-01-11 13:19:01 +00:00
Luca Palmieri 3a3d1210c5
Refactor build scripts (#2116)
* Introduce a flag in gradle.properties to enable/disable testing (and the compilation of the associated dependencies).

* Feature flag testing in all non-test-only build.gradle.kts files.

* Remove dokka
2022-12-20 17:13:31 +00:00
AWS SDK Rust Bot adf98a3893
Cut 0.52.0 release 2022-12-12 11:22:27 +00:00
AWS SDK Rust Bot de979d87e2
Update gradle.properties
A critical bug was identified during the release process, reverting to 0.51.0 and re-enabling merges to `main`.
2022-12-09 14:11:30 +00:00
Luca Palmieri c29e3ad709
Prepare 0.52.0 release of smithy-rs (#2084)
* Prepare 0.52.0 release of smithy-rs

* Add PR number
2022-12-09 12:27:15 +00:00
Russell Cohen 16d212e2b7
Smithy 1.26.2 upgrade / ensure that even empty lists are serialized (#1972)
* Ensure that even empty lists are serialized

* Add must_use annotation & unit test

* Add changelog entry

* Remove test from list of failing tests
2022-11-10 17:09:43 +00:00
Julian Antonielli 1844660c61
Remove our `base64` implementation in favour of `base64-simd` (#1938)
* Replace our base64 implementation with one based on `base64-simd`

* Bump Rust MSRV to 1.62.1

* Unmark base64-related tests as failing

* Use `usize` for `base64::encoded_length`

* Run Rust 1.62.1 on CI

* Don't use external `base64_simd::Error` type in public interface

* Add initial criterion bench setup for base64

* Compare `base64_simd::encode` vs Smithy's `encode`

* Use string length for `BenchmarkId`

* Compare `base64_simd::decode` vs Smithy's `decode`

* Compare `base64_simd::encoded_length` vs Smithy's `encoded_length`
2022-11-09 12:08:17 +00:00
Zelda Hessler 2aafd044e2
update: to smithy v1.26 (#1929)
* update: to smithy v1.26

* add: entry to CHANGELOG.next.toml
2022-10-31 13:39:19 -05:00
david-perez 79b7274d18
Version bump smithy-rs (#1894) 2022-10-24 18:10:17 +02:00
Luca Palmieri 18d969e160
Upgrade to Rust 1.62.0 (#1825)
* Run clippy --fix for Rust 1.62.0 and format the resulting code

* Run clippy --fix on all targets

* Run clippy --fix with all features enabled

* Avoid extra allocation

* Use more idiomatic assert

* Ignore noisy lint

* Update pyo3 and pyo3-asyncio to 0.17.0

* Implement Eq on aws-smithy-checksums::Error

* Implement Eq on Protocol

* Replace conditionals with range-containment

* Implement Eq on types in aws-smithy-types

* Implement Eq on types in aws-smithy-http-server-python

* Implement Eq on types in aws-smithy-eventstream

* Implement Eq on types in aws-smithy-xml

* Implement Eq on aws-sigv4

* Update CI to use Rust 1.62.0

* Add Eq for generated types that implement PartialEq

* Allow clippy::needless_return in generated code

* Remove unnecessary reborrow in http_serde

* Remove unnecessary borrow in operation_deser

* Add CHANGELOG entries

* Revert "Add Eq for generated types that implement PartialEq"

This reverts commit 5169bd95aa.

* Update pyo3 and pyo3-asyncio in generated code for python server

* Allow clippy::derive_partial_eq_without_eq on structs and builders

* Run clippy on tools

* Fix accidental move in generated code

* Revert "Allow clippy::derive_partial_eq_without_eq on structs and builders"

This reverts commit 068c63ca20.

* Fix another accidental move in generated code

* Undo unwanted change to model

* Re-add reborrow in HttpBindingGenerator

* Fix clippy::format-push-string in changelogger

* Fix more uses of str.push_str(&format!(...))

* Remove unnecessary parenthesis

* Run ktlint

* Update aws/rust-runtime/aws-http/src/content_encoding.rs

Co-authored-by: John DiSanti <jdisanti@amazon.com>

* Update aws/rust-runtime/aws-http/src/content_encoding.rs

Co-authored-by: John DiSanti <jdisanti@amazon.com>

* Ignore doctest for non-exported macro

Rust 1.62 introduced a breaking change where doctests for non-exported
macros are now run by default. These don't compile because the macro
can't be imported in it.
See https://github.com/rust-lang/rust/issues/97030 for more info.

* Run cargo fmt

* Use $crate instead of crate in macro

* Revert "Implement Eq on types in aws-smithy-types"

This reverts commit c45a6b5a56.

* Revert "Implement Eq on types in aws-smithy-eventstream"

This reverts commit 78f4b07344.

* Revert "Implement Eq on types in aws-smithy-xml"

This reverts commit 590f01af73.

* Revert "Implement Eq on aws-sigv4"

This reverts commit d78bb62124.

* Revert "Implement Eq on types in aws-smithy-http-server-python"

This reverts commit f2cd901884.

* Revert "Implement Eq on aws-smithy-checksums::Error"

This reverts commit 5da170405e.

Co-authored-by: Julian Antonielli <julianantonielli@gmail.com>
Co-authored-by: John DiSanti <jdisanti@amazon.com>
2022-10-17 09:32:12 +01:00
Luca Palmieri 9db14463c1
Update version to 0.50.0. (#1834) 2022-10-10 15:10:16 +00:00
david-perez 3952a10c44
Version bump smithy-rs (#1749) 2022-09-20 13:11:04 +02:00
Manuel Sugawara ffafbec885
Correctly determine nullability of members in IDLv2 models (#1725) 2022-09-16 17:11:09 -07:00
John DiSanti 30d985ad9d
Version bump smithy-rs (#1673) 2022-08-26 00:58:24 +00:00
Zelda Hessler a65b1aaa8d
Update MSRV to 1.61.0 (#1672) 2022-08-25 15:43:35 -07:00
David Oguns 7f4dad62a4
Update Smithy to 1.23.1 to support IDL 2 (#1623) 2022-08-19 13:29:05 -07:00
John DiSanti 6e1d1f6c18
Fix adhoc SDK codegen and refactor SDK CI (#1624)
* Fix `aws:sdk-codegen-test` build
* Add config for SDK endpoint/readme generation
* Rename `sdk-codegen-test` to `sdk-adhoc-test` and update README
* Add `sdk-adhoc-tests` to CI
* Refactor CI scripts

The `check-rust-runtime-and-tools` script was getting beyond 20
minutes to run, so this commit splits it into `check-aws-config`,
`check-rust-runtimes`, and `check-tools`.

This also enables most of the checks to run before the smoke test SDK is
generated, which should deliver more immediate feedback on PRs.

* Give the canary its own CI step
2022-08-10 09:08:08 -07:00
John DiSanti 65e53ab87a
Version bump smithy-rs (#1617)
Co-authored-by: david-perez <d@vidp.dev>
2022-08-04 01:25:54 +02:00
John DiSanti 852c2ec260
Upgrade Ktlint and fix lint configuration (#1572)
* Exclude sigv4 test suite from pre-commit file endings hook
* Upgrade Ktlint
* Make Gradle ktlint target consistent with pre-commit

They were previously running two separate rulesets since pre-commit
pulls in the standard ruleset, and that wasn't pulled into the Gradle
dependencies.

* Fix Gradle Ktlint paths
* Establish editorconfig for Ktlint
* Fix Ktlint lints
* Enable `trailing-commas` rule
* Fix block quote indentation
2022-07-27 18:04:07 +00:00
John DiSanti ba9756478b
Version bump runtime crates (#1555) 2022-07-19 21:19:25 +00:00
John DiSanti 6143d90197
Enable independent crate versioning for SDK crates (#1540)
* Update `hydrate-readmes` to take versions from `versions.toml`
* Add cleanup TODO comments to `changelogger`
* Update SDK readme template
* Split up `generate-version-manifest` subcommand
* Eliminate the `aws.sdk.version` property
* Fallback to model hash comparison if model metadata claims no changes
* Add `acquire-base-image` to `release.yml`
* Use empty model metadata for SDK generation in CI
* Fix the `aws-config` version number in SDK crate readmes
2022-07-19 12:27:45 -07:00
John DiSanti 23ca395698
Version bump (#1509) 2022-06-28 16:36:30 +00:00
Russell Cohen edb1394561
Upgrade to Gradle 7 (#1411)
* Upgrade to Gradle 7

* Document the upgrade and update changelogs
2022-06-23 12:27:43 -04:00
Russell Cohen bf25694ccd
Release 6/22 (#1486)
* Update models

* Update versions
2022-06-22 20:15:35 +00:00
david-perez 40f22207ad
Avoid unnecessary Cargo crate rebuilds (#1422)
Avoid unnecessary Cargo crate rebuilds

This commit modifies the Gradle buildscripts to avoid unnecessary Cargo
rebuilds of the generated crates, decreasing development iteration
cycles.

Prior to this commit, if you ran a crate-generating command _twice_ on
any of the `codegen-test`, `codegen-server-test`, `sdk-codegen-test`,
and `codegen-server-test:python` subprojects (without making any changes
to the codegen code), both invocations would take the same time: Cargo
would recompile the crate and its dependencies, even when the generated
crate is identical. This is because Gradle deletes everything under
`buildDir` when running the `generateSmithyBuild` task:

```
> Task :codegen-server-test:smithyBuildJar
Deleting stale output file: /local/home/davidpz/workplace/smithy-ws/src/SmithyRsSource/codegen-server-test/build/smithyprojections/codegen-server-test
```

So the files get recreated each time.

While developing, it is likely that only a small number of the generated
crate files are modified across rebuilds. [Cargo uses
`mtime`](https://github.com/rust-lang/cargo/issues/6529) (among other
factors) to determine whether it needs to recompile a unit. Indeed,
running with `CARGO_LOG=cargo::core::compiler::fingerprint=trace` yields
`err: current filesystem status shows we're outdated`. This commit adds
a Gradle task that compares the hashes of the newly generated files with
the (previously cached) old ones, and restores their `mtime`s if the
hashes coincide.

Another issue was causing unnecessary crate rebuilds. Prior to this
commit, we were sending `RUSTFLAGS=-D warnings` when invoking Cargo.
However, a common thing to do after generating a crate is to open its
contents in an editor. The editor's `rust-analyzer` would compile the
crate and its dependencies without the `RUSTFLAGS` we had used earlier.
The next time you rebuilt the crate, Cargo would claim `err: RUSTFLAGS
has changed: previously [], now ["-D", "warnings"]` and recompile
everything again. This commit refactors the Gradle tasks so as to not
send these flags when invoking Cargo, instead generating a
`.cargo/config.toml` containing these flags. This way, `rust-analyzer`
also picks them up and does not need to recompile the crates.

With both patches, Cargo avoids unnecessary crate rebuilds. All in all,
the second invocation of a `./gradlew --info -P modules='simple' -P
cargoCommands='test' codegen-server-test:build` command now takes 15
seconds less than the first invocation on my `c5.4xlarge` machine; Cargo
does not need to do _any_ work on the second invocation.

This commit also refactors the `build.gradle.kts` files of the `sdk`,
`sdk-codegen-test`, `codegen-test`, `codegen-server-test`, and
`codegen-server-test:python` subprojects to make them DRYer and more
consistent. The last 4 subprojects' buildscripts are now much shorter,
with all the common logic having been moved to `CodegenTestCommon.kt`.
Note that we have made the last 4 subprojects' `cargo check` and `cargo
doc` invocations use the same set of flags than in the `sdk` subproject
for consistency.

Closes #1378.
Closes #1412.
2022-06-15 22:06:25 +00:00
John DiSanti d99d3e0c17
Prepare for release (#1426)
* Version bump
* Update SDK models
* Revert S3 model
2022-05-31 13:00:16 -07:00
david-perez fe92efbfd6
Increase max JVM heap size in `gradle.properties` (#1373)
It's currently defaulting to 512 MiB. I often see this message in my
build logs:

> Daemon will be stopped at the end of the build after running out of JVM memory

I've done some (unscientific) profiling with this setting enabled, and
max heap size can peak at ~600 MiB, so I see no reason to increase it
more than 1024 MiB.
2022-05-27 15:18:17 +00:00
John DiSanti 895b8c0020
Prep for release (#1386)
* Version bump

* Update SDK models

* Revert the S3 model since checksum support hasn't landed yet
2022-05-12 10:17:39 -07:00
John DiSanti a0539e20b0
Fix `SPDX-License-Identifier` in header comments (#1377)
* Fix misc whitespace with pre-commit

* Revise copyright check in `sdk-lints`

* Fix `SPDX-License-Identifier` in header comments
2022-05-09 09:50:46 -05:00
Russell Cohen 9b6210c105
Release (#1351)
* Bump version numbers in gradle.properties

* Add auto-changelog script

* Update models, holding back S3

* Update CI to 1.58.1
2022-04-28 22:24:21 +00:00
david-perez c9e6ab9a5f
Upgrade Kotlin, Kotest, `ktlint` and Jacoco (#1331)
This commit upgrades:

* Kotlin to 1.6.20,
* Kotest to 5.2.3,
* Ktlint to 0.45.2; and
* Jacoco to 0.8.8.

Perhaps the only noteworthy change is that Ktlint now has a lint to
detect that the name of a class/object defined solely in a file has to
coincide with the filename.
2022-04-22 21:00:00 +00:00
John DiSanti 27acbc6d30
Upgrade Smithy (#1330)
* Upgrade to Smithy 1.16.2

* Remove extra test fixed in Smithy 1.16.2

* Upgrade to Smithy 1.16.3

* Remove extra test fixed in Smithy 1.16.3

* Remove failing expectation from server tests

* Upgrade to Smithy 1.17.0

* Upgrade to Smithy 1.18.1

* Upgrade to Smithy 1.19.0

* Upgrade to Smithy 1.21.0

* Update changelog

* Fix Gradle repositories
2022-04-21 09:22:35 -04:00
Zelda Hessler 52b808ec13
update: MSRV from 1.56.1 to 1.58.1 (#1325)
* update: MSRV from 1.56.1 to 1.58.1

* update: CHANGELOG.next.toml
fix: cdk rust issues

* Update CHANGELOG.next.toml

* Update CHANGELOG.next.toml
2022-04-15 14:01:18 -05:00
Zelda Hessler c5e2ce5083
update: gradle.properties for release (#1324)
* update: gradle.properties for release

* update: aws.sdk.version to 0.10.1
fix: changelog
2022-04-14 16:08:11 -05:00