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 208c52826f97..05c366aed62e 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 @@ -7,7 +7,7 @@ from typing import Any, Dict, List, Optional, Union from uuid import UUID -from pydantic import AnyUrl, BaseModel, Extra, Field, constr +from pydantic import AnyUrl, BaseModel, Extra, Field, conint, constr from typing_extensions import Literal @@ -96,6 +96,21 @@ class JobType(BaseModel): ) +class RolloutConfiguration(BaseModel): + class Config: + extra = Extra.forbid + + initialPercentage: Optional[conint(ge=0, le=100)] = Field( + 0, description="The percentage of users that should receive the new version initially." + ) + maxPercentage: Optional[conint(ge=0, le=100)] = Field( + 50, description="The percentage of users who should receive the release candidate during the test phase before full rollout." + ) + advanceDelayMinutes: Optional[conint(ge=10)] = Field( + 10, description="The number of minutes to wait before advancing the rollout percentage." + ) + + class StreamBreakingChangeScope(BaseModel): class Config: extra = Extra.forbid @@ -268,6 +283,8 @@ 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, diff --git a/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/ConnectorRegistryDestinationDefinition.py b/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/ConnectorRegistryDestinationDefinition.py index 523d04084aaa..d9efadcade19 100644 --- a/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/ConnectorRegistryDestinationDefinition.py +++ b/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/ConnectorRegistryDestinationDefinition.py @@ -7,7 +7,7 @@ from typing import Any, Dict, List, Optional, Union from uuid import UUID -from pydantic import AnyUrl, BaseModel, Extra, Field, constr +from pydantic import AnyUrl, BaseModel, Extra, Field, conint, constr from typing_extensions import Literal @@ -63,6 +63,21 @@ class Config: ) +class RolloutConfiguration(BaseModel): + class Config: + extra = Extra.forbid + + initialPercentage: Optional[conint(ge=0, le=100)] = Field( + 0, description="The percentage of users that should receive the new version initially." + ) + maxPercentage: Optional[conint(ge=0, le=100)] = Field( + 50, description="The percentage of users who should receive the release candidate during the test phase before full rollout." + ) + advanceDelayMinutes: Optional[conint(ge=10)] = Field( + 10, description="The number of minutes to wait before advancing the rollout percentage." + ) + + class StreamBreakingChangeScope(BaseModel): class Config: extra = Extra.forbid @@ -175,6 +190,8 @@ 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, diff --git a/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/ConnectorRegistrySourceDefinition.py b/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/ConnectorRegistrySourceDefinition.py index 57d958bd363a..22c89a0b0f9d 100644 --- a/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/ConnectorRegistrySourceDefinition.py +++ b/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/ConnectorRegistrySourceDefinition.py @@ -7,7 +7,7 @@ from typing import Any, Dict, List, Optional, Union from uuid import UUID -from pydantic import AnyUrl, BaseModel, Extra, Field, constr +from pydantic import AnyUrl, BaseModel, Extra, Field, conint, constr from typing_extensions import Literal @@ -59,6 +59,21 @@ class Config: ) +class RolloutConfiguration(BaseModel): + class Config: + extra = Extra.forbid + + initialPercentage: Optional[conint(ge=0, le=100)] = Field( + 0, description="The percentage of users that should receive the new version initially." + ) + maxPercentage: Optional[conint(ge=0, le=100)] = Field( + 50, description="The percentage of users who should receive the release candidate during the test phase before full rollout." + ) + advanceDelayMinutes: Optional[conint(ge=10)] = Field( + 10, description="The number of minutes to wait before advancing the rollout percentage." + ) + + class StreamBreakingChangeScope(BaseModel): class Config: extra = Extra.forbid @@ -171,6 +186,8 @@ 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, diff --git a/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/ConnectorRegistryV0.py b/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/ConnectorRegistryV0.py index 4bfcb4cf0e88..d04ab57be523 100644 --- a/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/ConnectorRegistryV0.py +++ b/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/ConnectorRegistryV0.py @@ -7,7 +7,7 @@ from typing import Any, Dict, List, Optional, Union from uuid import UUID -from pydantic import AnyUrl, BaseModel, Extra, Field, constr +from pydantic import AnyUrl, BaseModel, Extra, Field, conint, constr from typing_extensions import Literal @@ -63,6 +63,21 @@ class Config: ) +class RolloutConfiguration(BaseModel): + class Config: + extra = Extra.forbid + + initialPercentage: Optional[conint(ge=0, le=100)] = Field( + 0, description="The percentage of users that should receive the new version initially." + ) + maxPercentage: Optional[conint(ge=0, le=100)] = Field( + 50, description="The percentage of users who should receive the release candidate during the test phase before full rollout." + ) + advanceDelayMinutes: Optional[conint(ge=10)] = Field( + 10, description="The number of minutes to wait before advancing the rollout percentage." + ) + + class StreamBreakingChangeScope(BaseModel): class Config: extra = Extra.forbid @@ -185,6 +200,8 @@ 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, diff --git a/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/ConnectorReleases.py b/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/ConnectorReleases.py index 6a7d2ea915f2..4e33fa7f6358 100644 --- a/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/ConnectorReleases.py +++ b/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/ConnectorReleases.py @@ -6,7 +6,22 @@ from datetime import date from typing import Any, Dict, List, Optional -from pydantic import AnyUrl, BaseModel, Extra, Field, constr +from pydantic import AnyUrl, BaseModel, Extra, Field, conint, constr + + +class RolloutConfiguration(BaseModel): + class Config: + extra = Extra.forbid + + initialPercentage: Optional[conint(ge=0, le=100)] = Field( + 0, description="The percentage of users that should receive the new version initially." + ) + maxPercentage: Optional[conint(ge=0, le=100)] = Field( + 50, description="The percentage of users who should receive the release candidate during the test phase before full rollout." + ) + advanceDelayMinutes: Optional[conint(ge=10)] = Field( + 10, description="The number of minutes to wait before advancing the rollout percentage." + ) class StreamBreakingChangeScope(BaseModel): @@ -51,6 +66,8 @@ 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, diff --git a/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/RolloutConfiguration.py b/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/RolloutConfiguration.py new file mode 100644 index 000000000000..9f96e2b84981 --- /dev/null +++ b/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/RolloutConfiguration.py @@ -0,0 +1,23 @@ +# generated by datamodel-codegen: +# filename: RolloutConfiguration.yaml + +from __future__ import annotations + +from typing import Optional + +from pydantic import BaseModel, Extra, Field, conint + + +class RolloutConfiguration(BaseModel): + class Config: + extra = Extra.forbid + + initialPercentage: Optional[conint(ge=0, le=100)] = Field( + 0, description="The percentage of users that should receive the new version initially." + ) + maxPercentage: Optional[conint(ge=0, le=100)] = Field( + 50, description="The percentage of users who should receive the release candidate during the test phase before full rollout." + ) + advanceDelayMinutes: Optional[conint(ge=10)] = Field( + 10, description="The number of minutes to wait before advancing the rollout percentage." + ) 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 32dd7f76e6ee..00c75f10006c 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 @@ -19,6 +19,7 @@ from .ReleaseStage import * from .RemoteRegistries import * from .ResourceRequirements import * +from .RolloutConfiguration import * from .Secret import * from .SecretStore import * from .SourceFileInfo import * diff --git a/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/src/ConnectorReleases.yaml b/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/src/ConnectorReleases.yaml index ff29e780783e..b670415bf938 100644 --- a/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/src/ConnectorReleases.yaml +++ b/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/src/ConnectorReleases.yaml @@ -8,6 +8,12 @@ additionalProperties: false required: - breakingChanges properties: + isReleaseCandidate: + description: Whether the release is eligible to be a release candidate. + type: boolean + default: false + rolloutConfiguration: + $ref: RolloutConfiguration.yaml breakingChanges: $ref: "#/definitions/ConnectorBreakingChanges" migrationDocumentationUrl: diff --git a/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/src/RolloutConfiguration.yaml b/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/src/RolloutConfiguration.yaml new file mode 100644 index 000000000000..51c00994792c --- /dev/null +++ b/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/src/RolloutConfiguration.yaml @@ -0,0 +1,25 @@ +--- +"$schema": http://json-schema.org/draft-07/schema# +"$id": https://github.com/airbytehq/airbyte/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/src/RolloutConfiguration.yaml +title: RolloutConfiguration +description: configuration for the rollout of a connector +type: object +additionalProperties: false +properties: + initialPercentage: + type: integer + minimum: 0 + maximum: 100 + default: 0 + description: The percentage of users that should receive the new version initially. + maxPercentage: + type: integer + minimum: 0 + maximum: 100 + default: 50 + description: The percentage of users who should receive the release candidate during the test phase before full rollout. + advanceDelayMinutes: + type: integer + minimum: 10 + default: 10 + description: The number of minutes to wait before advancing the rollout percentage. diff --git a/airbyte-ci/connectors/metadata_service/lib/pyproject.toml b/airbyte-ci/connectors/metadata_service/lib/pyproject.toml index f0e47fbe711f..20ce0a1725f6 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.10.3" +version = "0.11.0" description = "" authors = ["Ben Church "] readme = "README.md" diff --git a/airbyte-ci/connectors/metadata_service/lib/tests/test_transform.py b/airbyte-ci/connectors/metadata_service/lib/tests/test_transform.py index 99debe4d6dd7..0d32857c1431 100644 --- a/airbyte-ci/connectors/metadata_service/lib/tests/test_transform.py +++ b/airbyte-ci/connectors/metadata_service/lib/tests/test_transform.py @@ -59,7 +59,7 @@ def have_same_keys(dict1, dict2, omitted_keys=None): def test_transform_to_json_does_not_mutate_keys(valid_metadata_upload_files, valid_metadata_yaml_files): all_valid_metadata_files = valid_metadata_upload_files + valid_metadata_yaml_files - fields_with_defaults = ["data.supportsRefreshes"] + fields_with_defaults = ["data.supportsRefreshes", "data.releases.isReleaseCandidate"] for file_path in all_valid_metadata_files: metadata_file_path = pathlib.Path(file_path)