Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions firestarter/tests/test_build_images_functionality.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,22 +90,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
Comment on lines 92 to +96
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test_execute only asserts the count of login() calls. With the new “login to both registries” behavior, this becomes more brittle and doesn’t verify the important part (that we logged into both snapshots_registry and releases_registry). Consider asserting against login_mock.call_args_list (or matching specific expected calls with ANY) so the test validates the registries/creds/auth_strategy, not just the total number of calls.

Copilot uses AI. Check for mistakes.
)
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
)


Expand Down
10 changes: 8 additions & 2 deletions firestarter/workflows/build_images/build_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,15 @@ def execute(self):
if self.login_required:
self.login(
self.auth_strategy,
default_registry,
default_registry_creds,
self.snapshots_registry,
self.snapshots_registry_creds,
Comment on lines 172 to +176
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

execute() still computes default_registry = getattr(self, f"{self.type}_registry") above this block, but after switching to explicit logins for snapshots/releases it’s no longer used anywhere. Consider removing default_registry (and potentially inlining/renaming default_registry_creds to reflect it’s only used for extra_registries) to avoid dead code and confusion about which registry is actually used.

Copilot uses AI. Check for mistakes.
)
if self.releases_registry != self.snapshots_registry:
self.login(
self.auth_strategy,
self.releases_registry,
self.releases_registry_creds,
)

for flavor in self.flavors:
logger.info(f"Building flavor {flavor}...")
Expand Down
Loading