Skip to content

[build-images] Authenticate in both org default registries#217

Draft
Copilot wants to merge 3 commits into
mainfrom
copilot/build-images-authenticate-in-both-registries
Draft

[build-images] Authenticate in both org default registries#217
Copilot wants to merge 3 commits into
mainfrom
copilot/build-images-authenticate-in-both-registries

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 23, 2026

The build-images workflow only authenticated against whichever default registry matched the current type (snapshots or releases), causing failures when a Dockerfile pulls a base image (FROM) hosted in the other registry.

Changes

  • build_images.py: In execute(), replaced the single type-conditional registry login with explicit logins to both snapshots_registry and releases_registry unconditionally.
# Before: only logged into the registry matching self.type
if self.login_required:
    self.login(self.auth_strategy, default_registry, default_registry_creds)

# After: always log into both registries
if self.login_required:
    self.login(self.auth_strategy, self.snapshots_registry, self.snapshots_registry_creds)
    self.login(self.auth_strategy, self.releases_registry, self.releases_registry_creds)
  • test_build_images_functionality.py: Updated test_execute login_calls expectations (+1 across all test cases) to reflect the additional login.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.dagger.io
    • Triggering command: /opt/hostedtoolcache/Python/3.11.15/x64/bin/python /opt/hostedtoolcache/Python/3.11.15/x64/bin/python -m pytest firestarter/tests/ -v (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Authenticate in both org default registries for image builds [build-images] Authenticate in both org default registries Apr 23, 2026
Copilot AI requested a review from alambike April 23, 2026 19:01
@alambike alambike requested a review from Copilot April 24, 2026 07:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the build-images workflow to authenticate against both the snapshots and releases registries so builds don’t fail when a Dockerfile pulls a base image from the “other” default registry.

Changes:

  • In BuildImages.execute(), replaced the type-conditional default-registry login with unconditional logins to both snapshots_registry and releases_registry.
  • Updated test_execute expectations to account for the additional registry login call.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
firestarter/workflows/build_images/build_images.py Logs into both default registries before building flavors to prevent cross-registry FROM pull failures.
firestarter/tests/test_build_images_functionality.py Adjusts test_execute login call counts to reflect the added login.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 172 to +176
if self.login_required:
self.login(
self.auth_strategy,
default_registry,
default_registry_creds,
self.snapshots_registry,
self.snapshots_registry_creds,
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.
Comment thread firestarter/workflows/build_images/build_images.py Outdated
Comment on lines 92 to +96
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
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.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[build-images] Authenticate in both org default registries

3 participants