From 8c7fbe6a5e3c9a8fdd853b64a53598858f52e70e Mon Sep 17 00:00:00 2001 From: Samuel Bodin <1637651+bodinsamuel@users.noreply.github.com> Date: Wed, 13 Sep 2023 23:44:13 +0200 Subject: [PATCH] fix(rules): add AWS CodeBuild --- src/rules/__snapshots__/index.test.ts.snap | 1 + .../__snapshots__/component.test.ts.snap | 5 +++++ .../__snapshots__/lockfile.test.ts.snap | 5 +++++ .../__snapshots__/component.test.ts.snap | 6 ++++++ .../ruby/__snapshots__/lockfile.test.ts.snap | 5 +++++ .../rust/__snapshots__/component.test.ts.snap | 6 ++++++ .../__snapshots__/resource.test.ts.snap | 1 + src/rules/tool/aws.codebuild.ts | 19 +++++++++++++++++++ src/rules/tool/index.ts | 1 + src/types/techs.ts | 1 + 10 files changed, 50 insertions(+) create mode 100644 src/rules/tool/aws.codebuild.ts diff --git a/src/rules/__snapshots__/index.test.ts.snap b/src/rules/__snapshots__/index.test.ts.snap index 133d2e0a..165a11ed 100644 --- a/src/rules/__snapshots__/index.test.ts.snap +++ b/src/rules/__snapshots__/index.test.ts.snap @@ -24,6 +24,7 @@ exports[`all > should match everything 1`] = ` "auth0", "aws", "aws.amplify_hosting", + "aws.codebuild", "aws.dynamodb", "aws.ec2", "aws.ecs", diff --git a/src/rules/spec/githubActions/__snapshots__/component.test.ts.snap b/src/rules/spec/githubActions/__snapshots__/component.test.ts.snap index 6bae3d8a..01fd1d6d 100644 --- a/src/rules/spec/githubActions/__snapshots__/component.test.ts.snap +++ b/src/rules/spec/githubActions/__snapshots__/component.test.ts.snap @@ -181,6 +181,11 @@ exports[`docker > should match all dependencies 2`] = ` "aws-actions/amazon-eks-fargate", "1", ], + [ + "githubAction", + "aws-actions/aws-codebuild-run-build", + "1", + ], [ "githubAction", "aws-actions/configure-aws-credentials", diff --git a/src/rules/spec/golang/__snapshots__/lockfile.test.ts.snap b/src/rules/spec/golang/__snapshots__/lockfile.test.ts.snap index a8a754f0..16e05755 100644 --- a/src/rules/spec/golang/__snapshots__/lockfile.test.ts.snap +++ b/src/rules/spec/golang/__snapshots__/lockfile.test.ts.snap @@ -184,6 +184,11 @@ exports[`golang (lockfile) > should match everything 2`] = ` "github.com/aws/aws-sdk-go-v2", "v1.0.0", ], + [ + "golang", + "github.com/aws/aws-sdk-go-v2/service/codebuild", + "v1.0.0", + ], [ "golang", "github.com/aws/aws-sdk-go-v2/service/dynamodb", diff --git a/src/rules/spec/nodejs/__snapshots__/component.test.ts.snap b/src/rules/spec/nodejs/__snapshots__/component.test.ts.snap index d5daca42..5d519a1f 100644 --- a/src/rules/spec/nodejs/__snapshots__/component.test.ts.snap +++ b/src/rules/spec/nodejs/__snapshots__/component.test.ts.snap @@ -10,6 +10,7 @@ exports[`npm > should match everything 1`] = ` "auth0", "aws", "aws.amplify_hosting", + "aws.codebuild", "aws.dynamodb", "aws.ec2", "aws.ecs", @@ -193,6 +194,11 @@ exports[`npm > should match everything 2`] = ` "@aws-amplify/ui-react", "0.0.0", ], + [ + "npm", + "@aws-sdk/client-codebuild", + "0.0.0", + ], [ "npm", "@aws-sdk/client-dynamodb-streams", diff --git a/src/rules/spec/ruby/__snapshots__/lockfile.test.ts.snap b/src/rules/spec/ruby/__snapshots__/lockfile.test.ts.snap index 8bc1cdb2..77235a71 100644 --- a/src/rules/spec/ruby/__snapshots__/lockfile.test.ts.snap +++ b/src/rules/spec/ruby/__snapshots__/lockfile.test.ts.snap @@ -109,6 +109,11 @@ exports[`ruby (component) > should match everything 2`] = ` "auth0", "1.0.0", ], + [ + "ruby", + "aws-sdk-codebuild", + "1.0.0", + ], [ "ruby", "aws-sdk-dynamodbstreams", diff --git a/src/rules/spec/rust/__snapshots__/component.test.ts.snap b/src/rules/spec/rust/__snapshots__/component.test.ts.snap index e6fd2e39..5f7aefc9 100644 --- a/src/rules/spec/rust/__snapshots__/component.test.ts.snap +++ b/src/rules/spec/rust/__snapshots__/component.test.ts.snap @@ -6,6 +6,7 @@ exports[`rust (component) > should match everything 1`] = ` "apache_cassandra", "auth0", "aws", + "aws.codebuild", "aws.dynamodb", "aws.ec2", "aws.ecs", @@ -65,6 +66,11 @@ exports[`rust (component) > should match everything 2`] = ` "auth0", "1.0.0", ], + [ + "rust", + "aws-sdk-codebuild", + "1.0.0", + ], [ "rust", "aws-sdk-dynamodb", diff --git a/src/rules/spec/terraform/__snapshots__/resource.test.ts.snap b/src/rules/spec/terraform/__snapshots__/resource.test.ts.snap index b55f1b28..a3b823a4 100644 --- a/src/rules/spec/terraform/__snapshots__/resource.test.ts.snap +++ b/src/rules/spec/terraform/__snapshots__/resource.test.ts.snap @@ -4,6 +4,7 @@ exports[`terraform (resource) > should match everything 1`] = ` [ "aws", "aws.amplify_hosting", + "aws.codebuild", "aws.dynamodb", "aws.ec2", "aws.ecs", diff --git a/src/rules/tool/aws.codebuild.ts b/src/rules/tool/aws.codebuild.ts new file mode 100644 index 00000000..9f56b759 --- /dev/null +++ b/src/rules/tool/aws.codebuild.ts @@ -0,0 +1,19 @@ +import { register } from '../../register.js'; + +register({ + tech: 'aws.codebuild', + name: 'AWS Code Build', + type: 'tool', + dependencies: [ + { type: 'npm', name: '@aws-sdk/client-codebuild' }, + { type: 'rust', name: 'aws-sdk-codebuild' }, + { type: 'ruby', name: 'aws-sdk-codebuild' }, + { type: 'golang', name: 'github.com/aws/aws-sdk-go-v2/service/codebuild' }, + { + type: 'terraform.resource', + name: /^aws_codebuild_/, + example: 'aws_codebuild_project', + }, + { type: 'githubAction', name: 'aws-actions/aws-codebuild-run-build' }, + ], +}); diff --git a/src/rules/tool/index.ts b/src/rules/tool/index.ts index cb1462a0..ff4c2d2d 100644 --- a/src/rules/tool/index.ts +++ b/src/rules/tool/index.ts @@ -1,4 +1,5 @@ import './ansible.js'; +import './aws.codebuild.js'; import './gcp.cloudbuild.js'; import './gitlab.js'; import './helm.js'; diff --git a/src/types/techs.ts b/src/types/techs.ts index 5e3313bd..365ea95a 100644 --- a/src/types/techs.ts +++ b/src/types/techs.ts @@ -35,6 +35,7 @@ export type AllowedKeys = | 'atlassian' | 'auth0' | 'aws.amplify_hosting' + | 'aws.codebuild' | 'aws.dynamodb' | 'aws.ec2' | 'aws.ecs'