Authenticate container image pull for private image_ref - #36
Closed
shaur-k wants to merge 2 commits into
Closed
Conversation
The reusable workflow's container.image can be a private image_ref (e.g. a PR-specific image dispatched from a sister repo), but the container block had no credentials, so the pull was always anonymous and 403'd on a private registry. Add optional image_registry_username / image_registry_password secrets and a container credentials block. When unset the runner skips docker login and pulls anonymously, so the default public Docker Hub image and every existing caller are unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
📝 WalkthroughWalkthroughThe ChangesPrivate Container Registry Authentication
Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (1 error)
✅ Passed checks (3 passed)
Comment |
shaur-k
marked this pull request as ready for review
June 9, 2026 22:59
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/workspace_integration_test.yaml:
- Around line 122-137: Add a no-container preflight job that validates the pair
image_registry_username and image_registry_password are either both set or both
unset, and fail fast with a clear error message if only one is provided; name it
something like validate-registry-credentials and have
integration-test-in-studio-container depend on it so the runner will not attempt
image pulls with half-configured credentials. Specifically, implement the check
as a steps-only job (runs-on: ubuntu-latest, no container) that reads the
workflow inputs image_registry_username and image_registry_password and exits
non‑zero with a descriptive message when exactly one is present, then add a
needs: validate-registry-credentials to the integration-test-in-studio-container
job so integration-test-in-studio-container.container.credentials is only used
after the preflight passes.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 34e0b1ed-be37-496e-86de-e2e7b70143de
📒 Files selected for processing (1)
.github/workflows/workspace_integration_test.yaml
Add a steps-only validate-registry-credentials preflight that fails fast when exactly one of image_registry_username / image_registry_password is provided, and gate integration-test-in-studio-container on it. Prevents a half-configured pair from silently falling back to an anonymous pull and 403-ing in container init. Addresses the review on PR #36. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
A consuming repo's integration run (e.g.
moveit_pro_example_wsPR stacked on amoveit_proPR via theneeds:token) failed at Initialize containers with 403 whenimage_refpointed at a private image. Thecontainer:block setimage:to the (possibly private)image_refbut carried no credentials, so the runner pulled anonymously — which 403s on a private registry. Theimage_refdocstring already advertised private-image support the workflow couldn't actually authenticate.Brief description
Add optional
image_registry_username/image_registry_passwordsecrets and acontainer.credentialsblock fed by them. When the caller omits them (every current caller, pulling the public Docker Hub default), the username is empty and the runner skipsdocker login— anonymous pull, unchanged behavior. When supplied (privateimage_ref, e.g. a GitHub App token withread:packages), the pull authenticates.How it was tested
python3 -c "yaml.safe_load(...)"— YAML valid.actionlint 1.7.12on the workflow — 0 findings.docker login⇒ anonymous pull (existing public-image path).Companion change required (other repo)
This unblocks authentication but is not sufficient alone. The caller must (a) pass these two secrets, and (b) point
image_refat the registry where the per-PR image actually exists.moveit_pro_example_ws/.github/workflows/ci.yamlcurrently builds a GHCRimage_refwhilemoveit_propublishes the customer image to Docker Hub — that ref must be reconciled (and the matching credentials passed) for the stacked-PR integration run to go green.