From c60da3faadbda352c0d79c226fdcac3ac0ba56d5 Mon Sep 17 00:00:00 2001 From: John DiSanti Date: Tue, 26 Apr 2022 08:47:09 -0700 Subject: [PATCH] Lint for external types in `aws-config` during CI (#1337) --- aws/rust-runtime/aws-config/additional-ci | 3 +++ aws/rust-runtime/aws-config/api-linter.toml | 25 +++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 aws/rust-runtime/aws-config/api-linter.toml diff --git a/aws/rust-runtime/aws-config/additional-ci b/aws/rust-runtime/aws-config/additional-ci index 00522a9e0..596270766 100755 --- a/aws/rust-runtime/aws-config/additional-ci +++ b/aws/rust-runtime/aws-config/additional-ci @@ -8,6 +8,9 @@ set -e +echo "### Checking for external types in public API" +cargo "+${RUST_NIGHTLY_VERSION:-nightly}" api-linter --all-features --config api-linter.toml + echo "### Checking for duplicate dependency versions in the normal dependency graph with all features enabled" cargo tree -d --edges normal --all-features diff --git a/aws/rust-runtime/aws-config/api-linter.toml b/aws/rust-runtime/aws-config/api-linter.toml new file mode 100644 index 000000000..6c4f53356 --- /dev/null +++ b/aws/rust-runtime/aws-config/api-linter.toml @@ -0,0 +1,25 @@ +# IMPORTANT: Types from `aws-sdk-*` crates MUST NOT be allowed to be +# exposed in `aws-config`'s public API. Otherwise, `aws-config` will +# require manual version bumping every time an automated version bump +# to the exposed SDK crates happens. +allowed_external_types = [ + "aws_smithy_async::rt::sleep::AsyncSleep", + "aws_smithy_client::bounds::SmithyConnector", + "aws_smithy_client::erase::DynConnector", + "aws_smithy_client::erase::boxclone::BoxCloneService", + "aws_smithy_client::http_connector::HttpConnector", + "aws_smithy_client::http_connector::HttpSettings", + "aws_smithy_http::body::SdkBody", + "aws_smithy_http::result::SdkError", + "aws_smithy_types::retry::RetryConfig*", + "aws_smithy_types::timeout::config::Config", + "aws_smithy_types::timeout::error::ConfigError", + "aws_types::*", + "http::response::Response", + "http::uri::InvalidUri", + "http::uri::Uri", + "hyper::client::connect::Connection", + "tokio::io::async_read::AsyncRead", + "tokio::io::async_write::AsyncWrite", + "tower_service::Service", +] -- GitLab