Skip to content

Commit

Permalink
metadata-service: add connectorTestSuitesOptions (#38116)
Browse files Browse the repository at this point in the history
  • Loading branch information
alafanechere committed May 13, 2024
1 parent c03d1d6 commit 1f1744f
Show file tree
Hide file tree
Showing 10 changed files with 171 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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")
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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")
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
Expand All @@ -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 *
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ properties:
format: uuid
connectorBuildOptions:
"$ref": ConnectorBuildOptions.yaml
connectorTestSuitesOptions:
type: array
items:
"$ref": ConnectorTestSuiteOptions.yaml
connectorType:
type: string
enum:
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 1 addition & 1 deletion airbyte-ci/connectors/metadata_service/lib/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "metadata-service"
version = "0.6.0"
version = "0.7.0"
description = ""
authors = ["Ben Church <ben@airbyte.io>"]
readme = "README.md"
Expand Down

0 comments on commit 1f1744f

Please sign in to comment.