From 87434288768c938088a0d25e62e4f66b11f56fa7 Mon Sep 17 00:00:00 2001 From: Alexander Dobrzhansky Date: Mon, 8 Dec 2025 18:24:30 +0100 Subject: [PATCH 1/3] Updates Debian base image to Trixie --- .github/actions/build-and-tag-locally/action.yml | 3 --- .github/workflows/pre-merge.yml | 5 ----- debian/Dockerfile | 2 +- release-automation/src/stackbrew_generator/models.py | 4 ++-- release-automation/tests/test_models.py | 2 +- release-automation/tests/test_stackbrew_updater.py | 6 +++--- release-automation/tests/test_update_stackbrew_file.py | 6 +++--- 7 files changed, 10 insertions(+), 18 deletions(-) diff --git a/.github/actions/build-and-tag-locally/action.yml b/.github/actions/build-and-tag-locally/action.yml index 5cb99a671..719aae4dd 100644 --- a/.github/actions/build-and-tag-locally/action.yml +++ b/.github/actions/build-and-tag-locally/action.yml @@ -57,9 +57,6 @@ runs: linux/i386) plaform_name="i386" ;; - linux/mips64le) - plaform_name="mips64le" - ;; linux/ppc64le) plaform_name="ppc64le" ;; diff --git a/.github/workflows/pre-merge.yml b/.github/workflows/pre-merge.yml index 59e8eeab2..29a0641da 100644 --- a/.github/workflows/pre-merge.yml +++ b/.github/workflows/pre-merge.yml @@ -36,18 +36,13 @@ jobs: - linux/arm/v5 - linux/arm/v6 - linux/arm/v7 - - linux/mips64le - linux/ppc64le - linux/s390x - linux/arm64 - linux/riscv64 exclude: - - distribution: alpine - platform: linux/mips64le - distribution: alpine platform: linux/arm/v5 - - distribution: debian - platform: linux/riscv64 - distribution: debian platform: linux/arm/v6 steps: diff --git a/debian/Dockerfile b/debian/Dockerfile index bf4727644..1a44e99c9 100644 --- a/debian/Dockerfile +++ b/debian/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:bookworm-slim +FROM debian:trixie-slim # add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added RUN set -eux; \ diff --git a/release-automation/src/stackbrew_generator/models.py b/release-automation/src/stackbrew_generator/models.py index 2bd05a8df..ee696d0d7 100644 --- a/release-automation/src/stackbrew_generator/models.py +++ b/release-automation/src/stackbrew_generator/models.py @@ -215,12 +215,12 @@ class StackbrewEntry(BaseModel): def architectures(self) -> List[str]: """Get supported architectures based on distribution type.""" if self.distribution.type == DistroType.DEBIAN: - return ["amd64", "arm32v5", "arm32v7", "arm64v8", "i386", "mips64le", "ppc64le", "s390x"] + return ["amd64", "arm32v5", "arm32v7", "arm64v8", "i386", "riscv64", "ppc64le", "s390x"] elif self.distribution.type == DistroType.ALPINE: return ["amd64", "arm32v6", "arm32v7", "arm64v8", "i386", "ppc64le", "riscv64", "s390x"] else: # Fallback to debian architectures for unknown distributions - return ["amd64", "arm32v5", "arm32v7", "arm64v8", "i386", "mips64le", "ppc64le", "s390x"] + return ["amd64", "arm32v5", "arm32v7", "arm64v8", "i386", "riscv64", "ppc64le", "s390x"] def __str__(self) -> str: """String representation in stackbrew format.""" diff --git a/release-automation/tests/test_models.py b/release-automation/tests/test_models.py index 6bda476a2..afa88c76e 100644 --- a/release-automation/tests/test_models.py +++ b/release-automation/tests/test_models.py @@ -261,7 +261,7 @@ def test_debian_architectures(self): git_fetch_ref="refs/tags/v8.2.1" ) - expected_architectures = ["amd64", "arm32v5", "arm32v7", "arm64v8", "i386", "mips64le", "ppc64le", "s390x"] + expected_architectures = ["amd64", "arm32v5", "arm32v7", "arm64v8", "i386", "riscv64", "ppc64le", "s390x"] assert entry.architectures == expected_architectures def test_alpine_architectures(self): diff --git a/release-automation/tests/test_stackbrew_updater.py b/release-automation/tests/test_stackbrew_updater.py index 36b98590e..ccff7b0b1 100644 --- a/release-automation/tests/test_stackbrew_updater.py +++ b/release-automation/tests/test_stackbrew_updater.py @@ -22,7 +22,7 @@ def test_update_stackbrew_content_basic(self): GitRepo: https://github.com/redis/docker-library-redis.git Tags: 8.2.1, 8.2, 8, 8.2.1-bookworm, 8.2-bookworm, 8-bookworm, latest, bookworm -Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x +Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, riscv64, ppc64le, s390x GitCommit: old123commit GitFetch: refs/tags/v8.2.1 Directory: debian @@ -34,14 +34,14 @@ def test_update_stackbrew_content_basic(self): Directory: alpine Tags: 7.4.0, 7.4, 7, 7.4.0-bookworm, 7.4-bookworm, 7-bookworm -Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x +Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, riscv64, ppc64le, s390x GitCommit: old456commit GitFetch: refs/tags/v7.4.0 Directory: debian """ new_content = """Tags: 8.2.2, 8.2, 8, 8.2.2-bookworm, 8.2-bookworm, 8-bookworm, latest, bookworm -Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x +Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, riscv64, ppc64le, s390x GitCommit: new123commit GitFetch: refs/tags/v8.2.2 Directory: debian diff --git a/release-automation/tests/test_update_stackbrew_file.py b/release-automation/tests/test_update_stackbrew_file.py index acdbd3ac1..a8aa99565 100644 --- a/release-automation/tests/test_update_stackbrew_file.py +++ b/release-automation/tests/test_update_stackbrew_file.py @@ -28,19 +28,19 @@ def test_update_stackbrew_file_basic(self): GitRepo: https://github.com/redis/docker-library-redis.git Tags: 8.2.1, 8.2, 8, 8.2.1-bookworm, 8.2-bookworm, 8-bookworm, latest, bookworm -Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x +Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, riscv64, ppc64le, s390x GitCommit: old123commit GitFetch: refs/tags/v8.2.1 Directory: debian Tags: 8.2.1-alpine, 8.2-alpine, 8-alpine, 8.2.1-alpine3.22, 8.2-alpine3.22, 8-alpine3.22, alpine, alpine3.22 -Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x +Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, riscv64, ppc64le, s390x GitCommit: old123commit GitFetch: refs/tags/v8.2.1 Directory: alpine Tags: 7.4.0, 7.4, 7, 7.4.0-bookworm, 7.4-bookworm, 7-bookworm -Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x +Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, riscv64, ppc64le, s390x GitCommit: old456commit GitFetch: refs/tags/v7.4.0 Directory: debian From 53f8fbb8b4202362dec1782c4edbfe1117f43944 Mon Sep 17 00:00:00 2001 From: Alexander Dobrzhansky Date: Tue, 9 Dec 2025 18:12:39 +0100 Subject: [PATCH 2/3] Update stackbrew generator to support trixie --- .../src/stackbrew_generator/models.py | 59 ++++++++++++++++--- release-automation/tests/test_models.py | 45 +++++++++++--- 2 files changed, 88 insertions(+), 16 deletions(-) diff --git a/release-automation/src/stackbrew_generator/models.py b/release-automation/src/stackbrew_generator/models.py index ee696d0d7..23aba6198 100644 --- a/release-automation/src/stackbrew_generator/models.py +++ b/release-automation/src/stackbrew_generator/models.py @@ -3,9 +3,9 @@ import functools import re from enum import Enum -from typing import List, Optional +from typing import List, Optional, Tuple -from pydantic import BaseModel, Field, validator +from pydantic import BaseModel, Field class DistroType(str, Enum): @@ -15,6 +15,50 @@ class DistroType(str, Enum): DEBIAN = "debian" +class DebianRelease: + """Debian release names.""" + + TRIXIE = "trixie" + BOOKWORM = "bookworm" + + +DEBIAN_TRIXIE_ARCHITECTURES: Tuple[str, ...] = ( + "amd64", + "arm32v5", + "arm32v7", + "arm64v8", + "i386", + "riscv64", + "ppc64le", + "s390x", +) +DEBIAN_BOOKWORM_ARCHITECTURES: Tuple[str, ...] = ( + "amd64", + "arm32v5", + "arm32v7", + "arm64v8", + "i386", + "mips64le", + "ppc64le", + "s390x", +) +ALPINE_ARCHITECTURES: Tuple[str, ...] = ( + "amd64", + "arm32v6", + "arm32v7", + "arm64v8", + "i386", + "ppc64le", + "riscv64", + "s390x", +) + +DEBIAN_ARCHITECTURES: dict[str, Tuple[str, ...]] = { + DebianRelease.TRIXIE: DEBIAN_TRIXIE_ARCHITECTURES, + DebianRelease.BOOKWORM: DEBIAN_BOOKWORM_ARCHITECTURES, +} + + @functools.total_ordering class RedisVersion(BaseModel): """Represents a parsed Redis version. @@ -213,14 +257,15 @@ class StackbrewEntry(BaseModel): @property def architectures(self) -> List[str]: - """Get supported architectures based on distribution type.""" + """Get supported architectures based on distribution type and version.""" if self.distribution.type == DistroType.DEBIAN: - return ["amd64", "arm32v5", "arm32v7", "arm64v8", "i386", "riscv64", "ppc64le", "s390x"] + archs = DEBIAN_ARCHITECTURES.get(self.distribution.name, DEBIAN_TRIXIE_ARCHITECTURES) + return list(archs) elif self.distribution.type == DistroType.ALPINE: - return ["amd64", "arm32v6", "arm32v7", "arm64v8", "i386", "ppc64le", "riscv64", "s390x"] + return list(ALPINE_ARCHITECTURES) else: - # Fallback to debian architectures for unknown distributions - return ["amd64", "arm32v5", "arm32v7", "arm64v8", "i386", "riscv64", "ppc64le", "s390x"] + # Fallback to debian trixie architectures for unknown distributions + return list(DEBIAN_TRIXIE_ARCHITECTURES) def __str__(self) -> str: """String representation in stackbrew format.""" diff --git a/release-automation/tests/test_models.py b/release-automation/tests/test_models.py index afa88c76e..52da82eaa 100644 --- a/release-automation/tests/test_models.py +++ b/release-automation/tests/test_models.py @@ -2,7 +2,17 @@ import pytest -from stackbrew_generator.models import RedisVersion, Distribution, DistroType, Release, StackbrewEntry +from stackbrew_generator.models import ( + ALPINE_ARCHITECTURES, + DEBIAN_BOOKWORM_ARCHITECTURES, + DEBIAN_TRIXIE_ARCHITECTURES, + DebianRelease, + Distribution, + DistroType, + RedisVersion, + Release, + StackbrewEntry, +) class TestRedisVersion: @@ -248,10 +258,27 @@ def test_release_string_representation(self): class TestStackbrewEntry: """Tests for StackbrewEntry model.""" - def test_debian_architectures(self): - """Test that Debian distributions get the correct architectures.""" + def test_debian_trixie_architectures(self): + """Test that Debian trixie gets riscv64 architecture (no mips64le).""" + version = RedisVersion.parse("8.4.0") + distribution = Distribution(type=DistroType.DEBIAN, name=DebianRelease.TRIXIE) + + entry = StackbrewEntry( + tags=["8.4.0", "latest"], + commit="abc123def456", + version=version, + distribution=distribution, + git_fetch_ref="refs/tags/v8.4.0", + ) + + assert entry.architectures == list(DEBIAN_TRIXIE_ARCHITECTURES) + assert "riscv64" in entry.architectures + assert "mips64le" not in entry.architectures + + def test_debian_bookworm_architectures(self): + """Test that Debian bookworm gets mips64le architecture (no riscv64).""" version = RedisVersion.parse("8.2.1") - distribution = Distribution(type=DistroType.DEBIAN, name="bookworm") + distribution = Distribution(type=DistroType.DEBIAN, name=DebianRelease.BOOKWORM) entry = StackbrewEntry( tags=["8.2.1", "latest"], @@ -261,8 +288,9 @@ def test_debian_architectures(self): git_fetch_ref="refs/tags/v8.2.1" ) - expected_architectures = ["amd64", "arm32v5", "arm32v7", "arm64v8", "i386", "riscv64", "ppc64le", "s390x"] - assert entry.architectures == expected_architectures + assert entry.architectures == list(DEBIAN_BOOKWORM_ARCHITECTURES) + assert "mips64le" in entry.architectures + assert "riscv64" not in entry.architectures def test_alpine_architectures(self): """Test that Alpine distributions get the correct architectures.""" @@ -277,8 +305,7 @@ def test_alpine_architectures(self): git_fetch_ref="refs/tags/v8.2.1" ) - expected_architectures = ["amd64", "arm32v6", "arm32v7", "arm64v8", "i386", "ppc64le", "riscv64", "s390x"] - assert entry.architectures == expected_architectures + assert entry.architectures == list(ALPINE_ARCHITECTURES) def test_stackbrew_entry_string_format(self): """Test that StackbrewEntry formats correctly with architectures.""" @@ -296,7 +323,7 @@ def test_stackbrew_entry_string_format(self): output = str(entry) # Check that it contains the expected Alpine architectures - assert "amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x" in output + assert ", ".join(ALPINE_ARCHITECTURES) in output assert "Tags: 8.2.1-alpine, alpine" in output assert "GitCommit: abc123def456" in output assert "GitFetch: refs/tags/v8.2.1" in output From 35926f28e02ffd41eed746fc6afc357d7e4e1a37 Mon Sep 17 00:00:00 2001 From: Alexander Dobrzhansky Date: Tue, 9 Dec 2025 18:18:57 +0100 Subject: [PATCH 3/3] revert mock data --- release-automation/tests/test_stackbrew_updater.py | 6 +++--- release-automation/tests/test_update_stackbrew_file.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/release-automation/tests/test_stackbrew_updater.py b/release-automation/tests/test_stackbrew_updater.py index ccff7b0b1..36b98590e 100644 --- a/release-automation/tests/test_stackbrew_updater.py +++ b/release-automation/tests/test_stackbrew_updater.py @@ -22,7 +22,7 @@ def test_update_stackbrew_content_basic(self): GitRepo: https://github.com/redis/docker-library-redis.git Tags: 8.2.1, 8.2, 8, 8.2.1-bookworm, 8.2-bookworm, 8-bookworm, latest, bookworm -Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, riscv64, ppc64le, s390x +Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x GitCommit: old123commit GitFetch: refs/tags/v8.2.1 Directory: debian @@ -34,14 +34,14 @@ def test_update_stackbrew_content_basic(self): Directory: alpine Tags: 7.4.0, 7.4, 7, 7.4.0-bookworm, 7.4-bookworm, 7-bookworm -Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, riscv64, ppc64le, s390x +Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x GitCommit: old456commit GitFetch: refs/tags/v7.4.0 Directory: debian """ new_content = """Tags: 8.2.2, 8.2, 8, 8.2.2-bookworm, 8.2-bookworm, 8-bookworm, latest, bookworm -Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, riscv64, ppc64le, s390x +Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x GitCommit: new123commit GitFetch: refs/tags/v8.2.2 Directory: debian diff --git a/release-automation/tests/test_update_stackbrew_file.py b/release-automation/tests/test_update_stackbrew_file.py index a8aa99565..953b8dca0 100644 --- a/release-automation/tests/test_update_stackbrew_file.py +++ b/release-automation/tests/test_update_stackbrew_file.py @@ -28,7 +28,7 @@ def test_update_stackbrew_file_basic(self): GitRepo: https://github.com/redis/docker-library-redis.git Tags: 8.2.1, 8.2, 8, 8.2.1-bookworm, 8.2-bookworm, 8-bookworm, latest, bookworm -Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, riscv64, ppc64le, s390x +Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x GitCommit: old123commit GitFetch: refs/tags/v8.2.1 Directory: debian @@ -40,7 +40,7 @@ def test_update_stackbrew_file_basic(self): Directory: alpine Tags: 7.4.0, 7.4, 7, 7.4.0-bookworm, 7.4-bookworm, 7-bookworm -Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, riscv64, ppc64le, s390x +Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x GitCommit: old456commit GitFetch: refs/tags/v7.4.0 Directory: debian