Add container image substitutions for private registries#47374
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot must enforce sha in the map |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
✅ PR Code Quality Reviewer completed the code quality review. |
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. |
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅ |
|
✅ Test Quality Sentinel completed test quality analysis. |
There was a problem hiding this comment.
Pull request overview
Adds repository-level container image substitutions for private registries, extending the existing action-pin mechanism.
Changes:
- Parses and validates
container_pinsfromaw.json. - Applies mappings during container resolution and MCP rendering.
- Adds tests and private-registry documentation.
Show a summary per file
| File | Description |
|---|---|
pkg/workflow/workflow_data.go |
Propagates container mappings into pin contexts. |
pkg/workflow/repo_config.go |
Parses container_pins. |
pkg/workflow/repo_config_test.go |
Tests digest validation. |
pkg/workflow/mcp_setup_generator.go |
Maps the MCP Gateway image. |
pkg/workflow/mcp_config_types.go |
Adds workflow context to MCP rendering. |
pkg/workflow/mcp_config_custom.go |
Maps custom MCP containers. |
pkg/workflow/docker.go |
Maps pre-downloaded images. |
pkg/workflow/docker_pin_test.go |
Tests mapped image resolution. |
pkg/workflow/copilot_mcp.go |
Passes mappings to Copilot rendering. |
pkg/workflow/compiler_string_api.go |
Loads mappings for string compilation. |
pkg/workflow/compiler_repo_config.go |
Copies mappings from repository configuration. |
pkg/workflow/compiler_orchestrator_workflow.go |
Attaches mappings during orchestration. |
pkg/workflow/codex_mcp.go |
Passes mappings to Codex renderers. |
pkg/workflow/action_pins.go |
Adds container mapping helpers. |
pkg/parser/schemas/repo_config_schema.json |
Defines container_pins validation. |
pkg/cli/data/agentic_workflows_fallback_aw_files.json |
Registers substitution guidance. |
pkg/actionpins/actionpins.go |
Implements mapping and notification logic. |
pkg/actionpins/actionpins_internal_test.go |
Tests mapping behavior and deduplication. |
docs/src/content/docs/reference/self-hosted-runners.md |
Documents private-registry configuration. |
.github/aw/action-container-substitutions.md |
Adds focused substitution guidance. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 20/20 changed files
- Comments generated: 3
- Review effort level: Medium
| // Apply container_pins mapping from aw.json before digest resolution so that | ||
| // redirected registries are pre-downloaded and recorded in the manifest. | ||
| img = applyContainerPinMappingFromData(img, workflowData) |
There was a problem hiding this comment.
Fixed in the commits following be0e488. All runtime container references now go through resolveGatewayContainerFromMappings: mcp_renderer_github.go at lines 178 and 235, mcp_config_playwright_renderer.go at line 117, mcp_renderer_builtin.go at lines 202 and 370 (DefaultAlpineImage in both TOML and JSON paths), and mcp_config_custom.go's container scalar property. Custom command: docker servers are covered via applyContainerPinMappingFromData in docker.go.
| renderMCPJSONScalar(yaml, renderer, "type", mcpConfig.Type, isLast) | ||
| case "container": | ||
| renderMCPStringScalar(yaml, renderer, "container", mcpConfig.Container, isLast) | ||
| container := applyContainerPinMappingFromData(mcpConfig.Container, renderer.WorkflowData) |
There was a problem hiding this comment.
Fixed in the commits following be0e488. renderMCPScalarProperty now routes the container field through resolveGatewayContainerFromMappings, which applies the container_pins redirect and strips any digest component before writing to the MCP Gateway container field. All built-in MCP renderers use the same helper.
Design Decision Gate - ADR RequiredThis PR makes significant changes to core business logic (379 new lines in Draft ADR committed: This PR cannot merge until an ADR is linked in the PR body. What to do next
Once an ADR is linked in the PR body, this gate will re-run and verify the implementation matches the decision. Why ADRs MatterADRs create a searchable, permanent record of why the codebase looks the way it does. Future contributors (and your future self) will thank you. Michael Nygard ADR Format ReferenceAn ADR must contain these four sections to be considered complete:
All ADRs are stored in
|
PR Triage
Score breakdown: Impact 38/50 · Urgency 20/30 · Quality 14/20 Rationale: Adds container image substitution for private registries. Touches 20 files across pkg/workflow, pkg/actionpins, schema, docs. Tests included, CI mostly passing. Code reviewer already posted. Ready for expedited human review given broad cross-package scope. Labels applied: pr-type:feature · pr-risk:medium · pr-priority:high · pr-action:fast_track · pr-agent:copilot
|
🧪 Test Quality Sentinel Report✅ Test Quality Score: 85/100 — Excellent
📊 Metrics (13 tests)
|
All open review feedback has been addressed:
All unit tests pass and code review/CodeQL scans are clean. CI re-trigger needed from a maintainer to get green checks. |
|
@copilot please run the Open review feedback to address:
|
…inContext invariant Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
All unresolved review threads addressed:
Local |
|
@copilot please run the
|
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
All open review items were addressed in prior commits; local validation is now fully clean:
Hand-off: CI must be re-triggered by a maintainer (close/reopen the PR, |
…elds Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…elds Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in the latest commit. {
"container_pins": {
"ghcr.io/owner/image:tag": {
"image": "registry.acme.com/image:tag",
"digest": "sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
}
}
}Changes:
|
|
@copilot please run the
|
Private-cloud environments can substitute action references through
action_pins, but container images still resolve to public registries. This adds equivalentcontainer_pinsconfiguration and documents both substitution mechanisms.Configuration
container_pinstoaw.jsonparsing and schema validation.Resolution
Documentation
{ "container_pins": { "node:lts-alpine": "registry.example.com/node:lts-alpine", "ghcr.io/github/gh-aw-firewall:0.27.22": "registry.example.com/gh-aw-firewall:0.27.22" } }Run: https://github.com/github/gh-aw/actions/runs/29952896403
Run: https://github.com/github/gh-aw/actions/runs/29952896403