Commit Graph

1082 Commits

Author SHA1 Message Date
Zelda Hessler 699e289324
RFC: Callbacks for `ByteStream` and `SdkBody` (#1307)
* add: initial draft of bytestream callback RFC

* add: builder-style method

* update: remove callback insert method in favor of builder method
update: Arc callbacks instead of boxing them
remove: most bounds from ByteStreamReadCallback trait
add: PartialEq/Eq impl for Inner that disregards callback list

* update: RFC with SdkBody impl
update: RFC with checksum callback example

* update: respond to PR comments

* update: callback impls

* remove: Sync bounds from callback traits

* update: consolidate and simplify callback API

* fix: leftover terminology
2022-04-15 14:56:06 -05: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
John DiSanti 05ae26d7c0
Clean generated SDK before assembling a new one (#1322) 2022-04-15 09:46:46 -07: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
Zelda Hessler 7885dc7197
Release 2022 04 14 (#1323)
* undo: MSRV bump
* update: changelog
2022-04-14 18:10:15 +00:00
Russell Cohen fa69a0bf79
two small docs typos in bytestream (#1321) 2022-04-14 11:21:52 +00:00
John DiSanti e9b00adca3
Fix tools dockerignore file (#1319) 2022-04-13 16:46:46 -04:00
John DiSanti 3a8b9f054e
Split `ci.yml` to avoid max workflow depth error (#1316) 2022-04-13 10:50:18 -07:00
Zelda Hessler d16ee113ad
Prepare for 2022-04-13 release (#1317)
* update: models for release

* update: Changelogs for release
update: gradle properties for release
2022-04-13 11:00:30 -05:00
david-perez 251102a733
Rename `serverOperationHandler` to `OperationHandler` in `ServerRuntimeType.kt` (#1291)
All other members start with an uppercase letter, and the "server"
prefix is not necessary since they are namespaced under a
server-specific file.
2022-04-13 14:16:59 +02:00
John DiSanti 7245df1c1c
Generate a `versions.toml` with the SDK (#1311)
* Implement `crate-hasher` utility to hash crate source files
* Add `generate-version-manifest` subcommand to publisher tool
* Incorporate `generate-version-manifest` into the build system
* Start making the PR bot run through the Docker build image
* Use nightly clippy in tools CI when necessary
* Fix transient failure when acquiring the build image
* Include examples repo revision in `versions.toml`
* Fix nightly clippy lint in `cargo-api-linter`
* Track examples revision in sync tool
* Make it easier to run Docker CI locally
2022-04-12 16:55:32 -07:00
Nikhil Benesch b7a8eb5824
Add endpoint resolver to SdkConfig (#1300)
* Add endpoint resolver to SdkConfig

This commit adds an `endpoint_resolver` field to SdkConfig, which flows
through to the `endpoint_resolver` field on each individual service
configuration. To avoid a circular dependency between the aws-types
crate and the aws-endpoint crate, the `AwsEndpoint` type and its
dependencies are moved from the aws-endpoint crate to the aws-types
crate, then rexported in aws-endpoint.

Fix aws-labs/aws-sdk-rust#396.

* impl From<'static str> for signing service and signing region

* Code generate for the static string implementation

* Add EndpointResolver to aws_config

* Add docs and adapt test

* Fix test

* Fix endpoint config customizations test to remove dead code

* Re-add `.set_endpoint`

* Remove print and update changelog

Co-authored-by: Russell Cohen <rcoh@amazon.com>
2022-04-12 17:51:50 +00:00
david-perez 3c25664762
Migrate from `structopt` to `clap` v3 (#1293)
`clap` v3 added support for a `structopt`-like parser derive usage.
`structopt` is now in maintenance mode
(https://docs.rs/structopt/latest/structopt/#maintenance); it is
recommended to migrate to `clap`.

Structs to parse CLI arguments have been renamed to `Args` for
consistency.
2022-04-11 12:34:32 -07:00
david-perez aaed5058bd
Make `builderSymbol` return a `Symbol` (#1312)
It currently returns a `RuntimeType`. It makes no actual difference
whatsoever, but `RuntimeType` is kept for types we don't code-generate,
but that we use from other crates.
2022-04-11 12:33:04 -04:00
david-perez 71e2a6d9e1
Remove `impl_extension_new_and_deref` macro from `aws-smithy-http-server` (#1290)
This macro is used only once in the codebase.
2022-04-08 12:30:45 +02:00
John DiSanti fc6af2071f
Combine PR bot messages into one (#1299) 2022-04-07 09:53:18 -07:00
John DiSanti 064467c99d
Enable deploying a minimal set of resources for running the canary (#1306) 2022-04-06 13:07:45 -07:00
John DiSanti 102f30421e
Add more debug info to `acquire-build-image` (#1305) 2022-04-06 09:21:02 -07:00
John DiSanti 6e63635e97
Enable running the canary with a path to a generated SDK (#1303) 2022-04-05 16:29:32 -07:00
Russell Cohen 6bbc776d67
Smithy async docs (#1278)
* Add lints to aws-smithy-async

* Write some event stream docs, and enable lints

* Codegen docs

* Fix one missing doc

* Compile fixes

* remove accidentally added code

* Update codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/SymbolVisitor.kt

* Update response headers docs
2022-04-05 16:17:00 +00:00
John DiSanti e78d40f0d5
Add throttling retry to Docker build image pull (#1297) 2022-04-04 17:13:23 -07:00
Nikhil Benesch 3aa1e36b6f
aws-smithy-query: bump to urlencoding v2.1 (#1301)
* aws-smithy-query: bump to urlencoding v2.1

* Add changelog entry for urlencoding update

Co-authored-by: Russell Cohen <rcoh@amazon.com>
2022-04-04 15:05:18 -07:00
david-perez 70de093507
Enable "TODOs" lint for server code (#1292)
Stale TODOs have been removed and new tracking issues have been cut to
provide context to the others.
2022-04-04 20:21:54 +02:00
John DiSanti c912b69f71
Split codegen tests out into their own job (#1298) 2022-04-01 16:02:14 -07:00
Russell Cohen 6e8c1d873e
Improve AssumeRoleProvider (#1296)
This adds to improvements to `AssumeRoleProvider`:
1. This adds a cache aroudn this provider. Since this provider is intended to be used directly by customers,
it should be cached to improve performance and predictability.

2. Add support for configuring the role session length.
2022-04-01 12:30:53 -07:00
John DiSanti 775d227c5f
Fix GitHub Actions workflow reference in `ci-main` (#1286) 2022-04-01 09:23:50 -07:00
John DiSanti 3e46543139
Simplify CI with composite actions and new image tagging approach (#1283)
- Refactors CI to use composite actions so that there's less duplication in the workflow yaml files.
- Switches to a different image tagging approach for the Docker build image: now the git hash of the `tools/` directory is the image tag rather than the commit hash of `HEAD`. This will result in more image reuse if the tools haven't changed, and makes the logic for deciding whether a new image must be built much simpler.
- When running CI on main, ensures the Docker build image is built and uploaded to ECR before running the CI tests.
2022-03-31 17:40:35 -07:00
John DiSanti 6fb5acc9bb
Update node dependencies (#1282) 2022-03-31 17:24:35 +00:00
John DiSanti 63b1de1a93
Update pinned nightly to fix `cargo udeps` checks (#1285)
* Update pinned nightly to fix `cargo udeps` checks

* Update `api-linter` to work on `nightly-2022-03-29`

* Make it possible to test tool modifications in a pull request
2022-03-31 09:30:04 -07:00
Rob Speller bd38d0dd1e
fix: treat blank env credentials as missing (#1272) 2022-03-29 16:53:13 -07:00
John DiSanti 7a5d179220
Fix path on git command (#1281) 2022-03-28 13:48:29 -07:00
John DiSanti 58fd455af3
Fix image acquisition when CI is run outside of a pull request (#1280) 2022-03-28 12:36:06 -07:00
John DiSanti 6fa7b36812
Use Docker build image in CI (#1255)
Establishes a Docker build image with build tools precompiled into it to improve CI time and reduce GitHub Actions workflow configuration. Also makes it possible to run the exact CI workflows in local development.
2022-03-28 11:05:08 -07:00
david-perez 2c1847f206
Rename `ServerHttpProtocolGenerator` to `ServerHttpBoundProtocolGenerator` (#1251)
And `ServerHttpProtocolImplGenerator` to
`ServerHttpBoundProtocolTraitImplGenerator`.

The client-side classes are named `HttpBoundProtocolGenerator` and
`HttpBoundProtocolTraitImplGenerator`, so the server-side clases should
just add the "Server" prefix and not deviate from the naming convention.
2022-03-28 13:54:47 +02:00
david-perez 86680c2624
Move `SmithyHttpServer` to `ServerCargoDependency.kt` (#1248)
* Move `SmithyHttpServer` to `ServerCargoDependency.kt`

* fix

Co-authored-by: Russell Cohen <rcoh@amazon.com>
2022-03-25 07:56:28 -07:00
david-perez 2f2e1438f5
Fix serialization of required shapes (timestamps and nested shapes) (#1275)
In #1148, `@required` started being strictly interpreted by server SDKs.

That meant that when serializing values from structures, we no longer
borrow for every shape when looking into `Option`s as in:

```
if let Some(var_37) = &input.value
```

(See for example `RustWriter.serializeStructure` from
`JsonSerializerGenerator.kt` for the relevant serialization
code-generation routine)

Instead, we attempt to serialize the unborrowed required shape value.
This works well for booleans, numeric types (since they are `Copy`),
collections (since we borrow their items while iterating), and strings
(since we call `as_str()`). It also worked for unions and documents,
since we already borrowed (note that `ValueExpression.kt` makes sure to
not borrow twice if the value is already a reference, like when clients
look into `Option`s).

We fixed borrowing of blobs in #1269.

However, we currently don't borrow for timestamps and nested shapes.
This commit fixes that, and adds a comprehensive protocol test to ensure
we exercise all the lines relevant to serialization of required shapes.
2022-03-24 11:19:18 +00:00
david-perez 565d838375
Add miscellaneous protocol test with nested required shape (#1267)
This commit adds another suite of protocol tests to test miscellaneous
aspects of code generation where protocol selection should not be
relevant.

The first test is code-generating an operation with a nested required
shape, minimally reproducing the bug that was fixed in 75056c, so that
we don't regress on it. I've added it to both the `codegen-test` and
`codegen-server-test` subprojects, even though the bug only affected the
server, in part to also incentivize us into adding more tests to this
Smithy model for both clients and servers.
2022-03-23 12:48:50 +01:00
Matteo Bigoi 09955d5831
Bugfix: prevent errors like "move occurs because `input.element` has type `Blob`, which does not implement the `Copy` trait" (#1269)
Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com>

Co-authored-by: Russell Cohen <rcoh@amazon.com>
2022-03-23 09:35:32 +00:00
Zelda Hessler da8d59e0a1
fix: incorrect issue reference (#1270) 2022-03-22 22:23:35 +00:00
Zelda Hessler b2c989630f
Update to Rust Edition 2021 (#1268)
* update: set rust edition to 2021
update: strict param of intoCrate to set clippy to set #![deny(clippy::all)]

* add: changelog entry
2022-03-22 21:29:04 +00:00
david-perez 85cf8d36aa
Remove unused `async-stream` dependency from `CargoDependency.kt` (#1249) 2022-03-22 17:12:28 +01:00
david-perez c34c544009
Make two functions private in `HttpBoundProtocolGenerator.kt` (#1254) 2022-03-21 19:00:07 +01:00
Bin Liu 622712058f
Fix developer guide URL (#1262)
* Update README.md to fix invalid Developer Guide URL

The old guide:
https://github.com/awslabs/aws-sdk-rust/blob/main/Guide.md

has been deleted and changed to:
https://docs.aws.amazon.com/sdk-for-rust/latest/dg/welcome.html

See: https://github.com/awslabs/aws-sdk-rust/pull/325

Signed-off-by: bin liu <liubin0329@gmail.com>

* Update invalid Developer Guide URL in AwsReadmeDecorator.kt

The old guide:
https://github.com/awslabs/aws-sdk-rust/blob/main/Guide.md

has been deleted and changed to:
https://docs.aws.amazon.com/sdk-for-rust/latest/dg/welcome.html

See: https://github.com/awslabs/aws-sdk-rust/pull/325

Signed-off-by: bin liu <liubin0329@gmail.com>

* Add fixing Developer Guide link to  CHANGELOG.next.toml

Signed-off-by: bin liu <liubin0329@gmail.com>

Co-authored-by: Russell Cohen <rcoh@amazon.com>
2022-03-21 15:20:25 +00:00
Matteo Bigoi 75056c6a78
Fix bug where where format argument is not a literal string (#1266) 2022-03-18 22:23:05 +00:00
david-perez f627311b48
Improve Pokémon Service `Makefile` (#1264)
* Improve Pokémon Service `Makefile`

* Code-generate only the Pokémon Service SDK (as opposed to all targets
  in the `codegen-server-test` subproject like we do currently).
* Add `run` target to run the service.
* Add `doc-open` target to generate and open Rustdoc documentation.
* Bring back client generation

Co-authored-by: Matteo Bigoi <1781140+crisidev@users.noreply.github.com>
2022-03-18 16:28:38 +00:00
John DiSanti 61b0a8a8e5
Prepare for release (#1261)
* Update AWS models

* Version bump

* Revert S3 model update

* Update changelogs

* Update endpoints config
2022-03-17 14:18:46 -07:00
david-perez adc2ac08e6
Make server operation input and output wrappers `pub(crate)` (#1253)
These types are internal details users should not have access to.
2022-03-17 20:19:36 +01:00
Zelda Hessler 3eaddcf738
Add default list of http versions to request property bag (#1258)
* add: default list of http versions
add: type alias for list of http versions
add: decorator to add desired http versions to property bag
fix: gradle warning for argument "model"
update: CHANGELOG

* fix: clippy lint

* update: use more accurate name for test RustCodegenDecorators
rename: HttpVersionListGenerator.kt to HttpVersionListCustomization.kt
update: HttpVersionListCustomization to grab versions from models when possible
fix: various docs issues reported by IDE
add: new "Extras" section to ServiceConfig
update: code broke by "Extras" change
add: tests for http version sniffing
2022-03-17 08:09:01 -05:00
david-perez beeca577cb
Make `generateDeserializePayloadFn` not take in an operation shape (#1250)
The binding generator class is already scoped to a single operation
shape stored as a property.
2022-03-15 21:36:18 +01:00
david-perez c059491a32
Fix docs for `aws_smithy_types::Number` converters (#1252)
Current docs: https://docs.rs/aws-smithy-types/0.38.0/aws_smithy_types/enum.Number.html

I learnt this trick from https://stackoverflow.com/a/43353854.
2022-03-14 22:40:44 +01:00