From 712b0ca077d827a55df445824548049e15b53980 Mon Sep 17 00:00:00 2001 From: Samuel Bodin <1637651+bodinsamuel@users.noreply.github.com> Date: Tue, 4 Jul 2023 14:52:36 +0200 Subject: [PATCH] fix(rules): add CockroachDB --- TODO.todo | 2 +- src/common/techs.ts | 1 + src/rules/db/cockroachdb.ts | 11 +++++++++++ src/rules/db/index.ts | 7 ++++--- .../terraform/__snapshots__/dependencies.test.ts.snap | 1 + src/types/techs.ts | 1 + 6 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 src/rules/db/cockroachdb.ts diff --git a/TODO.todo b/TODO.todo index 4e8a84b1..711566b4 100644 --- a/TODO.todo +++ b/TODO.todo @@ -39,7 +39,7 @@ Terraform: - ??? ✔ Mongo DB Atlas @done(23-05-02 12:09) ✔ Elastic stack @done(23-05-02 12:13) - - CockroachDB + ✔ CockroachDB @done(23-07-04 14:52) - Redis cloud - snowflake - couchbase capella diff --git a/src/common/techs.ts b/src/common/techs.ts index 5b3fbfa7..b531689b 100644 --- a/src/common/techs.ts +++ b/src/common/techs.ts @@ -18,6 +18,7 @@ export const list: TechItem[] = [ { key: 'circleci', name: 'CircleCi', type: 'ci' }, { key: 'cirrusci', name: 'CirrusCi', type: 'ci' }, { key: 'couchbase', name: 'Couchbase', type: 'db' }, + { key: 'cockroachdb', name: 'CockroachDB', type: 'db' }, { key: 'cloudflare', name: 'Cloudflare', type: 'hosting' }, { key: 'codesandboxci', name: 'CodesandboxCI', type: 'ci' }, { key: 'couchbase', name: 'Couchbase', type: 'db' }, diff --git a/src/rules/db/cockroachdb.ts b/src/rules/db/cockroachdb.ts new file mode 100644 index 00000000..9de4738f --- /dev/null +++ b/src/rules/db/cockroachdb.ts @@ -0,0 +1,11 @@ +import { register } from '../../rules.js'; + +register({ + tech: 'cockroachdb', + dependencies: [ + { + type: 'terraform', + name: 'registry.terraform.io/cockroachdb/cockroach', + }, + ], +}); diff --git a/src/rules/db/index.ts b/src/rules/db/index.ts index 08dbf6db..9a922651 100644 --- a/src/rules/db/index.ts +++ b/src/rules/db/index.ts @@ -1,15 +1,16 @@ +import './aws.dynamodb.js'; import './cassandra.js'; +import './cockroachdb.js'; import './couchbase.js'; -import './aws.dynamodb.js'; import './elasticsearch.js'; +import './gcp.bigquery.js'; +import './gcp.sql.js'; import './influxdb.js'; import './mariadb.js'; import './memcached.js'; import './mongo.js'; import './mysql.js'; import './neo4j.js'; -import './gcp.bigquery.js'; -import './gcp.sql.js'; import './percona.js'; import './postgres.js'; import './redis.js'; diff --git a/src/rules/spec/terraform/__snapshots__/dependencies.test.ts.snap b/src/rules/spec/terraform/__snapshots__/dependencies.test.ts.snap index cc5a24e1..0c35329c 100644 --- a/src/rules/spec/terraform/__snapshots__/dependencies.test.ts.snap +++ b/src/rules/spec/terraform/__snapshots__/dependencies.test.ts.snap @@ -6,6 +6,7 @@ exports[`terraform (lockfile) > should match everything 1`] = ` "auth0", "aws", "azure", + "cockroachdb", "datadog", "elasticsearch", "elasticstack", diff --git a/src/types/techs.ts b/src/types/techs.ts index b61659ea..227cea0b 100644 --- a/src/types/techs.ts +++ b/src/types/techs.ts @@ -28,6 +28,7 @@ export type AllowedKeys = | 'circleci' | 'cirrusci' | 'cloudflare' + | 'cockroachdb' | 'codesandboxci' | 'couchbase' | 'cplusplus'