Skip to content

Commit

Permalink
fix(rules): add Azure Redis
Browse files Browse the repository at this point in the history
  • Loading branch information
bodinsamuel committed Sep 18, 2023
1 parent c58a520 commit f2d8cf3
Show file tree
Hide file tree
Showing 13 changed files with 89 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/rules/__snapshots__/index.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ exports[`all > should match everything 1`] = `
"azure.cosmosdb",
"azure.mysql",
"azure.postgres",
"azure.redis",
"azure.sql",
"betterstack",
"bigcommerce",
Expand Down
4 changes: 4 additions & 0 deletions src/rules/db/azure.cosmosdb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,9 @@ register({
{ type: 'rust', name: 'azure_mgmt_cosmosdb' },
{ type: 'npm', name: '@azure/arm-cosmosdb' },
{ type: 'npm', name: '@azure/cosmos' },
{
type: 'golang',
name: 'github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos',
},
],
});
4 changes: 4 additions & 0 deletions src/rules/db/azure.mysql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,9 @@ register({
{ type: 'rust', name: 'azure_mgmt_mysql' },
{ type: 'npm', name: '@azure/arm-mysql' },
{ type: 'githubAction', name: 'azure/mysql' },
{
type: 'golang',
name: 'github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql',
},
],
});
4 changes: 4 additions & 0 deletions src/rules/db/azure.postgres.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,9 @@ register({
{ type: 'rust', name: 'azure_mgmt_postgresql' },
{ type: 'npm', name: '@azure/arm-postgresql' },
{ type: 'githubAction', name: 'azure/postgresql' },
{
type: 'golang',
name: 'github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql',
},
],
});
21 changes: 21 additions & 0 deletions src/rules/db/azure.redis.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { register } from '../../register.js';

register({
tech: 'azure.redis',
name: 'Azure Redis',
type: 'db',
dependencies: [
{
type: 'terraform.resource',
name: /^azurerm_redis_/,
example: 'azurerm_redis_cache',
},
{ type: 'ruby', name: 'azure_mgmt_redis' },
{ type: 'rust', name: 'azure_mgmt_redis' },
{ type: 'npm', name: '@azure/arm-redis' },
{
type: 'golang',
name: 'github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redis/armredis/v2',
},
],
});
4 changes: 4 additions & 0 deletions src/rules/db/azure.sql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,9 @@ register({
{ type: 'ruby', name: 'azure_mgmt_sql' },
{ type: 'rust', name: 'azure_mgmt_sql' },
{ type: 'npm', name: '@azure/arm-sql' },
{
type: 'golang',
name: 'github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql',
},
],
});
1 change: 1 addition & 0 deletions src/rules/db/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import './aws.timestream.js';
import './azure.cosmosdb.js';
import './azure.mysql.js';
import './azure.postgres.js';
import './azure.redis.js';
import './azure.sql.js';
import './clickhouse.js';
import './cockroachdb.js';
Expand Down
30 changes: 30 additions & 0 deletions src/rules/spec/golang/__snapshots__/lockfile.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ exports[`golang (lockfile) > should match everything 1`] = `
"aws.timestream",
"aws.translate",
"azure",
"azure.cosmosdb",
"azure.mysql",
"azure.postgres",
"azure.redis",
"azure.sql",
"brevo",
"clickhouse",
"elasticsearch",
Expand Down Expand Up @@ -221,6 +226,31 @@ exports[`golang (lockfile) > should match everything 2`] = `
"github.com/Azure/azure-sdk-for-go",
"v1.0.0",
],
[
"golang",
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos",
"v1.0.0",
],
[
"golang",
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mysql/armmysql",
"v1.0.0",
],
[
"golang",
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql",
"v1.0.0",
],
[
"golang",
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redis/armredis/v2",
"v1.0.0",
],
[
"golang",
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql",
"v1.0.0",
],
[
"golang",
"github.com/ClickHouse/clickhouse-go",
Expand Down
6 changes: 6 additions & 0 deletions src/rules/spec/nodejs/__snapshots__/component.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ exports[`npm > should match everything 1`] = `
"azure.cosmosdb",
"azure.mysql",
"azure.postgres",
"azure.redis",
"azure.sql",
"betterstack",
"bootstrap",
Expand Down Expand Up @@ -637,6 +638,11 @@ exports[`npm > should match everything 2`] = `
"@azure/arm-postgresql",
"0.0.0",
],
[
"npm",
"@azure/arm-redis",
"0.0.0",
],
[
"npm",
"@azure/arm-sql",
Expand Down
6 changes: 6 additions & 0 deletions src/rules/spec/ruby/__snapshots__/lockfile.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ exports[`ruby (component) > should match everything 1`] = `
"azure.cosmosdb",
"azure.mysql",
"azure.postgres",
"azure.redis",
"azure.sql",
"betterstack",
"brevo",
Expand Down Expand Up @@ -377,6 +378,11 @@ exports[`ruby (component) > should match everything 2`] = `
"azure_mgmt_postgresql",
"1.0.0",
],
[
"ruby",
"azure_mgmt_redis",
"1.0.0",
],
[
"ruby",
"azure_mgmt_sql",
Expand Down
6 changes: 6 additions & 0 deletions src/rules/spec/rust/__snapshots__/component.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ exports[`rust (component) > should match everything 1`] = `
"azure.cosmosdb",
"azure.mysql",
"azure.postgres",
"azure.redis",
"azure.sql",
"cloudflare",
"couchbase",
Expand Down Expand Up @@ -318,6 +319,11 @@ exports[`rust (component) > should match everything 2`] = `
"azure_mgmt_postgresql",
"1.0.0",
],
[
"rust",
"azure_mgmt_redis",
"1.0.0",
],
[
"rust",
"azure_mgmt_sql",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ exports[`terraform (resource) > should match everything 1`] = `
"azure.cosmosdb",
"azure.mysql",
"azure.postgres",
"azure.redis",
"azure.sql",
"cloudflare",
"cloudflare.pages",
Expand Down
1 change: 1 addition & 0 deletions src/types/techs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export type AllowedKeys =
| 'azure.cosmosdb'
| 'azure.mysql'
| 'azure.postgres'
| 'azure.redis'
| 'azure.sql'
| 'azure'
| 'bash'
Expand Down

0 comments on commit f2d8cf3

Please sign in to comment.