From c6a739418003b215b3b3a8e7672b6aded5b81ae2 Mon Sep 17 00:00:00 2001 From: "daniele.cina" Date: Mon, 11 Nov 2024 09:57:06 +0100 Subject: [PATCH 1/7] export: allowed project structure --- packages/console-types/src/constants/index.ts | 6 ++++++ packages/console-types/src/constants/project.ts | 4 ++++ packages/console-types/src/types/template.ts | 7 +++++-- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/packages/console-types/src/constants/index.ts b/packages/console-types/src/constants/index.ts index 5d2cc244..7a072332 100644 --- a/packages/console-types/src/constants/index.ts +++ b/packages/console-types/src/constants/index.ts @@ -31,6 +31,7 @@ import { import { ALLOWED_MONITORING_SYSTEMS, ALLOWED_RUNNER_TOOLS, + ALLOWED_PROJECT_STRUCTURE, DEPLOYMENT_TYPES, DOCKER_IMAGE_NAME_SUGGESTION_TYPES, ENVIRONMENTS_VARIABLES_TYPES, @@ -43,6 +44,8 @@ import { ProjectPipelinesTypes, REPOSITORY_TYPES, VISIBILITY_PROJECT_FIELDS, + KUSTOMIZE_PROJECT_STRUCTURE, + DEFAULT_PROJECT_STRUCTURE, } from './project' import { ARRAY, @@ -181,6 +184,9 @@ const constants = { METHOD_GET: Verbs.METHOD_GET, MLP, ALLOWED_RUNNER_TOOLS, + KUSTOMIZE_PROJECT_STRUCTURE, + DEFAULT_PROJECT_STRUCTURE, + ALLOWED_PROJECT_STRUCTURE, ALLOWED_MONITORING_SYSTEMS, ProjectPipelinesTypes, DASHBOARD_TYPES, diff --git a/packages/console-types/src/constants/project.ts b/packages/console-types/src/constants/project.ts index f526f183..a3c650bb 100644 --- a/packages/console-types/src/constants/project.ts +++ b/packages/console-types/src/constants/project.ts @@ -65,6 +65,10 @@ export const MLP = 'mlp' export const OTHER = 'other' export const ALLOWED_RUNNER_TOOLS = [MLP, OTHER] +export const KUSTOMIZE_PROJECT_STRUCTURE = 'kustomize' +export const DEFAULT_PROJECT_STRUCTURE = 'default' +export const ALLOWED_PROJECT_STRUCTURE = [KUSTOMIZE_PROJECT_STRUCTURE, DEFAULT_PROJECT_STRUCTURE] + export const PROMETHEUS_OPERATOR = 'prometheus-operator' export const ALLOWED_MONITORING_SYSTEMS = [PROMETHEUS_OPERATOR] diff --git a/packages/console-types/src/types/template.ts b/packages/console-types/src/types/template.ts index ba2c6576..588d93a4 100644 --- a/packages/console-types/src/types/template.ts +++ b/packages/console-types/src/types/template.ts @@ -19,7 +19,7 @@ import { FromSchema } from 'json-schema-to-ts' import { dashboard, enabledServicesSchema, strategySchema } from './project' -import { ALLOWED_RUNNER_TOOLS } from '../constants/project' +import { ALLOWED_RUNNER_TOOLS, ALLOWED_PROJECT_STRUCTURE } from '../constants/project' import url from '../commons/url' export const template = { @@ -43,7 +43,10 @@ export const template = { properties: { runnerTool: { type: 'string', enum: ALLOWED_RUNNER_TOOLS }, useMiaPrefixEnvs: { type: 'boolean' }, - projectStructure: { type: 'string' }, + projectStructure: { + type: 'string', + enum: ALLOWED_PROJECT_STRUCTURE, + }, strategy: strategySchema, }, }, From 2a921899e41ac9a70f8b4f91c22aef8e25d220c3 Mon Sep 17 00:00:00 2001 From: "daniele.cina" Date: Mon, 11 Nov 2024 10:01:03 +0100 Subject: [PATCH 2/7] added: changeset --- .changeset/healthy-rivers-rule.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/healthy-rivers-rule.md diff --git a/.changeset/healthy-rivers-rule.md b/.changeset/healthy-rivers-rule.md new file mode 100644 index 00000000..162c834a --- /dev/null +++ b/.changeset/healthy-rivers-rule.md @@ -0,0 +1,5 @@ +--- +"@mia-platform/console-types": patch +--- + +Added: allowed project structure From 9bb2edb5059e95a977fa6b7823ad886a6c0460a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniele=20Cin=C3=A0?= Date: Mon, 11 Nov 2024 11:11:49 +0100 Subject: [PATCH 3/7] Update packages/console-types/src/constants/project.ts Co-authored-by: Luca Maltagliati --- packages/console-types/src/constants/project.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/console-types/src/constants/project.ts b/packages/console-types/src/constants/project.ts index a3c650bb..e84fa94a 100644 --- a/packages/console-types/src/constants/project.ts +++ b/packages/console-types/src/constants/project.ts @@ -67,7 +67,7 @@ export const ALLOWED_RUNNER_TOOLS = [MLP, OTHER] export const KUSTOMIZE_PROJECT_STRUCTURE = 'kustomize' export const DEFAULT_PROJECT_STRUCTURE = 'default' -export const ALLOWED_PROJECT_STRUCTURE = [KUSTOMIZE_PROJECT_STRUCTURE, DEFAULT_PROJECT_STRUCTURE] +export const ALLOWED_PROJECT_STRUCTURES = [KUSTOMIZE_PROJECT_STRUCTURE, DEFAULT_PROJECT_STRUCTURE] export const PROMETHEUS_OPERATOR = 'prometheus-operator' export const ALLOWED_MONITORING_SYSTEMS = [PROMETHEUS_OPERATOR] From 497f57bdec6ac0046a111d84fa4c77351b08ca0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniele=20Cin=C3=A0?= Date: Mon, 11 Nov 2024 11:11:58 +0100 Subject: [PATCH 4/7] Update packages/console-types/src/types/template.ts Co-authored-by: Luca Maltagliati --- packages/console-types/src/types/template.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/console-types/src/types/template.ts b/packages/console-types/src/types/template.ts index 588d93a4..4ccf69db 100644 --- a/packages/console-types/src/types/template.ts +++ b/packages/console-types/src/types/template.ts @@ -19,7 +19,7 @@ import { FromSchema } from 'json-schema-to-ts' import { dashboard, enabledServicesSchema, strategySchema } from './project' -import { ALLOWED_RUNNER_TOOLS, ALLOWED_PROJECT_STRUCTURE } from '../constants/project' +import { ALLOWED_RUNNER_TOOLS, ALLOWED_PROJECT_STRUCTURES } from '../constants/project' import url from '../commons/url' export const template = { From 769d3229b5d60a9ebbde3da66d11135e4411d230 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniele=20Cin=C3=A0?= Date: Mon, 11 Nov 2024 11:12:04 +0100 Subject: [PATCH 5/7] Update packages/console-types/src/types/template.ts Co-authored-by: Luca Maltagliati --- packages/console-types/src/types/template.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/console-types/src/types/template.ts b/packages/console-types/src/types/template.ts index 4ccf69db..cef4bf84 100644 --- a/packages/console-types/src/types/template.ts +++ b/packages/console-types/src/types/template.ts @@ -45,7 +45,7 @@ export const template = { useMiaPrefixEnvs: { type: 'boolean' }, projectStructure: { type: 'string', - enum: ALLOWED_PROJECT_STRUCTURE, + enum: ALLOWED_PROJECT_STRUCTURES, }, strategy: strategySchema, }, From 4ce7b79b201910d8aacc61545c2a53b39e4d30c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniele=20Cin=C3=A0?= Date: Mon, 11 Nov 2024 11:16:49 +0100 Subject: [PATCH 6/7] Update packages/console-types/src/constants/index.ts Co-authored-by: Luca Maltagliati --- packages/console-types/src/constants/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/console-types/src/constants/index.ts b/packages/console-types/src/constants/index.ts index 7a072332..6172d9c7 100644 --- a/packages/console-types/src/constants/index.ts +++ b/packages/console-types/src/constants/index.ts @@ -186,7 +186,7 @@ const constants = { ALLOWED_RUNNER_TOOLS, KUSTOMIZE_PROJECT_STRUCTURE, DEFAULT_PROJECT_STRUCTURE, - ALLOWED_PROJECT_STRUCTURE, + ALLOWED_PROJECT_STRUCTURES, ALLOWED_MONITORING_SYSTEMS, ProjectPipelinesTypes, DASHBOARD_TYPES, From c1257aa06cd19e604fd5d8706aceb5cd0005a438 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniele=20Cin=C3=A0?= Date: Mon, 11 Nov 2024 11:17:16 +0100 Subject: [PATCH 7/7] Update packages/console-types/src/constants/index.ts Co-authored-by: Luca Maltagliati --- packages/console-types/src/constants/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/console-types/src/constants/index.ts b/packages/console-types/src/constants/index.ts index 6172d9c7..33214b99 100644 --- a/packages/console-types/src/constants/index.ts +++ b/packages/console-types/src/constants/index.ts @@ -31,7 +31,7 @@ import { import { ALLOWED_MONITORING_SYSTEMS, ALLOWED_RUNNER_TOOLS, - ALLOWED_PROJECT_STRUCTURE, + ALLOWED_PROJECT_STRUCTURES, DEPLOYMENT_TYPES, DOCKER_IMAGE_NAME_SUGGESTION_TYPES, ENVIRONMENTS_VARIABLES_TYPES,