Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

export: allowed project structure #313

Merged
merged 7 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/healthy-rivers-rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@mia-platform/console-types": patch
---

Added: allowed project structure
6 changes: 6 additions & 0 deletions packages/console-types/src/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {
import {
ALLOWED_MONITORING_SYSTEMS,
ALLOWED_RUNNER_TOOLS,
ALLOWED_PROJECT_STRUCTURES,
DEPLOYMENT_TYPES,
DOCKER_IMAGE_NAME_SUGGESTION_TYPES,
ENVIRONMENTS_VARIABLES_TYPES,
Expand All @@ -43,6 +44,8 @@ import {
ProjectPipelinesTypes,
REPOSITORY_TYPES,
VISIBILITY_PROJECT_FIELDS,
KUSTOMIZE_PROJECT_STRUCTURE,
DEFAULT_PROJECT_STRUCTURE,
} from './project'
import {
ARRAY,
Expand Down Expand Up @@ -181,6 +184,9 @@ const constants = {
METHOD_GET: Verbs.METHOD_GET,
MLP,
ALLOWED_RUNNER_TOOLS,
KUSTOMIZE_PROJECT_STRUCTURE,
DEFAULT_PROJECT_STRUCTURE,
ALLOWED_PROJECT_STRUCTURES,
ALLOWED_MONITORING_SYSTEMS,
ProjectPipelinesTypes,
DASHBOARD_TYPES,
Expand Down
4 changes: 4 additions & 0 deletions packages/console-types/src/constants/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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_STRUCTURES = [KUSTOMIZE_PROJECT_STRUCTURE, DEFAULT_PROJECT_STRUCTURE]

export const PROMETHEUS_OPERATOR = 'prometheus-operator'
export const ALLOWED_MONITORING_SYSTEMS = [PROMETHEUS_OPERATOR]

Expand Down
7 changes: 5 additions & 2 deletions packages/console-types/src/types/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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_STRUCTURES } from '../constants/project'
import url from '../commons/url'

export const template = {
Expand All @@ -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_STRUCTURES,
},
strategy: strategySchema,
},
},
Expand Down
Loading