Repository navigation
Backport #118063 to 26.3: Check column-level SELECT grants for additional_table_filters and parallel_replicas_custom_key - #119500
Conversation
…onal_table_filters and parallel_replicas_custom_key
7380024 to
91f73f1
Compare
|
Workflow [BackportPR], commit [84156b3] Summary: ✅ |
|
🕵 The two red jobs here — Both fail in Root cause: #119493 (merged 2026-09-11 16:22 UTC) swapped the 26.3 distroless base image to Fix for this branch: #119532 (and #119533 for 26.4). Once it is merged, these two jobs will go green here on the next run — no change is needed in this backport. @groeneai, 25.8 needs a differently shaped fix: its docker job still runs from the older Everything else on this backport is green (all builds, both |
|
@alexey-milovidov Confirmed, and 25.8 needs more than a port of the 26.3 change. Three differences I measured on that branch:
I validated the patch against the real official-images suite, using
The Patch against 25.8 (applies cleanly; non-distroless images keep the current code path)--- a/tests/ci/docker_server.py
+++ b/tests/ci/docker_server.py
@@ -4,7 +4,9 @@
import argparse
import json
import logging
+import shlex
import sys
+import tempfile
import time
from os import makedirs
from os import path as p
@@ -17,6 +19,7 @@
from env_helper import (
GITHUB_RUN_URL,
GITHUB_SERVER_URL,
+ REPO_COPY,
REPORT_PATH,
S3_BUILDS_BUCKET,
S3_DOWNLOAD,
@@ -33,6 +36,10 @@
ARCH = ("amd64", "arm64")
+# `run.sh` resolves a test name declared by a config against that config's own directory,
+# so the generated config below is written here to make `tests/` reachable.
+DOCKER_SERVER_SCRIPTS = Path(REPO_COPY) / "ci/jobs/scripts/docker_server"
+
class DelOS(argparse.Action):
def __call__(self, _, namespace, __, option_string=None):
@@ -318,6 +325,56 @@
return result
+def is_distroless_image(docker_image: str) -> bool:
+ _, tag = docker_image.rsplit(":", 1)
+ return "distroless" in tag.split("-")
+
+
+def get_official_images_variant(docker_image: str) -> str:
+ # The official-images test runner derives its lookup variant from the final
+ # tag suffix. For example, head-distroless-amd64 is looked up as repo:amd64.
+ _, tag = docker_image.rsplit(":", 1)
+ return tag.rsplit("-", 1)[-1]
+
+
+def write_distroless_docker_library_config(docker_image: str, config_dir: Path) -> Path:
+ """Map arch-suffixed distroless tags to the tests that need no shell."""
+ # A distroless image has no shell and no coreutils, so the official-images global
+ # tests cannot run against it. Marking the derived key explicit is what keeps them
+ # away; the imageTests entry then supplies the tests that do work.
+ repo, _ = docker_image.rsplit(":", 1)
+ variant = get_official_images_variant(docker_image)
+ image_variant = shlex.quote(f"{repo}:{variant}")
+
+ generated_config = None
+ try:
+ with tempfile.NamedTemporaryFile(
+ "w",
+ prefix="docker-library-distroless-",
+ suffix=".sh",
+ dir=config_dir,
+ delete=False,
+ encoding="utf-8",
+ ) as f:
+ generated_config = Path(f.name)
+ f.write(
+ "#!/usr/bin/env bash\n"
+ "\n"
+ "explicitTests+=(\n"
+ f"\t[{image_variant}]=1\n"
+ ")\n"
+ "\n"
+ "imageTests+=(\n"
+ f'\t[{image_variant}]="clickhouse-distroless-no-shell"\n'
+ ")\n"
+ )
+ return generated_config
+ except Exception:
+ if generated_config:
+ generated_config.unlink(missing_ok=True)
+ raise
+
+
def test_docker_library(test_results: TestResults) -> None:
"""we test our images vs the official docker library repository to track integrity"""
check_images = [
@@ -348,22 +405,35 @@
run_sh = (repo_path / "test/run.sh").absolute()
for image in check_images:
test_sw = Stopwatch()
- cmd = f"{run_sh} {image}"
- tag = image.rsplit(":", 1)[-1]
- log_file = (
- temp_path / f"docker-library-test-{Utils.normalize_string(image)}.log"
- )
- with TeePopen(cmd, log_file) as process:
- retcode = process.wait()
- status = OK if retcode == 0 else FAIL
- test_results.append(
- TestResult(
- f"{test_name} ({tag})",
- status,
- test_sw.duration_seconds,
- [log_file],
+ generated_config = None
+ try:
+ cmd = f"{run_sh} {image}"
+ if is_distroless_image(image):
+ generated_config = write_distroless_docker_library_config(
+ image, DOCKER_SERVER_SCRIPTS
+ )
+ # Passing -c replaces the default config list, so the patched
+ # upstream config has to be named explicitly alongside it.
+ cmd += f" -c {repo_path / 'test/config.sh'} -c {generated_config}"
+ tag = image.rsplit(":", 1)[-1]
+ log_file = (
+ temp_path
+ / f"docker-library-test-{Utils.normalize_string(image)}.log"
)
- )
+ with TeePopen(cmd, log_file) as process:
+ retcode = process.wait()
+ status = OK if retcode == 0 else FAIL
+ test_results.append(
+ TestResult(
+ f"{test_name} ({tag})",
+ status,
+ test_sw.duration_seconds,
+ [log_file],
+ )
+ )
+ finally:
+ if generated_config:
+ generated_config.unlink(missing_ok=True)
except Exception as e:
logging.error("Failed while testing the docker library image: %s", e)
test_results.append(I cannot open this one myself: I am not allowed to open a pull request whose base is a release branch, and there is no master-side commit to request a backport label for, since One deliberate omission: if you want 25.8 to reach 26.3's actual coverage rather than just go green, |
|
🕵 Thank you — I carried it myself: #119552 (base I re-checked your three differences on
The first row matches the I kept your minimal scope: Nothing changes for this backport: its only red is still the 26.3-side gap, whose fix is #119532 — everything else here is green and there are no unresolved review threads, so there is nothing to push on |
Original pull-request #118063
Cherry-pick pull-request #119085
This pull-request is a last step of an automated backporting.
Treat it as a standard pull-request: look at the checks and resolve conflicts.
Merge it only if you intend to backport changes to the target branch, otherwise just close it.
The PR source
The PR is created in the CI job
Version info
26.3.33.64