Skip to content

Commit

Permalink
fix(rules): add Azure MySQL
Browse files Browse the repository at this point in the history
  • Loading branch information
bodinsamuel committed Sep 18, 2023
1 parent 52bde9d commit c58a520
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 1 deletion.
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 @@ -67,6 +67,7 @@ exports[`all > should match everything 1`] = `
"azure.aks",
"azure.ci",
"azure.cosmosdb",
"azure.mysql",
"azure.postgres",
"azure.sql",
"betterstack",
Expand Down
18 changes: 18 additions & 0 deletions src/rules/db/azure.mysql.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { register } from '../../register.js';

register({
tech: 'azure.mysql',
name: 'Azure MySQL',
type: 'db',
dependencies: [
{
type: 'terraform.resource',
name: /^azurerm_mysql_/,
example: 'azurerm_mysql_database',
},
{ type: 'ruby', name: 'azure_mgmt_mysql' },
{ type: 'rust', name: 'azure_mgmt_mysql' },
{ type: 'npm', name: '@azure/arm-mysql' },
{ type: 'githubAction', name: 'azure/mysql' },
],
});
1 change: 1 addition & 0 deletions src/rules/db/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import './aws.redshift.js';
import './aws.secretsmanager.js';
import './aws.timestream.js';
import './azure.cosmosdb.js';
import './azure.mysql.js';
import './azure.postgres.js';
import './azure.sql.js';
import './clickhouse.js';
Expand Down
3 changes: 2 additions & 1 deletion src/rules/db/mysql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ register({
name: 'Mysql',
type: 'db',
dependencies: [
{ type: 'npm', name: /mysql/, example: 'mysql' },
{ type: 'npm', name: 'mysql' },
{ type: 'npm', name: 'mysql2' },
{ type: 'docker', name: /mysql/, example: 'mysql:0.0.0' },
{ type: 'rust', name: /^mysql/, example: 'mysql_async' },
{ type: 'ruby', name: 'ruby-mysql' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ exports[`docker > should match all dependencies 1`] = `
"aws.lambda",
"aws.s3",
"azure",
"azure.mysql",
"azure.postgres",
"azure.sql",
"cloudflare",
Expand Down Expand Up @@ -239,6 +240,11 @@ exports[`docker > should match all dependencies 2`] = `
"azure/login",
"1",
],
[
"githubAction",
"azure/mysql",
"1",
],
[
"githubAction",
"azure/postgresql",
Expand Down
11 changes: 11 additions & 0 deletions src/rules/spec/nodejs/__snapshots__/component.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ exports[`npm > should match everything 1`] = `
"aws.translate",
"azure",
"azure.cosmosdb",
"azure.mysql",
"azure.postgres",
"azure.sql",
"betterstack",
Expand Down Expand Up @@ -626,6 +627,11 @@ exports[`npm > should match everything 2`] = `
"@azure/arm-cosmosdb",
"0.0.0",
],
[
"npm",
"@azure/arm-mysql",
"0.0.0",
],
[
"npm",
"@azure/arm-postgresql",
Expand Down Expand Up @@ -1441,6 +1447,11 @@ exports[`npm > should match everything 2`] = `
"mysql",
"0.0.0",
],
[
"npm",
"mysql2",
"0.0.0",
],
[
"npm",
"neo4j-driver",
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 @@ -45,6 +45,7 @@ exports[`ruby (component) > should match everything 1`] = `
"aws.translate",
"azure",
"azure.cosmosdb",
"azure.mysql",
"azure.postgres",
"azure.sql",
"betterstack",
Expand Down Expand Up @@ -366,6 +367,11 @@ exports[`ruby (component) > should match everything 2`] = `
"azure_mgmt_cosmosdb",
"1.0.0",
],
[
"ruby",
"azure_mgmt_mysql",
"1.0.0",
],
[
"ruby",
"azure_mgmt_postgresql",
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 @@ -46,6 +46,7 @@ exports[`rust (component) > should match everything 1`] = `
"aws.translate",
"azure",
"azure.cosmosdb",
"azure.mysql",
"azure.postgres",
"azure.sql",
"cloudflare",
Expand Down Expand Up @@ -307,6 +308,11 @@ exports[`rust (component) > should match everything 2`] = `
"azure_mgmt_cosmosdb",
"1.0.0",
],
[
"rust",
"azure_mgmt_mysql",
"1.0.0",
],
[
"rust",
"azure_mgmt_postgresql",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ exports[`terraform (resource) > should match everything 1`] = `
"azure",
"azure.aks",
"azure.cosmosdb",
"azure.mysql",
"azure.postgres",
"azure.sql",
"cloudflare",
Expand Down
1 change: 1 addition & 0 deletions src/types/techs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export type AllowedKeys =
| 'azure.aks'
| 'azure.ci'
| 'azure.cosmosdb'
| 'azure.mysql'
| 'azure.postgres'
| 'azure.sql'
| 'azure'
Expand Down

0 comments on commit c58a520

Please sign in to comment.