Go to file
Zelda Hessler 95714395f1
feature: make retry behavior user-configurable (#741)
* feature: add retry_config to aws_config::ConfigLoader and aws_config::default_provider
feature: add retry_config to aws_types::Config and aws_types::Builder
feature: add RetryConfig and RetryMode to smithy_types
feature: create EnvironmentVariableRetryConfigProvider
feature: create RetryConfigProviderChain
feature: create ProfileFileRetryConfigProvider
update: make smithy-types dep non-optional for aws-config
add: smithy-types dep to aws-types

* Update aws/rust-runtime/aws-config/src/lib.rs

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

* refactor: simplify configuration logic of retry_configs
update: use non-allocating string comparison for RetryMode::from_str
update: panic on setting invalid values for RetryConfig
remove: provider chain for retry_config
remove: ProvideRetryConfig trait and related functionality

* update: AwsFluentClientDecorator to work with retry_config
refactor: rename smithy_client::retry::Config.max_retries to max_attempts and fix code broken by this change
add: RetryConfigDecorator to smithy codegen with example and test
add: RetryConfigDecorator to decorators list
add: update SharedConfigDecorator to work with retry_config
add: prop getters to RetryConfig
add: From<RetryConfig> for smithy_client::retry::Config
update: RegionDecorator example of generated code
sort: decorators list alphabetically

* fix: clone moved valued in AwsFluentClientDecorator
update: imds client to refer to max attempts instead of max retries
fix: clippy lint about FromStr
add: RetryModeErr error struct for when FromStr fails
fix: code affected by added FromStr<RetryMode> trait usage

* formatting: run rustfmt

* format: use 1.53 version of fustfmt

* fix: smithy_client tests broken by max_attempts change

* fix: clarify some confusing counter logic around request attempts

* update: set_retry_config example code to be more helpful
fix: broken docs link

* add: missing PartialEq impl for RetryConfig
update: EnvironmentVariableRetryConfigProvider tests
remove: unused import

* update: CHANGELOGs

* update: Config builder decorators to match Config builder methods

* fix: old references to ProtocolConfig

* refactor: surface all retry_config errors in the default_provider
add: RetryConfigErr

* update: Changelog to not new semantics of max_attempts
update: Config::retry_config() example
fix: copy paste error
rename: RetryModeErr to RetryModeParseErr
update: note valid retry modes in error message
add: helper for creating RetryConfig that disables retries
update: use Cow<&str> for RetryConfigErr to save on allocations
add: FailedToParseMaxAttempts error when creating RetryConfig from invalid max_attempts
update: don't ignore invalid/unparseable max_attempts
update: note panic that can occur in retry_config::default_provider
remove: invalid/useless code from RetryConfigDecorator.kt
remove: inside baseball comments previously added to CHANGELOG

* disable: adaptive RetryMode tests

* fix: don't listen to the IDE, err is being used

* fix: don't listen to the IDE, err is being used

* fix: really struggling with this underscore

* fix: typo in doc comment example

* fix: typo in doc comment example
fix: outdated tests

* Update rust-runtime/smithy-client/src/retry.rs

Co-authored-by: Russell Cohen <russell.r.cohen@gmail.com>

* update: retry_config::default_provider to consider precedence per-field instead of per struct
add: RetryConfigBuilder to make the above possible
update: Env and Profile provider for RetryConfig to return RetryConfigBuilder
add: docs to generated retry_config builders
add: from_slice method to os_shim_internal::Fs

* update: use old ordering of decorators in AwsCodegenDecorator

* update: use old ordering of decorators in AwsCodegenDecorator
fix: os_shim_internal example not compiling
formatting: run ktlint
update: tests broken by RetryConfigDecorator.kt changes

* formatting: don't use * imports in kotlin

* fix: tests broken by stubConfigProject change

* Update codegen/src/test/kotlin/software/amazon/smithy/rust/RetryConfigProviderConfigTest.kt

Co-authored-by: Russell Cohen <russell.r.cohen@gmail.com>

* formatting: run ktlint

* add: back accidentally removed presigning decorator

Co-authored-by: John DiSanti <jdisanti@amazon.com>
Co-authored-by: Russell Cohen <russell.r.cohen@gmail.com>
2021-10-12 13:54:23 -05:00
.cargo Include SDK example/test projects in CI and centralize Cargo target directory (#636) 2021-08-09 12:25:40 -07:00
.github Add server specific actions to CI (#743) 2021-10-06 12:06:36 -07:00
aws feature: make retry behavior user-configurable (#741) 2021-10-12 13:54:23 -05:00
codegen feature: make retry behavior user-configurable (#741) 2021-10-12 13:54:23 -05:00
codegen-server Add `RustSettings` to `CodegenContext` (#752) 2021-10-11 20:14:03 +00:00
codegen-server-test Deduplicate server input / output / error structures by storing what has been already rendered. (#747) 2021-10-07 14:47:42 +01:00
codegen-test Deduplicate server input / output / error structures by storing what has been already rendered. (#747) 2021-10-07 14:47:42 +01:00
design Fix RFC organization (#758) 2021-10-08 15:12:12 -07:00
gradle Add pre-commit hooks (#17) 2020-11-04 22:09:00 -05:00
rust-runtime feature: make retry behavior user-configurable (#741) 2021-10-12 13:54:23 -05:00
.gitignore Sensitive trait (#229) 2021-02-23 23:09:03 +00:00
.pre-commit-config.yaml Update rustfmt hook to run on all files (#348) 2021-04-30 17:33:20 -04:00
CHANGELOG.md feature: make retry behavior user-configurable (#741) 2021-10-12 13:54:23 -05:00
CODE_OF_CONDUCT.md Initial commit 2020-10-28 06:37:45 -07:00
CONTRIBUTING.md master -> main in Contributing.md (#300) 2021-04-14 14:46:50 +00:00
LICENSE Initial commit 2020-10-28 06:37:45 -07:00
NOTICE Initial commit 2020-10-28 06:37:45 -07:00
README.md Fix design docs link 2021-05-22 20:37:40 -04:00
build.gradle.kts Remove jcenter / bintray from gradle (#651) 2021-08-16 22:02:04 +00:00
gradle.properties Smithy 1.9/1.10 Upgrade (#618) 2021-07-30 15:25:10 +00:00
gradlew Aws config connector timeouts (#740) 2021-10-06 13:35:24 -04:00
gradlew.bat Add gradle files 2020-10-28 11:01:13 -04:00
settings.gradle.kts [POC] Basic server type serde for RestJson1 (#737) 2021-10-05 13:05:00 -04:00
test.sh Credentials Provider Initial Implementation (#179) 2021-01-28 10:39:05 -05:00

README.md

Smithy Rust status

Smithy code generators for Rust

The nightly SDK build can be found under Actions -> CI (take latest run) -> Artifacts

Design documentation (WIP)

All internal and external interfaces are considered unstable and subject to change without notice.

Setup

  1. ./gradlew will setup gradle for you. JDK 11 is required.
  2. Running tests requires a working Rust installation. See Rust docs for installation instructions on your platform. Minimum supported Rust version is the latest released Rust version, although older versions may work.

Generate an AWS SDK

The generated SDK will be placed in aws/sdk/build/aws-sdk.

./gradlew :aws:sdk:assemble # Generate an SDK. Do not attempt to compile / run tests
./gradlew :aws:sdk:test # Run all the tests
./gradlew :aws:sdk:cargoCheck # only validate that it compiles

Run tests

./test.sh

This will run all the unit tests, codegen example models & Dynamo DB, validate that the generated code compiles, and run any tests targeting the generated code.

Development

For development, pre-commit hooks may be useful. Setup:

brew install pre-commit # (or appropriate for your platform: https://pre-commit.com/)
pre-commit install

Project Layout

  • aws: AWS specific codegen & Rust code (signing, endpoints, customizations, etc.) Common commands:
    • ./gradlew :aws:sdk:assemble: Generate (but do not test / compile etc.) a fresh SDK into sdk/build/aws-sdk
    • ./gradlew :aws:sdk:test: Generate & run all tests for a fresh SDK
    • ./gradlew :aws:sdk:{cargoCheck, cargoTest, cargoDocs, cargoClippy}: Generate & run specified cargo command.
  • codegen: Whitelabel Smithy code generation
  • codegen-test: Smithy protocol test generation & integration tests for Smithy whitelabel code
  • design: Design documentation. See the design/README.md for details about building / viewing.