fix(docker): keep the reserved populations out of the image (contributor-scan 3.2)

The root image copies benchmarks/ (Dockerfile:43), and .dockerignore let benchmarks/valid
and benchmarks/unseen through, about 18 MB of reserved-population material.
RELEASE_NOTES.md says every version tag is pushed to ghcr.io/norandom/openultrasast.
Decided by the maintainer on 2026-11-24: both stay out of the image.

The scan path reads neither. The one run-time reader is the hunter's contamination report
(hunt/contamination.py), which runs from a checkout: a missing pool contributes nothing to
it, and it imports benchmarks.unseen.eligibility late, so inside the image that report has
no eligibility module and fails at the import rather than silently.

A test pins both patterns and fails if a later negation lets either back in. The built image
is checked for their absence in task 3.2 part 2, when it is rebuilt.
This commit is contained in:
Marius Ciepluch
2026-11-24 14:25:30 +01:00
parent ab2f55d8ae
commit 90170380ec
2 changed files with 13 additions and 0 deletions
+8
View File
@@ -197,3 +197,11 @@ def test_base_preserves_executor_build_toolchains():
for directory in ("doc", "man", "info"):
assert f"path-exclude=/usr/share/{directory}/*" in common
assert f" /usr/share/{directory}/*" in common
def test_reserved_populations_stay_out_of_the_image():
patterns = [line.strip() for line in read(".dockerignore").splitlines()]
patterns = [line for line in patterns if line and not line.startswith("#")]
for population in ("benchmarks/valid", "benchmarks/unseen"):
assert population in patterns, f"{population} is not excluded from the build context"
assert not any(line.startswith(f"!{population}") for line in patterns), f"{population} is let back in"