From 8d82d6ead4bb156a2964f88246fa2e5ca3f48b8e Mon Sep 17 00:00:00 2001 From: Jose Alvarez Date: Mon, 27 Jul 2026 18:47:28 +0200 Subject: [PATCH 1/2] fix: login to both snapshots and releases registries on build When building an image that uses a base image from the opposite registry (e.g. a releases image FROM a snapshots base image), the build would fail because Dagger was only authenticated in the registry matching the build type. Now both snapshots_registry and releases_registry are always logged into (when login_required is true and the registry is set), so cross-registry base image references work in both directions. Closes prefapp/features#1169 --- firestarter/tests/test_build_images_functionality.py | 12 ++++++------ firestarter/workflows/build_images/build_images.py | 11 ++++++----- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/firestarter/tests/test_build_images_functionality.py b/firestarter/tests/test_build_images_functionality.py index 45c9a281..f11ad45d 100644 --- a/firestarter/tests/test_build_images_functionality.py +++ b/firestarter/tests/test_build_images_functionality.py @@ -94,22 +94,22 @@ def execute_function_test(mocker, flavors, **kwargs) -> None: assert len(compile_images_for_all_flavors_mock.mock_calls) == kwargs["compile_image_calls"] execute_function_test( - mocker, "*", checkout_calls=1, login_calls=5, compile_image_calls=1 + mocker, "*", checkout_calls=1, login_calls=6, compile_image_calls=1 ) execute_function_test( - mocker, "flavor1, flavor3", checkout_calls=1, login_calls=5, compile_image_calls=1 + mocker, "flavor1, flavor3", checkout_calls=1, login_calls=6, compile_image_calls=1 ) execute_function_test( - mocker, "flavor2, flavor3", checkout_calls=1, login_calls=3, compile_image_calls=1 + mocker, "flavor2, flavor3", checkout_calls=1, login_calls=4, compile_image_calls=1 ) execute_function_test( - mocker, "flavor0, flavor4", checkout_calls=1, login_calls=1, compile_image_calls=1 + mocker, "flavor0, flavor4", checkout_calls=1, login_calls=2, compile_image_calls=1 ) execute_function_test( - mocker, "flavor1", checkout_calls=1, login_calls=3, compile_image_calls=1 + mocker, "flavor1", checkout_calls=1, login_calls=4, compile_image_calls=1 ) execute_function_test( - mocker, "", checkout_calls=1, login_calls=3, compile_image_calls=1 + mocker, "", checkout_calls=1, login_calls=4, compile_image_calls=1 ) diff --git a/firestarter/workflows/build_images/build_images.py b/firestarter/workflows/build_images/build_images.py index 554e42bd..e99be8c9 100644 --- a/firestarter/workflows/build_images/build_images.py +++ b/firestarter/workflows/build_images/build_images.py @@ -170,11 +170,12 @@ def execute(self): default_registry_creds = getattr(self, f"{self.type}_registry_creds") if self.login_required: - self.login( - self.auth_strategy, - default_registry, - default_registry_creds, - ) + for registry, creds in [ + (self.snapshots_registry, self.snapshots_registry_creds), + (self.releases_registry, self.releases_registry_creds), + ]: + if registry: + self.login(self.auth_strategy, registry, creds) for flavor in self.flavors: logger.info(f"Building flavor {flavor}...") From 4ea91e71002ff17a911a7868bb8c656f1ff9708d Mon Sep 17 00:00:00 2001 From: Jose Alvarez Date: Mon, 27 Jul 2026 18:47:28 +0200 Subject: [PATCH 2/2] fix: login to both snapshots and releases registries on build When building an image that uses a base image from the opposite registry (e.g. a releases image FROM a snapshots base image), the build would fail because Dagger was only authenticated in the registry matching the build type. Now both snapshots_registry and releases_registry are always logged into (when login_required is true and the registry is set), so cross-registry base image references work in both directions. Closes prefapp/features#1169 --- firestarter/tests/test_build_images_functionality.py | 12 ++++++------ firestarter/workflows/build_images/build_images.py | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/firestarter/tests/test_build_images_functionality.py b/firestarter/tests/test_build_images_functionality.py index 45c9a281..f11ad45d 100644 --- a/firestarter/tests/test_build_images_functionality.py +++ b/firestarter/tests/test_build_images_functionality.py @@ -94,22 +94,22 @@ def execute_function_test(mocker, flavors, **kwargs) -> None: assert len(compile_images_for_all_flavors_mock.mock_calls) == kwargs["compile_image_calls"] execute_function_test( - mocker, "*", checkout_calls=1, login_calls=5, compile_image_calls=1 + mocker, "*", checkout_calls=1, login_calls=6, compile_image_calls=1 ) execute_function_test( - mocker, "flavor1, flavor3", checkout_calls=1, login_calls=5, compile_image_calls=1 + mocker, "flavor1, flavor3", checkout_calls=1, login_calls=6, compile_image_calls=1 ) execute_function_test( - mocker, "flavor2, flavor3", checkout_calls=1, login_calls=3, compile_image_calls=1 + mocker, "flavor2, flavor3", checkout_calls=1, login_calls=4, compile_image_calls=1 ) execute_function_test( - mocker, "flavor0, flavor4", checkout_calls=1, login_calls=1, compile_image_calls=1 + mocker, "flavor0, flavor4", checkout_calls=1, login_calls=2, compile_image_calls=1 ) execute_function_test( - mocker, "flavor1", checkout_calls=1, login_calls=3, compile_image_calls=1 + mocker, "flavor1", checkout_calls=1, login_calls=4, compile_image_calls=1 ) execute_function_test( - mocker, "", checkout_calls=1, login_calls=3, compile_image_calls=1 + mocker, "", checkout_calls=1, login_calls=4, compile_image_calls=1 ) diff --git a/firestarter/workflows/build_images/build_images.py b/firestarter/workflows/build_images/build_images.py index 554e42bd..53c8997b 100644 --- a/firestarter/workflows/build_images/build_images.py +++ b/firestarter/workflows/build_images/build_images.py @@ -166,15 +166,15 @@ def execute(self): else: self.filter_flavors() - default_registry = getattr(self, f"{self.type}_registry") default_registry_creds = getattr(self, f"{self.type}_registry_creds") if self.login_required: - self.login( - self.auth_strategy, - default_registry, - default_registry_creds, - ) + for registry, creds in [ + (self.snapshots_registry, self.snapshots_registry_creds), + (self.releases_registry, self.releases_registry_creds), + ]: + if registry: + self.login(self.auth_strategy, registry, creds) for flavor in self.flavors: logger.info(f"Building flavor {flavor}...")