Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove schema tool source layout check #978

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading