Skip to content

Commit ee698d6

Browse files
authored
metadata-service[orchestrator]: generate connector registry with release candidates� (#44588)
1 parent 75cee33 commit ee698d6

25 files changed

+1013
-228
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# generated by datamodel-codegen:
2+
# filename: ConnectorBreakingChanges.yaml
3+
4+
from __future__ import annotations
5+
6+
from datetime import date
7+
from typing import Any, Dict, List, Optional
8+
9+
from pydantic import AnyUrl, BaseModel, Extra, Field, constr
10+
11+
12+
class StreamBreakingChangeScope(BaseModel):
13+
class Config:
14+
extra = Extra.forbid
15+
16+
scopeType: Any = Field("stream", const=True)
17+
impactedScopes: List[str] = Field(..., description="List of streams that are impacted by the breaking change.", min_items=1)
18+
19+
20+
class BreakingChangeScope(BaseModel):
21+
__root__: StreamBreakingChangeScope = Field(..., description="A scope that can be used to limit the impact of a breaking change.")
22+
23+
24+
class VersionBreakingChange(BaseModel):
25+
class Config:
26+
extra = Extra.forbid
27+
28+
upgradeDeadline: date = Field(..., description="The deadline by which to upgrade before the breaking change takes effect.")
29+
message: str = Field(..., description="Descriptive message detailing the breaking change.")
30+
migrationDocumentationUrl: Optional[AnyUrl] = Field(
31+
None,
32+
description="URL to documentation on how to migrate to the current version. Defaults to ${documentationUrl}-migrations#${version}",
33+
)
34+
scopedImpact: Optional[List[BreakingChangeScope]] = Field(
35+
None,
36+
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.",
37+
min_items=1,
38+
)
39+
40+
41+
class ConnectorBreakingChanges(BaseModel):
42+
class Config:
43+
extra = Extra.forbid
44+
45+
__root__: Dict[constr(regex=r"^\d+\.\d+\.\d+$"), VersionBreakingChange] = Field(
46+
...,
47+
description="Each entry denotes a breaking change in a specific version of a connector that requires user action to upgrade.",
48+
title="ConnectorBreakingChanges",
49+
)

airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/ConnectorMetadataDefinitionV0.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,9 @@ class Config:
267267
extra = Extra.forbid
268268

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

273275

airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/ConnectorRegistryDestinationDefinition.py

+87-17
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,16 @@ class Config:
8686
impactedScopes: List[str] = Field(..., description="List of streams that are impacted by the breaking change.", min_items=1)
8787

8888

89+
class SuggestedStreams(BaseModel):
90+
class Config:
91+
extra = Extra.allow
92+
93+
streams: Optional[List[str]] = Field(
94+
None,
95+
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.",
96+
)
97+
98+
8999
class AirbyteInternal(BaseModel):
90100
class Config:
91101
extra = Extra.allow
@@ -182,20 +192,9 @@ class Config:
182192
extra = Extra.forbid
183193

184194
__root__: Dict[constr(regex=r"^\d+\.\d+\.\d+$"), VersionBreakingChange] = Field(
185-
..., description="Each entry denotes a breaking change in a specific version of a connector that requires user action to upgrade."
186-
)
187-
188-
189-
class ConnectorReleases(BaseModel):
190-
class Config:
191-
extra = Extra.forbid
192-
193-
isReleaseCandidate: Optional[bool] = Field(False, description="Whether the release is eligible to be a release candidate.")
194-
rolloutConfiguration: Optional[RolloutConfiguration] = None
195-
breakingChanges: ConnectorBreakingChanges
196-
migrationDocumentationUrl: Optional[AnyUrl] = Field(
197-
None,
198-
description="URL to documentation on how to migrate from the previous version to the current version. Defaults to ${documentationUrl}-migrations",
195+
...,
196+
description="Each entry denotes a breaking change in a specific version of a connector that requires user action to upgrade.",
197+
title="ConnectorBreakingChanges",
199198
)
200199

201200

@@ -230,11 +229,82 @@ class Config:
230229
description="an optional flag indicating whether DBT is used in the normalization. If the flag value is NULL - DBT is not used.",
231230
)
232231
allowedHosts: Optional[AllowedHosts] = None
233-
releases: Optional[ConnectorReleases] = None
232+
releases: Optional[ConnectorRegistryReleases] = None
234233
ab_internal: Optional[AirbyteInternal] = None
235234
supportsRefreshes: Optional[bool] = False
236235
generated: Optional[GeneratedFields] = None
237236
packageInfo: Optional[ConnectorPackageInfo] = None
238-
language: Optional[str] = Field(
239-
None, description="The language the connector is written in"
237+
language: Optional[str] = Field(None, description="The language the connector is written in")
238+
239+
240+
class ConnectorRegistryReleases(BaseModel):
241+
class Config:
242+
extra = Extra.forbid
243+
244+
releaseCandidates: Optional[ConnectorReleaseCandidates] = None
245+
rolloutConfiguration: Optional[RolloutConfiguration] = None
246+
breakingChanges: Optional[ConnectorBreakingChanges] = None
247+
migrationDocumentationUrl: Optional[AnyUrl] = Field(
248+
None,
249+
description="URL to documentation on how to migrate from the previous version to the current version. Defaults to ${documentationUrl}-migrations",
250+
)
251+
252+
253+
class ConnectorReleaseCandidates(BaseModel):
254+
class Config:
255+
extra = Extra.forbid
256+
257+
__root__: Dict[constr(regex=r"^\d+\.\d+\.\d+$"), VersionReleaseCandidate] = Field(
258+
..., description="Each entry denotes a release candidate version of a connector."
259+
)
260+
261+
262+
class VersionReleaseCandidate(BaseModel):
263+
class Config:
264+
extra = Extra.forbid
265+
266+
__root__: Union[ConnectorRegistrySourceDefinition, ConnectorRegistryDestinationDefinition] = Field(
267+
..., description="Contains information about a release candidate version of a connector."
268+
)
269+
270+
271+
class ConnectorRegistrySourceDefinition(BaseModel):
272+
class Config:
273+
extra = Extra.allow
274+
275+
sourceDefinitionId: UUID
276+
name: str
277+
dockerRepository: str
278+
dockerImageTag: str
279+
documentationUrl: str
280+
icon: Optional[str] = None
281+
iconUrl: Optional[str] = None
282+
sourceType: Optional[Literal["api", "file", "database", "custom"]] = None
283+
spec: Dict[str, Any]
284+
tombstone: Optional[bool] = Field(
285+
False, description="if false, the configuration is active. if true, then this configuration is permanently off."
240286
)
287+
public: Optional[bool] = Field(False, description="true if this connector definition is available to all workspaces")
288+
custom: Optional[bool] = Field(False, description="whether this is a custom connector definition")
289+
releaseStage: Optional[ReleaseStage] = None
290+
supportLevel: Optional[SupportLevel] = None
291+
releaseDate: Optional[date] = Field(None, description="The date when this connector was first released, in yyyy-mm-dd format.")
292+
resourceRequirements: Optional[ActorDefinitionResourceRequirements] = None
293+
protocolVersion: Optional[str] = Field(None, description="the Airbyte Protocol version supported by the connector")
294+
allowedHosts: Optional[AllowedHosts] = None
295+
suggestedStreams: Optional[SuggestedStreams] = None
296+
maxSecondsBetweenMessages: Optional[int] = Field(
297+
None, description="Number of seconds allowed between 2 airbyte protocol messages. The source will timeout if this delay is reach"
298+
)
299+
erdUrl: Optional[str] = Field(None, description="The URL where you can visualize the ERD")
300+
releases: Optional[ConnectorRegistryReleases] = None
301+
ab_internal: Optional[AirbyteInternal] = None
302+
generated: Optional[GeneratedFields] = None
303+
packageInfo: Optional[ConnectorPackageInfo] = None
304+
language: Optional[str] = Field(None, description="The language the connector is written in")
305+
306+
307+
ConnectorRegistryDestinationDefinition.update_forward_refs()
308+
ConnectorRegistryReleases.update_forward_refs()
309+
ConnectorReleaseCandidates.update_forward_refs()
310+
VersionReleaseCandidate.update_forward_refs()

0 commit comments

Comments
 (0)