Go to file
Zelda Hessler 50d88a5bf5
Feature: Customizable Operations (#1647)
feature: customizable operations
update: CHANGELOG.next.toml
update: RFC0017
update: add IntelliJ idea folder to .gitignore
add: GenericsGenerator with tests and docs
add: rustTypeParameters helper fn with tests and docs
add: RetryPolicy optional arg to FluentClientGenerator
move: FluentClientGenerator into its own file
2022-09-02 17:47:25 -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 update: don't print results of "Untar artifacts" CI task (#1699) 2022-09-02 17:13:34 -04:00
.pre-commit-hooks Fix `SPDX-License-Identifier` in header comments (#1377) 2022-05-09 09:50:46 -05:00
aws Feature: Customizable Operations (#1647) 2022-09-02 17:47:25 -05:00
buildSrc Don't depend on the `modifyMtime` task if it has not been registered (#1607) 2022-08-02 10:55:35 +00:00
codegen Feature: Customizable Operations (#1647) 2022-09-02 17:47:25 -05:00
codegen-server Upgrade min versions of tokio, tracing-subscriber, and criterion (#1662) 2022-08-31 21:19:04 +00:00
codegen-server-test Add server extra tests (#1497) 2022-08-24 20:41:40 +00:00
codegen-test Add server extra tests (#1497) 2022-08-24 20:41:40 +00:00
design Feature: Customizable Operations (#1647) 2022-09-02 17:47:25 -05:00
gradle Upgrade to Gradle 7 (#1411) 2022-06-23 12:27:43 -04:00
rust-runtime Feature: Customizable Operations (#1647) 2022-09-02 17:47:25 -05:00
tools Use the same smithy-rs revision for all commits in `sdk-sync` (#1694) 2022-09-02 01:45:49 +00:00
.cargo-deny-config.toml Add license checks to CI (#1687) 2022-09-01 14:40:29 -07:00
.editorconfig Upgrade Ktlint and fix lint configuration (#1572) 2022-07-27 18:04:07 +00:00
.gitignore Feature: Customizable Operations (#1647) 2022-09-02 17:47:25 -05:00
.pre-commit-config.yaml Upgrade Ktlint and fix lint configuration (#1572) 2022-07-27 18:04:07 +00:00
CHANGELOG.md Update changelog 2022-08-31 09:48:52 +00:00
CHANGELOG.next.toml Feature: Customizable Operations (#1647) 2022-09-02 17:47:25 -05:00
CODEOWNERS Allow review of codegen to server members (#1659) 2022-08-23 20:55:01 +00:00
CODE_OF_CONDUCT.md Initial commit 2020-10-28 06:37:45 -07:00
CONTRIBUTING.md add: rfc template (#1428) 2022-06-01 10:41:29 -05: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 Upgrade to Gradle 7 (#1411) 2022-06-23 12:27:43 -04:00
build.gradle.kts Upgrade Ktlint and fix lint configuration (#1572) 2022-07-27 18:04:07 +00:00
ci Add release metadata to `versions.toml` (#1400) 2022-05-23 23:31:23 +00:00
ci.mk Fix adhoc SDK codegen and refactor SDK CI (#1624) 2022-08-10 09:08:08 -07:00
gradle.properties Version bump smithy-rs (#1673) 2022-08-26 00:58:24 +00:00
gradlew Upgrade to Gradle 7 (#1411) 2022-06-23 12:27:43 -04:00
gradlew.bat Upgrade to Gradle 7 (#1411) 2022-06-23 12:27:43 -04:00
settings.gradle.kts Fix adhoc SDK codegen and refactor SDK CI (#1624) 2022-08-10 09:08:08 -07:00

README.md

Smithy Rust CI on Branch main

Smithy code generators for Rust that generate clients, servers, and the entire AWS SDK. The latest unreleased SDK build can be found in aws-sdk-rust/next.

Design documentation

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

Setup

  1. ./gradlew will setup gradle for you. JDK 17 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.

Development

For development, pre-commit hooks make it easier to pass automated linting when opening a pull request. 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 client code generation
  • codegen-test: Smithy protocol test generation & integration tests for Smithy client whitelabel code
  • design: Design documentation. See the design/README.md for details about building / viewing.
  • codegen-server: Whitelabel Smithy server code generation
  • codegen-server-test: Smithy protocol test generation & integration tests for Smithy server whitelabel code

Testing

Running all of smithy-rs's tests can take a very long time, so it's better to know which parts to test based on the changes being made, and allow continuous integration to find other issues when posting a pull request.

In general, the components of smithy-rs affect each other in the following order (with earlier affecting later):

  1. rust-runtime
  2. codegen and codegen-server
  3. aws/rust-runtime
  4. aws/sdk-codegen

Some components, such as codegen-test and codegen-server-test, are purely for testing other components.

Testing rust-runtime and aws/rust-runtime

To test the rust-runtime crates:

# Run all Rust tests for `rust-runtime/`
./gradlew rust-runtime:cargoTest
# Run clippy for `rust-runtime/`
./gradlew rust-runtime:cargoClippy

For aws/rust-runtime, just prefix with aws::

# Run all Rust tests for `rust-runtime/`
./gradlew aws:rust-runtime:cargoTest
# Run clippy for `rust-runtime/`
./gradlew aws:rust-runtime:cargoClippy

Some runtime crates have a additional-ci script that can also be run. These scripts often require cargo-hack and cargo-udeps to be installed.

Testing Client/Server Codegen

To test the code generation, the following can be used:

# Run Kotlin codegen unit tests
./gradlew codegen:check
# Run client codegen tests
./gradlew codegen-test:check
# Run server codegen tests
./gradlew codegen-server-test:check

Several Kotlin unit tests generate Rust projects and compile them. When these fail, they typically output links to the location of the generated code so that it can be inspected.

To look at generated code when the codegen tests fail, check these paths depending on the test suite that's failing:

  • For codegen-test: codegen-test/build/smithyprojections/codegen-test
  • For codgen-server-test: codegen-server-test/build/smithyprojections/codegen-server-test

Testing SDK Codegen

See the readme in aws/sdk/ for more information about these targets as they can be configured to generate more or less AWS service clients.

# Run Kotlin codegen unit tests
./gradlew aws:sdk-codegen:check
# Generate an SDK, but do not attempt to compile / run tests. Useful for inspecting generated code
./gradlew :aws:sdk:assemble
# Run all the tests
./gradlew :aws:sdk:test
# Validate that the generated code compiles
./gradlew :aws:sdk:cargoCheck
# Validate that the generated code passes Clippy
./gradlew :aws:sdk:cargoClippy
# Validate the generated docs
./gradlew :aws:sdk:cargoDoc

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