From 1f1744fedf7ae839f84a772c51c47d334746fe46 Mon Sep 17 00:00:00 2001 From: Augustin Date: Mon, 13 May 2024 19:42:01 +0200 Subject: [PATCH] metadata-service: add `connectorTestSuitesOptions` (#38116) --- .../ConnectorMetadataDefinitionV0.py | 26 ++++++++++++++ .../generated/ConnectorTestSuiteOptions.py | 34 +++++++++++++++++++ .../models/generated/Secret.py | 26 ++++++++++++++ .../models/generated/SecretStore.py | 17 ++++++++++ .../models/generated/__init__.py | 3 ++ .../src/ConnectorMetadataDefinitionV0.yaml | 4 +++ .../models/src/ConnectorTestSuiteOptions.yaml | 22 ++++++++++++ .../metadata_service/models/src/Secret.yaml | 19 +++++++++++ .../models/src/SecretStore.yaml | 19 +++++++++++ .../metadata_service/lib/pyproject.toml | 2 +- 10 files changed, 171 insertions(+), 1 deletion(-) create mode 100644 airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/ConnectorTestSuiteOptions.py create mode 100644 airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/Secret.py create mode 100644 airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/SecretStore.py create mode 100644 airbyte-ci/connectors/metadata_service/lib/metadata_service/models/src/ConnectorTestSuiteOptions.yaml create mode 100644 airbyte-ci/connectors/metadata_service/lib/metadata_service/models/src/Secret.yaml create mode 100644 airbyte-ci/connectors/metadata_service/lib/metadata_service/models/src/SecretStore.yaml diff --git a/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/ConnectorMetadataDefinitionV0.py b/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/ConnectorMetadataDefinitionV0.py index 1a3a5000c076..400064109519 100644 --- a/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/ConnectorMetadataDefinitionV0.py +++ b/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/ConnectorMetadataDefinitionV0.py @@ -18,6 +18,14 @@ class Config: baseImage: Optional[str] = None +class SecretStore(BaseModel): + class Config: + extra = Extra.forbid + + alias: Optional[str] = Field(None, description="The alias of the secret store which can map to its actual secret address") + type: Optional[Literal["GSM"]] = Field(None, description="The type of the secret store") + + class ReleaseStage(BaseModel): __root__: Literal["alpha", "beta", "generally_available", "custom"] = Field( ..., description="enum that describes a connector's release stage", title="ReleaseStage" @@ -122,6 +130,15 @@ class SourceFileInfo(BaseModel): registry_entry_generated_at: Optional[str] = None +class Secret(BaseModel): + class Config: + extra = Extra.forbid + + name: str = Field(..., description="The secret name in the secret store") + fileName: Optional[str] = Field(None, description="The name of the file to which the secret value would be persisted") + secretStore: SecretStore + + class JobTypeResourceLimit(BaseModel): class Config: extra = Extra.forbid @@ -146,6 +163,14 @@ class GeneratedFields(BaseModel): source_file_info: Optional[SourceFileInfo] = None +class ConnectorTestSuiteOptions(BaseModel): + class Config: + extra = Extra.forbid + + suite: Literal["unitTests", "integrationTests", "acceptanceTests"] = Field(..., description="Name of the configured test suite") + testSecrets: Optional[List[Secret]] = Field(None, description="List of secrets required to run the test suite") + + class ActorDefinitionResourceRequirements(BaseModel): class Config: extra = Extra.forbid @@ -228,6 +253,7 @@ class Config: icon: Optional[str] = None definitionId: UUID connectorBuildOptions: Optional[ConnectorBuildOptions] = None + connectorTestSuitesOptions: Optional[List[ConnectorTestSuiteOptions]] = None connectorType: Literal["destination", "source"] dockerRepository: str dockerImageTag: str diff --git a/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/ConnectorTestSuiteOptions.py b/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/ConnectorTestSuiteOptions.py new file mode 100644 index 000000000000..6f15be16543e --- /dev/null +++ b/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/ConnectorTestSuiteOptions.py @@ -0,0 +1,34 @@ +# generated by datamodel-codegen: +# filename: ConnectorTestSuiteOptions.yaml + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import BaseModel, Extra, Field +from typing_extensions import Literal + + +class SecretStore(BaseModel): + class Config: + extra = Extra.forbid + + alias: Optional[str] = Field(None, description="The alias of the secret store which can map to its actual secret address") + type: Optional[Literal["GSM"]] = Field(None, description="The type of the secret store") + + +class Secret(BaseModel): + class Config: + extra = Extra.forbid + + name: str = Field(..., description="The secret name in the secret store") + fileName: Optional[str] = Field(None, description="The name of the file to which the secret value would be persisted") + secretStore: SecretStore + + +class ConnectorTestSuiteOptions(BaseModel): + class Config: + extra = Extra.forbid + + suite: Literal["unitTests", "integrationTests", "acceptanceTests"] = Field(..., description="Name of the configured test suite") + testSecrets: Optional[List[Secret]] = Field(None, description="List of secrets required to run the test suite") diff --git a/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/Secret.py b/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/Secret.py new file mode 100644 index 000000000000..2a2db6a32c4e --- /dev/null +++ b/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/Secret.py @@ -0,0 +1,26 @@ +# generated by datamodel-codegen: +# filename: Secret.yaml + +from __future__ import annotations + +from typing import Optional + +from pydantic import BaseModel, Extra, Field +from typing_extensions import Literal + + +class SecretStore(BaseModel): + class Config: + extra = Extra.forbid + + alias: Optional[str] = Field(None, description="The alias of the secret store which can map to its actual secret address") + type: Optional[Literal["GSM"]] = Field(None, description="The type of the secret store") + + +class Secret(BaseModel): + class Config: + extra = Extra.forbid + + name: str = Field(..., description="The secret name in the secret store") + fileName: Optional[str] = Field(None, description="The name of the file to which the secret value would be persisted") + secretStore: SecretStore diff --git a/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/SecretStore.py b/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/SecretStore.py new file mode 100644 index 000000000000..6901d3a81d6f --- /dev/null +++ b/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/SecretStore.py @@ -0,0 +1,17 @@ +# generated by datamodel-codegen: +# filename: SecretStore.yaml + +from __future__ import annotations + +from typing import Optional + +from pydantic import BaseModel, Extra, Field +from typing_extensions import Literal + + +class SecretStore(BaseModel): + class Config: + extra = Extra.forbid + + alias: Optional[str] = Field(None, description="The alias of the secret store which can map to its actual secret address") + type: Optional[Literal["GSM"]] = Field(None, description="The type of the secret store") diff --git a/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/__init__.py b/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/__init__.py index 864a8b53ed2e..c325e9a0d2d6 100644 --- a/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/__init__.py +++ b/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/__init__.py @@ -9,6 +9,7 @@ from .ConnectorRegistrySourceDefinition import * from .ConnectorRegistryV0 import * from .ConnectorReleases import * +from .ConnectorTestSuiteOptions import * from .GeneratedFields import * from .GitInfo import * from .JobType import * @@ -17,6 +18,8 @@ from .ReleaseStage import * from .RemoteRegistries import * from .ResourceRequirements import * +from .Secret import * +from .SecretStore import * from .SourceFileInfo import * from .SuggestedStreams import * from .SupportLevel import * diff --git a/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/src/ConnectorMetadataDefinitionV0.yaml b/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/src/ConnectorMetadataDefinitionV0.yaml index 7932d92996c8..5897de04b025 100644 --- a/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/src/ConnectorMetadataDefinitionV0.yaml +++ b/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/src/ConnectorMetadataDefinitionV0.yaml @@ -36,6 +36,10 @@ properties: format: uuid connectorBuildOptions: "$ref": ConnectorBuildOptions.yaml + connectorTestSuitesOptions: + type: array + items: + "$ref": ConnectorTestSuiteOptions.yaml connectorType: type: string enum: diff --git a/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/src/ConnectorTestSuiteOptions.yaml b/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/src/ConnectorTestSuiteOptions.yaml new file mode 100644 index 000000000000..e7b81ceca8d2 --- /dev/null +++ b/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/src/ConnectorTestSuiteOptions.yaml @@ -0,0 +1,22 @@ +--- +"$schema": http://json-schema.org/draft-07/schema# +"$id": https://github.com/airbytehq/airbyte/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/src/ConnectorTestOptions.yaml +title: ConnectorTestSuiteOptions +description: Options for a specific connector test suite. +type: object +required: + - suite +additionalProperties: false +properties: + suite: + description: "Name of the configured test suite" + type: string + enum: + - "unitTests" + - "integrationTests" + - "acceptanceTests" + testSecrets: + description: "List of secrets required to run the test suite" + type: array + items: + "$ref": "Secret.yaml" diff --git a/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/src/Secret.yaml b/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/src/Secret.yaml new file mode 100644 index 000000000000..57b4bc6c1a95 --- /dev/null +++ b/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/src/Secret.yaml @@ -0,0 +1,19 @@ +--- +"$schema": http://json-schema.org/draft-07/schema# +"$id": https://github.com/airbytehq/airbyte/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/src/TestSecret.yaml +title: Secret +description: An object describing a secret's metadata +type: object +required: + - name + - secretStore +additionalProperties: false +properties: + name: + type: string + description: "The secret name in the secret store" + fileName: + type: string + description: "The name of the file to which the secret value would be persisted" + secretStore: + "$ref": SecretStore.yaml diff --git a/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/src/SecretStore.yaml b/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/src/SecretStore.yaml new file mode 100644 index 000000000000..578888b52ef8 --- /dev/null +++ b/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/src/SecretStore.yaml @@ -0,0 +1,19 @@ +--- +"$schema": http://json-schema.org/draft-07/schema# +"$id": https://github.com/airbytehq/airbyte/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/src/TestSecret.yaml +title: SecretStore +description: An object describing a secret store metadata +type: object +required: + - name + - secretStore +additionalProperties: false +properties: + alias: + type: string + description: "The alias of the secret store which can map to its actual secret address" + type: + type: string + description: "The type of the secret store" + enum: + - "GSM" diff --git a/airbyte-ci/connectors/metadata_service/lib/pyproject.toml b/airbyte-ci/connectors/metadata_service/lib/pyproject.toml index 0f2c1370f91b..a7123d3af472 100644 --- a/airbyte-ci/connectors/metadata_service/lib/pyproject.toml +++ b/airbyte-ci/connectors/metadata_service/lib/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "metadata-service" -version = "0.6.0" +version = "0.7.0" description = "" authors = ["Ben Church "] readme = "README.md"