From 8f3705277c553e0c26c522148f31f65277a18372 Mon Sep 17 00:00:00 2001 From: "demetrio.marino" Date: Thu, 17 Jul 2025 16:39:32 +0200 Subject: [PATCH 1/2] fix: infrastructure component CRD now includes archiveUrl instead of gitInfo, name with validation --- .../infrastructure-component.item.schema.json | 26 +++++-------------- ...rastructure-component.manifest.schema.json | 26 +++++-------------- ...astructure-component.resources.schema.json | 26 +++++-------------- .../infrastructure-component/index.ts | 26 +++++-------------- .../types/project/infrastructure-component.ts | 3 ++- 5 files changed, 30 insertions(+), 77 deletions(-) diff --git a/packages/console-types/schemas/catalog/infrastructure-component.item.schema.json b/packages/console-types/schemas/catalog/infrastructure-component.item.schema.json index a6924845..0bcd7ae9 100644 --- a/packages/console-types/schemas/catalog/infrastructure-component.item.schema.json +++ b/packages/console-types/schemas/catalog/infrastructure-component.item.schema.json @@ -112,21 +112,12 @@ "properties": { "name": { "type": "string", - "description": "The name of the infrastructure component" + "pattern": "^[a-z]([-_a-z0-9]*[a-z0-9])?$", + "description": "Name of the component. Must start with a lowercase letter and can contain lowercase letters, numbers, dashes, and underscores. Must end with a lowercase letter or number." }, - "gitInfo": { - "type": "object", - "description": "Information about the infrastructure component git repository", - "properties": { - "repoUrl": { - "type": "string", - "description": "The HTTPS URL of the git repository containing the infrastructure component" - }, - "sshUrl": { - "type": "string", - "description": "The SSH URL of the git repository containing the infrastructure component" - } - } + "archiveUrl": { + "type": "string", + "description": "The URL of the archive containing the component source code" }, "pipelineInfo": { "type": "object", @@ -221,16 +212,13 @@ }, "required": [ "name", - "gitInfo", + "archiveUrl", "pipelineInfo" ], "examples": [ { "name": "example-infrastructure-component", - "gitInfo": { - "repoUrl": "https://gitlab.com/example/infrastructure-component.git", - "sshUrl": "ssh://gitlab.com/example/infrastructure-component.git" - }, + "archiveUrl": "https://github.com/mia-platform/infrastructure-component/archive/refs/tags/v1.0.0.tar.gz", "pipelineInfo": { "gitlab-ci": { "branch": "main", diff --git a/packages/console-types/schemas/catalog/infrastructure-component.manifest.schema.json b/packages/console-types/schemas/catalog/infrastructure-component.manifest.schema.json index bb91f2fb..dea4236f 100644 --- a/packages/console-types/schemas/catalog/infrastructure-component.manifest.schema.json +++ b/packages/console-types/schemas/catalog/infrastructure-component.manifest.schema.json @@ -84,21 +84,12 @@ "properties": { "name": { "type": "string", - "description": "The name of the infrastructure component" + "pattern": "^[a-z]([-_a-z0-9]*[a-z0-9])?$", + "description": "Name of the component. Must start with a lowercase letter and can contain lowercase letters, numbers, dashes, and underscores. Must end with a lowercase letter or number." }, - "gitInfo": { - "type": "object", - "description": "Information about the infrastructure component git repository", - "properties": { - "repoUrl": { - "type": "string", - "description": "The HTTPS URL of the git repository containing the infrastructure component" - }, - "sshUrl": { - "type": "string", - "description": "The SSH URL of the git repository containing the infrastructure component" - } - } + "archiveUrl": { + "type": "string", + "description": "The URL of the archive containing the component source code" }, "pipelineInfo": { "type": "object", @@ -193,16 +184,13 @@ }, "required": [ "name", - "gitInfo", + "archiveUrl", "pipelineInfo" ], "examples": [ { "name": "example-infrastructure-component", - "gitInfo": { - "repoUrl": "https://gitlab.com/example/infrastructure-component.git", - "sshUrl": "ssh://gitlab.com/example/infrastructure-component.git" - }, + "archiveUrl": "https://github.com/mia-platform/infrastructure-component/archive/refs/tags/v1.0.0.tar.gz", "pipelineInfo": { "gitlab-ci": { "branch": "main", diff --git a/packages/console-types/schemas/catalog/infrastructure-component.resources.schema.json b/packages/console-types/schemas/catalog/infrastructure-component.resources.schema.json index 02aa1c39..288704f1 100644 --- a/packages/console-types/schemas/catalog/infrastructure-component.resources.schema.json +++ b/packages/console-types/schemas/catalog/infrastructure-component.resources.schema.json @@ -8,21 +8,12 @@ "properties": { "name": { "type": "string", - "description": "The name of the infrastructure component" + "pattern": "^[a-z]([-_a-z0-9]*[a-z0-9])?$", + "description": "Name of the component. Must start with a lowercase letter and can contain lowercase letters, numbers, dashes, and underscores. Must end with a lowercase letter or number." }, - "gitInfo": { - "type": "object", - "description": "Information about the infrastructure component git repository", - "properties": { - "repoUrl": { - "type": "string", - "description": "The HTTPS URL of the git repository containing the infrastructure component" - }, - "sshUrl": { - "type": "string", - "description": "The SSH URL of the git repository containing the infrastructure component" - } - } + "archiveUrl": { + "type": "string", + "description": "The URL of the archive containing the component source code" }, "pipelineInfo": { "type": "object", @@ -120,17 +111,14 @@ }, "required": [ "name", - "gitInfo", + "archiveUrl", "pipelineInfo" ], "title": "Catalog infrastructure-component item resources", "examples": [ { "name": "example-infrastructure-component", - "gitInfo": { - "repoUrl": "https://gitlab.com/example/infrastructure-component.git", - "sshUrl": "ssh://gitlab.com/example/infrastructure-component.git" - }, + "archiveUrl": "https://github.com/mia-platform/infrastructure-component/archive/refs/tags/v1.0.0.tar.gz", "pipelineInfo": { "gitlab-ci": { "branch": "main", diff --git a/packages/console-types/src/types/catalog/well-known-items/infrastructure-component/index.ts b/packages/console-types/src/types/catalog/well-known-items/infrastructure-component/index.ts index 71b09dd7..0476e781 100644 --- a/packages/console-types/src/types/catalog/well-known-items/infrastructure-component/index.ts +++ b/packages/console-types/src/types/catalog/well-known-items/infrastructure-component/index.ts @@ -51,21 +51,12 @@ const _resourcesSchema = { properties: { name: { type: 'string', - description: 'The name of the infrastructure component', + pattern: '^[a-z]([-_a-z0-9]*[a-z0-9])?$', + description: 'Name of the component. Must start with a lowercase letter and can contain lowercase letters, numbers, dashes, and underscores. Must end with a lowercase letter or number.', }, - gitInfo: { - type: 'object', - description: 'Information about the infrastructure component git repository', - properties: { - repoUrl: { - type: 'string', - description: 'The HTTPS URL of the git repository containing the infrastructure component', - }, - sshUrl: { - type: 'string', - description: 'The SSH URL of the git repository containing the infrastructure component', - }, - }, + archiveUrl: { + type: 'string', + description: 'The URL of the archive containing the component source code', }, pipelineInfo: { type: 'object', @@ -95,7 +86,7 @@ const _resourcesSchema = { }, }, }, - required: ['name', 'gitInfo', 'pipelineInfo'], + required: ['name', 'archiveUrl', 'pipelineInfo'], title: 'Catalog Infrastructure Component Resources', } as const satisfies JSONSchema @@ -104,10 +95,7 @@ export type Resources = FromSchema const resourcesExamples: Resources[] = [ { name: 'example-infrastructure-component', - gitInfo: { - repoUrl: 'https://gitlab.com/example/infrastructure-component.git', - sshUrl: 'ssh://gitlab.com/example/infrastructure-component.git', - }, + archiveUrl: 'https://github.com/mia-platform/infrastructure-component/archive/refs/tags/v1.0.0.tar.gz', pipelineInfo: { 'gitlab-ci': { branch: 'main', diff --git a/packages/console-types/src/types/project/infrastructure-component.ts b/packages/console-types/src/types/project/infrastructure-component.ts index cdb72a21..7ba8dacb 100644 --- a/packages/console-types/src/types/project/infrastructure-component.ts +++ b/packages/console-types/src/types/project/infrastructure-component.ts @@ -25,7 +25,8 @@ export const infrastructureComponent = { properties: { name: { type: 'string', - description: 'component name', + pattern: '^[a-z]([-_a-z0-9]*[a-z0-9])?$', + description: 'Name of the component. Must start with a lowercase letter and can contain lowercase letters, numbers, dashes, and underscores. Must end with a lowercase letter or number.', }, tags: { type: 'array', From 09084888bcccf72b99607f1155529a4b4cc2ecf7 Mon Sep 17 00:00:00 2001 From: "demetrio.marino" Date: Thu, 17 Jul 2025 16:40:06 +0200 Subject: [PATCH 2/2] chore: changeset --- .changeset/lemon-eels-cry.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/lemon-eels-cry.md diff --git a/.changeset/lemon-eels-cry.md b/.changeset/lemon-eels-cry.md new file mode 100644 index 00000000..b3803f84 --- /dev/null +++ b/.changeset/lemon-eels-cry.md @@ -0,0 +1,5 @@ +--- +"@mia-platform/console-types": patch +--- + +fix: infrastructure component CRD now includes archiveUrl instead of gitInfo, name with validation