From 521dc7684fc0124674906075de535dd2f5124946 Mon Sep 17 00:00:00 2001 From: Samuel Bodin <1637651+bodinsamuel@users.noreply.github.com> Date: Mon, 7 Aug 2023 19:26:28 +0200 Subject: [PATCH] fix(rules): add GCP BigTable --- src/common/techs.ts | 1 + src/rules/db/gcp.bigtable.ts | 17 +++++++++++++++++ src/rules/db/index.ts | 1 + src/rules/hosting/gcp.ts | 1 + src/rules/js/angular.ts | 5 ++++- .../nodejs/__snapshots__/component.test.ts.snap | 1 + .../ruby/__snapshots__/component.test.ts.snap | 6 ++++++ .../__snapshots__/resource.test.ts.snap | 1 + src/types/techs.ts | 1 + 9 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 src/rules/db/gcp.bigtable.ts diff --git a/src/common/techs.ts b/src/common/techs.ts index 07aef9d8..b17ad59a 100644 --- a/src/common/techs.ts +++ b/src/common/techs.ts @@ -48,6 +48,7 @@ export const list: TechItem[] = [ { key: 'flyio', name: 'Fly.io', type: 'hosting' }, { key: 'gcp', name: 'GCP', type: 'hosting' }, { key: 'gcp.bigquery', name: 'Big Query', type: 'db' }, + { key: 'gcp.bigtable', name: 'Big Table', type: 'db' }, { key: 'gcp.cloudrun', name: 'Cloud Run', type: 'hosting' }, { key: 'gcp.pubsub', name: 'PubSub', type: 'messaging' }, { key: 'gcp.gce', name: 'Compute Engine', type: 'hosting' }, diff --git a/src/rules/db/gcp.bigtable.ts b/src/rules/db/gcp.bigtable.ts new file mode 100644 index 00000000..3d43532c --- /dev/null +++ b/src/rules/db/gcp.bigtable.ts @@ -0,0 +1,17 @@ +import { register } from '../../rules.js'; + +register({ + tech: 'gcp.bigtable', + dependencies: [ + { type: 'npm', name: '@google-cloud/bigtable' }, + { + type: 'terraform.resource', + name: 'google_bigtable_instance', + }, + { + type: 'terraform.resource', + name: 'google_bigtable_table', + }, + { type: 'ruby', name: 'google-cloud-bigtable' }, + ], +}); diff --git a/src/rules/db/index.ts b/src/rules/db/index.ts index b5883eb6..29244e8e 100644 --- a/src/rules/db/index.ts +++ b/src/rules/db/index.ts @@ -4,6 +4,7 @@ import './cockroachdb.js'; import './couchbase.js'; import './elasticsearch.js'; import './gcp.bigquery.js'; +import './gcp.bigtable.js'; import './gcp.sql.js'; import './influxdb.js'; import './mariadb.js'; diff --git a/src/rules/hosting/gcp.ts b/src/rules/hosting/gcp.ts index 5f5bbc01..6cd656ea 100644 --- a/src/rules/hosting/gcp.ts +++ b/src/rules/hosting/gcp.ts @@ -3,6 +3,7 @@ import { register } from '../../rules.js'; register({ tech: 'gcp', dependencies: [ + { type: 'npm', name: 'googleapis' }, { type: 'npm', name: /^@google-cloud\//, example: '@google-cloud/storage' }, { type: 'terraform', name: 'registry.terraform.io/hashicorp/google' }, { type: 'ruby', name: /^google-cloud-/, example: 'google-cloud-storage' }, diff --git a/src/rules/js/angular.ts b/src/rules/js/angular.ts index c06a899e..4ea29a2d 100644 --- a/src/rules/js/angular.ts +++ b/src/rules/js/angular.ts @@ -3,5 +3,8 @@ import { register } from '../../rules.js'; register({ tech: 'angular', files: ['angular.json'], - dependencies: [{ type: 'npm', name: 'angular' }], + dependencies: [ + { type: 'npm', name: 'angular' }, + { type: 'npm', name: /^@angular\//, example: '@angular/forms' }, + ], }); diff --git a/src/rules/spec/nodejs/__snapshots__/component.test.ts.snap b/src/rules/spec/nodejs/__snapshots__/component.test.ts.snap index bd6a2259..8537c2ee 100644 --- a/src/rules/spec/nodejs/__snapshots__/component.test.ts.snap +++ b/src/rules/spec/nodejs/__snapshots__/component.test.ts.snap @@ -22,6 +22,7 @@ exports[`npm > should match everything 1`] = ` "firebase", "gcp", "gcp.bigquery", + "gcp.bigtable", "gcp.cloudrun", "gcp.gce", "gcp.gcs", diff --git a/src/rules/spec/ruby/__snapshots__/component.test.ts.snap b/src/rules/spec/ruby/__snapshots__/component.test.ts.snap index 2b261717..a672f95a 100644 --- a/src/rules/spec/ruby/__snapshots__/component.test.ts.snap +++ b/src/rules/spec/ruby/__snapshots__/component.test.ts.snap @@ -9,6 +9,7 @@ Set { "elasticsearch", "gcp", "gcp.bigquery", + "gcp.bigtable", "gcp.sql", "influxdb", "mariadb", @@ -163,6 +164,11 @@ exports[`ruby (component) > should match everything 2`] = ` "google-cloud-bigquery", "1.0.0", ], + [ + "ruby", + "google-cloud-bigtable", + "1.0.0", + ], [ "ruby", "google-cloud-compute", diff --git a/src/rules/spec/terraform/__snapshots__/resource.test.ts.snap b/src/rules/spec/terraform/__snapshots__/resource.test.ts.snap index 395cb287..d4cee9fe 100644 --- a/src/rules/spec/terraform/__snapshots__/resource.test.ts.snap +++ b/src/rules/spec/terraform/__snapshots__/resource.test.ts.snap @@ -5,6 +5,7 @@ exports[`terraform (resource) > should match everything 1`] = ` "datadog", "gcp", "gcp.bigquery", + "gcp.bigtable", "gcp.cloudrun", "gcp.gce", "gcp.gcs", diff --git a/src/types/techs.ts b/src/types/techs.ts index aec25d31..a0ea9c68 100644 --- a/src/types/techs.ts +++ b/src/types/techs.ts @@ -57,6 +57,7 @@ export type AllowedKeys = | 'firebase' | 'flyio' | 'gcp.bigquery' + | 'gcp.bigtable' | 'gcp.cloudrun' | 'gcp.gce' | 'gcp.gcs'