From b04f368f5cc49cd0c94405406a1a76c35fb2057e Mon Sep 17 00:00:00 2001 From: Jarkko Jaakola Date: Wed, 16 Oct 2024 14:46:27 +0300 Subject: [PATCH] chore: remove schema tool source layout check --- src/karapace/backup/backends/v3/schema_tool.py | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/karapace/backup/backends/v3/schema_tool.py b/src/karapace/backup/backends/v3/schema_tool.py index 94fb45db0..f5843ceb2 100644 --- a/src/karapace/backup/backends/v3/schema_tool.py +++ b/src/karapace/backup/backends/v3/schema_tool.py @@ -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 @@ -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,