From 5ac464f29d470f466c1cba46975d464bd1e9df73 Mon Sep 17 00:00:00 2001 From: George Fu Date: Tue, 29 Oct 2024 16:41:39 +0000 Subject: [PATCH 1/3] chore(scripts): script to find clients using customizations --- .../find-clients-with-customizations.js | 110 ++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 scripts/validation/find-clients-with-customizations.js diff --git a/scripts/validation/find-clients-with-customizations.js b/scripts/validation/find-clients-with-customizations.js new file mode 100644 index 000000000000..b01f1a7c59a2 --- /dev/null +++ b/scripts/validation/find-clients-with-customizations.js @@ -0,0 +1,110 @@ +/** + * + * This script generates an ignore pattern for clients that don't have any unique + * customizations. + * + */ + +const path = require("path"); +const fs = require("fs"); + +const clients = fs.readdirSync(path.join(__dirname, "..", "..", "clients")); + +const keep = [ + "api-gateway", + "apigatewayv2", + "cloudfront-keyvaluestore", + "cognito-identity", + "dynamodb", + "ec2", + "glacier", + "iam", + "kinesis", + "kms", + "lambda", + "machine-learning", + "rds", + "route-53", + "s3", + "s3-control", + "sqs", + "sts", + "transcribe-streaming", +]; + +const commonPackages = { + "@aws-crypto/sha256-browser": "", + "@aws-crypto/sha256-js": "", + "@aws-sdk/client-sso-oidc": "", + "@aws-sdk/client-sts": "", + "@aws-sdk/core": "", + "@aws-sdk/credential-provider-node": "", + "@aws-sdk/middleware-host-header": "", + "@aws-sdk/middleware-logger": "", + "@aws-sdk/middleware-recursion-detection": "", + "@aws-sdk/middleware-user-agent": "", + "@aws-sdk/region-config-resolver": "", + "@aws-sdk/types": "", + "@aws-sdk/util-endpoints": "", + "@aws-sdk/util-user-agent-browser": "", + "@aws-sdk/util-user-agent-node": "", + "@smithy/config-resolver": "", + "@smithy/core": "", + "@smithy/fetch-http-handler": "", + "@smithy/hash-node": "", + "@smithy/invalid-dependency": "", + "@smithy/middleware-content-length": "", + "@smithy/middleware-endpoint": "", + "@smithy/middleware-retry": "", + "@smithy/middleware-serde": "", + "@smithy/middleware-stack": "", + "@smithy/node-config-provider": "", + "@smithy/node-http-handler": "", + "@smithy/protocol-http": "", + "@smithy/smithy-client": "", + "@smithy/types": "", + "@smithy/url-parser": "", + "@smithy/util-base64": "", + "@smithy/util-body-length-browser": "", + "@smithy/util-body-length-node": "", + "@smithy/util-defaults-mode-browser": "", + "@smithy/util-defaults-mode-node": "", + "@smithy/util-endpoints": "", + "@smithy/util-middleware": "", + "@smithy/util-retry": "", + "@smithy/util-utf8": "", + "@types/uuid": "", + tslib: "", + uuid: "", + "@smithy/util-waiter": "", + "@smithy/util-stream": "", + "@aws-sdk/xml-builder": "", + "@smithy/eventstream-serde-browser": "", + "@smithy/eventstream-serde-config-resolver": "", + "@smithy/eventstream-serde-node": "", +}; + +let ignore = []; + +for (const client of clients) { + const pkgJson = require(path.join(__dirname, "..", "..", "clients", client, "package.json")); + const shortName = pkgJson.name.split("@aws-sdk/client-")[1]; + + let interesting = false; + + for (const dep in pkgJson.dependencies) { + if (!(dep in commonPackages)) { + interesting = true; + } + } + + if (interesting && !keep.includes(shortName)) { + keep.push(shortName); + } else if (!keep.includes(shortName)) { + ignore.push(shortName); + } +} + +console.log("keep:", keep); +console.log("ignore:"); +console.log(`**/client-{${ignore.join(",")}}`); From 2d4c426798e82c270cc3f46cf8e3faa58d0752bd Mon Sep 17 00:00:00 2001 From: George Fu Date: Tue, 29 Oct 2024 17:14:02 +0000 Subject: [PATCH 2/3] chore(scripts): also include clients with tests --- scripts/validation/find-clients-with-customizations.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/validation/find-clients-with-customizations.js b/scripts/validation/find-clients-with-customizations.js index b01f1a7c59a2..86f2acba442e 100644 --- a/scripts/validation/find-clients-with-customizations.js +++ b/scripts/validation/find-clients-with-customizations.js @@ -98,6 +98,10 @@ for (const client of clients) { } } + if (pkgJson.scripts.test || pkgJson.scripts["test:integration"] || pkgJson.scripts["test:e2e"]) { + interesting = true; + } + if (interesting && !keep.includes(shortName)) { keep.push(shortName); } else if (!keep.includes(shortName)) { From 626a42798d3fd9272183b3433fe0f85be8e0423c Mon Sep 17 00:00:00 2001 From: George Fu Date: Tue, 29 Oct 2024 17:15:15 +0000 Subject: [PATCH 3/3] chore(scripts): and sagemaker --- scripts/validation/find-clients-with-customizations.js | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/validation/find-clients-with-customizations.js b/scripts/validation/find-clients-with-customizations.js index 86f2acba442e..70ef1164b269 100644 --- a/scripts/validation/find-clients-with-customizations.js +++ b/scripts/validation/find-clients-with-customizations.js @@ -27,6 +27,7 @@ const keep = [ "route-53", "s3", "s3-control", + "sagemaker", "sqs", "sts", "transcribe-streaming",