Skip to content

Commit

Permalink
chore: remove schema tool source layout check
Browse files Browse the repository at this point in the history
  • Loading branch information
jjaakola-aiven committed Oct 16, 2024
1 parent f9f5fe7 commit 8bb986f
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 8bb986f

Please sign in to comment.