From 014cdc80682d7c4613150d4566ee1c9c9078a08d Mon Sep 17 00:00:00 2001 From: David Ham <64705+davidham@users.noreply.github.com> Date: Tue, 28 Jul 2026 17:18:46 -0500 Subject: [PATCH] refactor(logic): scope testcontainers helpers to the test build go/logic/test_utils.go has no _test.go suffix, so it is part of the ordinary build of package logic. It imports testcontainers-go, and package logic is imported by go/cmd/gh-ost, so testcontainers and its transitive dependencies are compiled into the released gh-ost binary and recorded in its build info. Container-testing infrastructure has no role at runtime. Shipping it enlarges the binary and widens the dependency surface that scanners report against, which is how the vendored Docker client came to account for 3 HIGH CVEs in the v1.1.10 binary (#1738). Upgrading testcontainers in #1741 cleared those particular findings, but the structural issue remains: a future advisory anywhere in the container-testing tree would again surface in scans of a binary that never calls into it. Rename the file to test_utils_test.go so it stays available to the tests in the same package while being excluded from the ordinary build. Every identifier it declares is referenced only from applier_test.go, streamer_test.go and migrator_test.go, so this is a pure rename with no content change. Effect on the linux/amd64 binary, built with go1.25.12: - modules recorded in build info: 63 -> 22 - binary size: 18.64 MB -> 16.99 MB - Trivy HIGH/CRITICAL: 0 -> 0, unchanged; master is already clean --- go/logic/{test_utils.go => test_utils_test.go} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename go/logic/{test_utils.go => test_utils_test.go} (100%) diff --git a/go/logic/test_utils.go b/go/logic/test_utils_test.go similarity index 100% rename from go/logic/test_utils.go rename to go/logic/test_utils_test.go