This is an automated email from the ASF dual-hosted git repository.

rusackas pushed a commit to branch fix/docker-matrix-py311-py312-pyver-override
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 0e3c8c5632053733e4f6cc8881cdcfdfc9952414
Author: rusackas <[email protected]>
AuthorDate: Mon Jul 27 22:37:27 2026 -0700

    fix(ci): stop py311/py312 docker builds from silently matching lean
    
    docker.yml's build step appends --build-arg PY_VER=3.11.14-slim-trixie
    via --extra-flags for every matrix leg, so it can pin dev/lean to the
    Dockerfile's supported Python version even though supersetbot's own
    default for those two presets is stale. But docker/buildx keeps the
    last value for a repeated --build-arg key, and that override was
    landing after supersetbot's own --build-arg PY_VER for the py311/py312
    presets too, clobbering the one thing that's supposed to make those
    two presets different from lean. All three have been building the
    same image.
    
    Exclude py311/py312 from the override so their own PY_VER pin
    survives.
---
 .github/workflows/docker.yml | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml
index db9bb93bdae..2640c47b1ef 100644
--- a/.github/workflows/docker.yml
+++ b/.github/workflows/docker.yml
@@ -130,13 +130,25 @@ jobs:
           # repeated --build-arg key, so appending PY_VER here overrides
           # supersetbot's pin and keeps the build on the Dockerfile's own
           # supported Python version.
+          #
+          # The "py311"/"py312" presets exist specifically to pin a
+          # *different* PY_VER than "dev"/"lean" (that's the whole point of
+          # those two presets), so they're excluded from this override.
+          # Without this exclusion, the PY_VER above clobbers theirs too
+          # (same last-value-wins rule), making "py311"/"py312" silently
+          # build the exact same image as "lean".
+          EXTRA_FLAGS="--build-arg INCLUDE_CHROMIUM=false --tag $IMAGE_TAG"
+          if [ "$BUILD_PRESET" != "py311" ] && [ "$BUILD_PRESET" != "py312" ]; 
then
+            EXTRA_FLAGS="--build-arg PY_VER=3.11.14-slim-trixie $EXTRA_FLAGS"
+          fi
+
           for attempt in 1 2 3; do
             if supersetbot docker \
               $PUSH_OR_LOAD \
               --preset "$BUILD_PRESET" \
               --context "$EVENT" \
               --context-ref "$RELEASE" $FORCE_LATEST \
-              --extra-flags "--build-arg PY_VER=3.11.14-slim-trixie 
--build-arg INCLUDE_CHROMIUM=false --tag $IMAGE_TAG" \
+              --extra-flags "$EXTRA_FLAGS" \
               $PLATFORM_ARG; then
               break
             fi

Reply via email to