Skip to content

Commit

Permalink
metadata-service[orchestrator]: generate connector registry with rele…
Browse files Browse the repository at this point in the history
…ase candidates� (#44588)
  • Loading branch information
alafanechere authored Sep 4, 2024
1 parent 75cee33 commit ee698d6
Show file tree
Hide file tree
Showing 25 changed files with 1,013 additions and 228 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# generated by datamodel-codegen:
# filename: ConnectorBreakingChanges.yaml

from __future__ import annotations

from datetime import date
from typing import Any, Dict, List, Optional

from pydantic import AnyUrl, BaseModel, Extra, Field, constr


class StreamBreakingChangeScope(BaseModel):
class Config:
extra = Extra.forbid

scopeType: Any = Field("stream", const=True)
impactedScopes: List[str] = Field(..., description="List of streams that are impacted by the breaking change.", min_items=1)


class BreakingChangeScope(BaseModel):
__root__: StreamBreakingChangeScope = Field(..., description="A scope that can be used to limit the impact of a breaking change.")


class VersionBreakingChange(BaseModel):
class Config:
extra = Extra.forbid

upgradeDeadline: date = Field(..., description="The deadline by which to upgrade before the breaking change takes effect.")
message: str = Field(..., description="Descriptive message detailing the breaking change.")
migrationDocumentationUrl: Optional[AnyUrl] = Field(
None,
description="URL to documentation on how to migrate to the current version. Defaults to ${documentationUrl}-migrations#${version}",
)
scopedImpact: Optional[List[BreakingChangeScope]] = Field(
None,
description="List of scopes that are impacted by the breaking change. If not specified, the breaking change cannot be scoped to reduce impact via the supported scope types.",
min_items=1,
)


class ConnectorBreakingChanges(BaseModel):
class Config:
extra = Extra.forbid

__root__: Dict[constr(regex=r"^\d+\.\d+\.\d+$"), VersionBreakingChange] = Field(
...,
description="Each entry denotes a breaking change in a specific version of a connector that requires user action to upgrade.",
title="ConnectorBreakingChanges",
)
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,9 @@ class Config:
extra = Extra.forbid

__root__: Dict[constr(regex=r"^\d+\.\d+\.\d+$"), VersionBreakingChange] = Field(
..., description="Each entry denotes a breaking change in a specific version of a connector that requires user action to upgrade."
...,
description="Each entry denotes a breaking change in a specific version of a connector that requires user action to upgrade.",
title="ConnectorBreakingChanges",
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,16 @@ class Config:
impactedScopes: List[str] = Field(..., description="List of streams that are impacted by the breaking change.", min_items=1)


class SuggestedStreams(BaseModel):
class Config:
extra = Extra.allow

streams: Optional[List[str]] = Field(
None,
description="An array of streams that this connector suggests the average user will want. SuggestedStreams not being present for the source means that all streams are suggested. An empty list here means that no streams are suggested.",
)


class AirbyteInternal(BaseModel):
class Config:
extra = Extra.allow
Expand Down Expand Up @@ -182,20 +192,9 @@ class Config:
extra = Extra.forbid

__root__: Dict[constr(regex=r"^\d+\.\d+\.\d+$"), VersionBreakingChange] = Field(
..., description="Each entry denotes a breaking change in a specific version of a connector that requires user action to upgrade."
)


class ConnectorReleases(BaseModel):
class Config:
extra = Extra.forbid

isReleaseCandidate: Optional[bool] = Field(False, description="Whether the release is eligible to be a release candidate.")
rolloutConfiguration: Optional[RolloutConfiguration] = None
breakingChanges: ConnectorBreakingChanges
migrationDocumentationUrl: Optional[AnyUrl] = Field(
None,
description="URL to documentation on how to migrate from the previous version to the current version. Defaults to ${documentationUrl}-migrations",
...,
description="Each entry denotes a breaking change in a specific version of a connector that requires user action to upgrade.",
title="ConnectorBreakingChanges",
)


Expand Down Expand Up @@ -230,11 +229,82 @@ class Config:
description="an optional flag indicating whether DBT is used in the normalization. If the flag value is NULL - DBT is not used.",
)
allowedHosts: Optional[AllowedHosts] = None
releases: Optional[ConnectorReleases] = None
releases: Optional[ConnectorRegistryReleases] = None
ab_internal: Optional[AirbyteInternal] = None
supportsRefreshes: Optional[bool] = False
generated: Optional[GeneratedFields] = None
packageInfo: Optional[ConnectorPackageInfo] = None
language: Optional[str] = Field(
None, description="The language the connector is written in"
language: Optional[str] = Field(None, description="The language the connector is written in")


class ConnectorRegistryReleases(BaseModel):
class Config:
extra = Extra.forbid

releaseCandidates: Optional[ConnectorReleaseCandidates] = None
rolloutConfiguration: Optional[RolloutConfiguration] = None
breakingChanges: Optional[ConnectorBreakingChanges] = None
migrationDocumentationUrl: Optional[AnyUrl] = Field(
None,
description="URL to documentation on how to migrate from the previous version to the current version. Defaults to ${documentationUrl}-migrations",
)


class ConnectorReleaseCandidates(BaseModel):
class Config:
extra = Extra.forbid

__root__: Dict[constr(regex=r"^\d+\.\d+\.\d+$"), VersionReleaseCandidate] = Field(
..., description="Each entry denotes a release candidate version of a connector."
)


class VersionReleaseCandidate(BaseModel):
class Config:
extra = Extra.forbid

__root__: Union[ConnectorRegistrySourceDefinition, ConnectorRegistryDestinationDefinition] = Field(
..., description="Contains information about a release candidate version of a connector."
)


class ConnectorRegistrySourceDefinition(BaseModel):
class Config:
extra = Extra.allow

sourceDefinitionId: UUID
name: str
dockerRepository: str
dockerImageTag: str
documentationUrl: str
icon: Optional[str] = None
iconUrl: Optional[str] = None
sourceType: Optional[Literal["api", "file", "database", "custom"]] = None
spec: Dict[str, Any]
tombstone: Optional[bool] = Field(
False, description="if false, the configuration is active. if true, then this configuration is permanently off."
)
public: Optional[bool] = Field(False, description="true if this connector definition is available to all workspaces")
custom: Optional[bool] = Field(False, description="whether this is a custom connector definition")
releaseStage: Optional[ReleaseStage] = None
supportLevel: Optional[SupportLevel] = None
releaseDate: Optional[date] = Field(None, description="The date when this connector was first released, in yyyy-mm-dd format.")
resourceRequirements: Optional[ActorDefinitionResourceRequirements] = None
protocolVersion: Optional[str] = Field(None, description="the Airbyte Protocol version supported by the connector")
allowedHosts: Optional[AllowedHosts] = None
suggestedStreams: Optional[SuggestedStreams] = None
maxSecondsBetweenMessages: Optional[int] = Field(
None, description="Number of seconds allowed between 2 airbyte protocol messages. The source will timeout if this delay is reach"
)
erdUrl: Optional[str] = Field(None, description="The URL where you can visualize the ERD")
releases: Optional[ConnectorRegistryReleases] = None
ab_internal: Optional[AirbyteInternal] = None
generated: Optional[GeneratedFields] = None
packageInfo: Optional[ConnectorPackageInfo] = None
language: Optional[str] = Field(None, description="The language the connector is written in")


ConnectorRegistryDestinationDefinition.update_forward_refs()
ConnectorRegistryReleases.update_forward_refs()
ConnectorReleaseCandidates.update_forward_refs()
VersionReleaseCandidate.update_forward_refs()
Loading

0 comments on commit ee698d6

Please sign in to comment.