Skip to content

Commit

Permalink
metadata-service[lib]: fix breaking changes validation (#46908)
Browse files Browse the repository at this point in the history
  • Loading branch information
alafanechere authored Oct 15, 2024
1 parent 5e5a349 commit 93f1d49
Show file tree
Hide file tree
Showing 4 changed files with 237 additions and 217 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ def validate_metadata_images_in_dockerhub(
normalization_docker_image = get(metadata_definition_dict, "data.normalizationConfig.normalizationRepository", None)
normalization_docker_version = get(metadata_definition_dict, "data.normalizationConfig.normalizationTag", None)

breaking_change_versions = get(metadata_definition_dict, "data.releases.breakingChanges", {}).keys()
breaking_changes = get(metadata_definition_dict, "data.releases.breakingChanges", None)
breaking_change_versions = breaking_changes.keys() if breaking_changes else []

possible_docker_images = [
(base_docker_image, base_docker_version),
Expand Down Expand Up @@ -115,7 +116,6 @@ def validate_major_version_bump_has_breaking_change_entry(
if str(metadata_definition.data.definitionId) == _SOURCE_DECLARATIVE_MANIFEST_DEFINITION_ID:
return True, None

docker_repo = get(metadata_definition_dict, "data.dockerRepository")
releases = get(metadata_definition_dict, "data.releases")
if not releases:
return (
Expand All @@ -124,7 +124,7 @@ def validate_major_version_bump_has_breaking_change_entry(
)

breaking_changes = get(metadata_definition_dict, "data.releases.breakingChanges")
if image_tag not in breaking_changes.keys():
if breaking_changes is None or image_tag not in breaking_changes.keys():
return False, f"Major version {image_tag} needs a 'releases.breakingChanges' entry indicating what changed."

return True, None
Expand Down
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.20.0"
version = "0.20.1"
description = ""
authors = ["Ben Church <[email protected]>"]
readme = "README.md"
Expand Down
Loading

0 comments on commit 93f1d49

Please sign in to comment.