Skip to content

Commit

Permalink
Merge pull request Aiven-Open#978 from Aiven-Open/jjaakola-aiven-remo…
Browse files Browse the repository at this point in the history
…ve-schema-tool-src-layout-check

chore: remove schema tool source layout check
  • Loading branch information
aiven-anton authored Oct 17, 2024
2 parents 54308a6 + 2891a87 commit 2c55c61
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions src/karapace/backup/backends/v3/schema_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,6 @@ def relative_path(path: pathlib.Path) -> pathlib.Path:
return pathlib.Path(str_path[len(cwd) + 1 :]) if str_path.startswith(cwd) else path


def target_has_source_layout(git_target: str) -> bool:
with subprocess.Popen(
["git", "show", f"{git_target}:src"],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
) as cp:
if cp.returncode == 128:
return False
return True


def check_compatibility(git_target: str) -> None:
errored = False
found_any = False
Expand All @@ -82,13 +71,8 @@ def check_compatibility(git_target: str) -> None:

subprocess.run(["git", "fetch", remote, branch], check=True, capture_output=True)

# Does the target version have source layout
source_layout = target_has_source_layout(git_target)

for file in schema_directory.glob(f"*{extension}"):
relative = relative_path(file)
if not source_layout:
relative = pathlib.Path(*relative.parts[1:])
with subprocess.Popen(
["git", "show", f"{git_target}:{relative}"],
stdout=subprocess.PIPE,
Expand Down

0 comments on commit 2c55c61

Please sign in to comment.