From ad55587cc7f4672d71ccc60906bcdfda9d1b989e Mon Sep 17 00:00:00 2001 From: Alexandre Girard Date: Tue, 21 May 2024 09:52:59 -0700 Subject: [PATCH 1/5] Skip breaking change validation for source declarative manifest --- .../lib/metadata_service/validators/metadata_validator.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/airbyte-ci/connectors/metadata_service/lib/metadata_service/validators/metadata_validator.py b/airbyte-ci/connectors/metadata_service/lib/metadata_service/validators/metadata_validator.py index 8c71c394a750..298c45fb4dad 100644 --- a/airbyte-ci/connectors/metadata_service/lib/metadata_service/validators/metadata_validator.py +++ b/airbyte-ci/connectors/metadata_service/lib/metadata_service/validators/metadata_validator.py @@ -102,6 +102,13 @@ def validate_major_version_bump_has_breaking_change_entry( if not is_major_version(image_tag): return True, None + # We are updating the same version since connector builder projects have a different concept of + # versioning. + # We do not check for breaking changes for source-declarative-connector in the metadata because the conenctor isn't directly used by any workspace. + # Breaking changes are instead tracked at the CDK level + if str(metadata_definition.data.definitionId) == "64a2f99c-542f-4af8-9a6f-355f1217b436": + return True, None + docker_repo = get(metadata_definition_dict, "data.dockerRepository") releases = get(metadata_definition_dict, "data.releases") if not releases: From bc07a9e4d9391a6ec95d63aca9dbbfa5278196fa Mon Sep 17 00:00:00 2001 From: Alexandre Girard Date: Tue, 21 May 2024 09:55:17 -0700 Subject: [PATCH 2/5] extract to a constant --- .../lib/metadata_service/validators/metadata_validator.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/airbyte-ci/connectors/metadata_service/lib/metadata_service/validators/metadata_validator.py b/airbyte-ci/connectors/metadata_service/lib/metadata_service/validators/metadata_validator.py index 298c45fb4dad..a07fff347905 100644 --- a/airbyte-ci/connectors/metadata_service/lib/metadata_service/validators/metadata_validator.py +++ b/airbyte-ci/connectors/metadata_service/lib/metadata_service/validators/metadata_validator.py @@ -23,6 +23,7 @@ class ValidatorOptions: ValidationResult = Tuple[bool, Optional[Union[ValidationError, str]]] Validator = Callable[[ConnectorMetadataDefinitionV0, ValidatorOptions], ValidationResult] +_SOURCE_DECLARATIVE_MANIFEST_DEFINITION_ID = "64a2f99c-542f-4af8-9a6f-355f1217b436" def validate_metadata_images_in_dockerhub( metadata_definition: ConnectorMetadataDefinitionV0, validator_opts: ValidatorOptions @@ -106,7 +107,7 @@ def validate_major_version_bump_has_breaking_change_entry( # versioning. # We do not check for breaking changes for source-declarative-connector in the metadata because the conenctor isn't directly used by any workspace. # Breaking changes are instead tracked at the CDK level - if str(metadata_definition.data.definitionId) == "64a2f99c-542f-4af8-9a6f-355f1217b436": + if str(metadata_definition.data.definitionId) == _SOURCE_DECLARATIVE_MANIFEST_DEFINITION_ID: return True, None docker_repo = get(metadata_definition_dict, "data.dockerRepository") From de9ada419de1c6c92473e4945b9d9423d74dfbb1 Mon Sep 17 00:00:00 2001 From: Alexandre Girard Date: Tue, 21 May 2024 09:57:36 -0700 Subject: [PATCH 3/5] Add test cases --- .../invalid/metadata_major_bump.yaml | 14 ++++++++++++++ .../metadata_declarative_manifest_major_bump.yaml | 14 ++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 airbyte-ci/connectors/metadata_service/lib/tests/fixtures/metadata_validate/invalid/metadata_major_bump.yaml create mode 100644 airbyte-ci/connectors/metadata_service/lib/tests/fixtures/metadata_validate/valid/metadata_declarative_manifest_major_bump.yaml diff --git a/airbyte-ci/connectors/metadata_service/lib/tests/fixtures/metadata_validate/invalid/metadata_major_bump.yaml b/airbyte-ci/connectors/metadata_service/lib/tests/fixtures/metadata_validate/invalid/metadata_major_bump.yaml new file mode 100644 index 000000000000..9d26a7480bed --- /dev/null +++ b/airbyte-ci/connectors/metadata_service/lib/tests/fixtures/metadata_validate/invalid/metadata_major_bump.yaml @@ -0,0 +1,14 @@ +metadataSpecVersion: 1.0 +data: + name: Low-code + definitionId: 1fa90628-2b9e-11ed-a261-0242ac120002 + connectorType: source + dockerRepository: airbyte/image-exists-1 + githubIssueLabel: source-alloydb-strict-encrypt + dockerImageTag: 1.0.0 + documentationUrl: https://docs.airbyte.com/integrations/sources/existingsource + connectorSubtype: database + releaseStage: generally_available + license: MIT + tags: + - language:java diff --git a/airbyte-ci/connectors/metadata_service/lib/tests/fixtures/metadata_validate/valid/metadata_declarative_manifest_major_bump.yaml b/airbyte-ci/connectors/metadata_service/lib/tests/fixtures/metadata_validate/valid/metadata_declarative_manifest_major_bump.yaml new file mode 100644 index 000000000000..cde8a6cedd85 --- /dev/null +++ b/airbyte-ci/connectors/metadata_service/lib/tests/fixtures/metadata_validate/valid/metadata_declarative_manifest_major_bump.yaml @@ -0,0 +1,14 @@ +metadataSpecVersion: 1.0 +data: + name: Low-code + definitionId: 64a2f99c-542f-4af8-9a6f-355f1217b436 + connectorType: source + dockerRepository: airbyte/image-exists-1 + githubIssueLabel: source-alloydb-strict-encrypt + dockerImageTag: 1.0.0 + documentationUrl: https://docs.airbyte.com/integrations/sources/existingsource + connectorSubtype: database + releaseStage: generally_available + license: MIT + tags: + - language:java From 3ae7ea4417e4d1280c4ad784539312eec4ecac46 Mon Sep 17 00:00:00 2001 From: Alexandre Girard Date: Tue, 21 May 2024 10:01:44 -0700 Subject: [PATCH 4/5] format --- .../lib/metadata_service/validators/metadata_validator.py | 1 + 1 file changed, 1 insertion(+) diff --git a/airbyte-ci/connectors/metadata_service/lib/metadata_service/validators/metadata_validator.py b/airbyte-ci/connectors/metadata_service/lib/metadata_service/validators/metadata_validator.py index a07fff347905..5941033142cd 100644 --- a/airbyte-ci/connectors/metadata_service/lib/metadata_service/validators/metadata_validator.py +++ b/airbyte-ci/connectors/metadata_service/lib/metadata_service/validators/metadata_validator.py @@ -25,6 +25,7 @@ class ValidatorOptions: _SOURCE_DECLARATIVE_MANIFEST_DEFINITION_ID = "64a2f99c-542f-4af8-9a6f-355f1217b436" + def validate_metadata_images_in_dockerhub( metadata_definition: ConnectorMetadataDefinitionV0, validator_opts: ValidatorOptions ) -> ValidationResult: From 63b6d1639a9877746d0c9c2e33c5dc353b512d03 Mon Sep 17 00:00:00 2001 From: Alexandre Girard Date: Tue, 21 May 2024 10:02:51 -0700 Subject: [PATCH 5/5] rename test files --- ...jor_bump.yaml => metadata_major_bump_no_breaking_changes.yaml} | 0 ...adata_declarative_manifest_major_bump_no_breaking_change.yaml} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename airbyte-ci/connectors/metadata_service/lib/tests/fixtures/metadata_validate/invalid/{metadata_major_bump.yaml => metadata_major_bump_no_breaking_changes.yaml} (100%) rename airbyte-ci/connectors/metadata_service/lib/tests/fixtures/metadata_validate/valid/{metadata_declarative_manifest_major_bump.yaml => metadata_declarative_manifest_major_bump_no_breaking_change.yaml} (100%) diff --git a/airbyte-ci/connectors/metadata_service/lib/tests/fixtures/metadata_validate/invalid/metadata_major_bump.yaml b/airbyte-ci/connectors/metadata_service/lib/tests/fixtures/metadata_validate/invalid/metadata_major_bump_no_breaking_changes.yaml similarity index 100% rename from airbyte-ci/connectors/metadata_service/lib/tests/fixtures/metadata_validate/invalid/metadata_major_bump.yaml rename to airbyte-ci/connectors/metadata_service/lib/tests/fixtures/metadata_validate/invalid/metadata_major_bump_no_breaking_changes.yaml diff --git a/airbyte-ci/connectors/metadata_service/lib/tests/fixtures/metadata_validate/valid/metadata_declarative_manifest_major_bump.yaml b/airbyte-ci/connectors/metadata_service/lib/tests/fixtures/metadata_validate/valid/metadata_declarative_manifest_major_bump_no_breaking_change.yaml similarity index 100% rename from airbyte-ci/connectors/metadata_service/lib/tests/fixtures/metadata_validate/valid/metadata_declarative_manifest_major_bump.yaml rename to airbyte-ci/connectors/metadata_service/lib/tests/fixtures/metadata_validate/valid/metadata_declarative_manifest_major_bump_no_breaking_change.yaml