Restore digest pinning for AWF 0.27.0 firewall sidecar images#38595
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Restores digest pinning for ghcr.io/github/gh-aw-firewall/* sidecar images at 0.27.0 so compiled lock files emit immutable image:tag@sha256:... references (matching existing pinned-image behavior for other containers).
Changes:
- Add missing embedded container pin entries for AWF firewall images at
0.27.0(agent, api-proxy, squid, cli-proxy) across the pin datasets. - Add a unit test ensuring embedded firewall pins are used when no action-cache pins are present.
- Add a compilation test asserting compiled lock output includes pinned firewall refs and AWF
imageTagdigest metadata forv0.27.0.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/docker_pin_test.go | Adds a unit test case validating embedded firewall pin fallback for agent:0.27.0. |
| pkg/workflow/docker_firewall_pin_compile_test.go | Adds a compilation regression test asserting pinned firewall refs appear in the lock output for AWF v0.27.0. |
| pkg/workflow/data/action_pins.json | Adds embedded container pins for AWF firewall images at 0.27.0 (workflow dataset). |
| pkg/actionpins/data/action_pins.json | Adds embedded container pins for AWF firewall images at 0.27.0 (embedded actionpins dataset). |
| .github/aw/actions-lock.json | Syncs repo lock pin dataset to include AWF firewall container pins at 0.27.0. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 5/5 changed files
- Comments generated: 1
| yamlStr := string(yaml) | ||
|
|
||
| expectedPins := map[string]string{ | ||
| "ghcr.io/github/gh-aw-firewall/agent:0.27.0": "sha256:3816d1692e6d96887b27f1e4f1d64b8d7edb43ed9d7506b8f203913cbb81c248", | ||
| "ghcr.io/github/gh-aw-firewall/api-proxy:0.27.0": "sha256:f28d2bd3197fb6ef9ec40ef345bbf2bb33e50151a8e72e89abb618fc3d0066eb", | ||
| "ghcr.io/github/gh-aw-firewall/squid:0.27.0": "sha256:d6a01d4cf3d928e6a7fc42e34afef228e753dce87646edc91d8a5cd0b612d9a6", | ||
| } | ||
|
|
||
| for image, digest := range expectedPins { | ||
| pinnedImage := image + "@" + digest | ||
| if !strings.Contains(yamlStr, `"image":"`+image+`","digest":"`+digest+`","pinned_image":"`+pinnedImage+`"`) { | ||
| t.Errorf("Expected manifest header to include pinned metadata for %s", image) | ||
| } | ||
| if !strings.Contains(yamlStr, "# - "+pinnedImage) { | ||
| t.Errorf("Expected pinned container comment for %s", image) | ||
| } | ||
| if !strings.Contains(yamlStr, pinnedImage) { | ||
| t.Errorf("Expected pinned download reference for %s", image) | ||
| } | ||
| } |
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. |
|
🧠 Matt Pocock Skills Reviewer was skipped during the skills-based review. |
|
✅ PR Code Quality Reviewer completed the code quality review. |
|
🧪 Test Quality Sentinel completed test quality analysis. |
✅ Design Decision Gate — Existing ADR Governs This ChangeADR reviewed: ADR-27762: Embedded Container Pin Fallback at Compile Time — this PR aligns with the stated decision. No new ADR required. 🏗️ The volume gate triggered (129 additions under 📋 Verification SummaryADR-27762 → Normative Spec → Embedded Pin Data Model, item 3:
This PR satisfies that requirement directly:
No divergence from the ADR was found. The diff contains no new abstractions, technology choices, or structural changes that would warrant a separate ADR.
|
🧪 Test Quality Sentinel Report✅ Test Quality Score: 85/100 — Excellent
📊 Metrics & Test Classification (2 tests analyzed)
Test Classification Details
Language SupportTests analyzed:
Verdict
📖 Understanding Test ClassificationsDesign Tests (High Value) verify what the system does:
Implementation Tests (Low Value) verify how the system does it:
Goal: Shift toward tests that describe the system's behavioral contract — the promises it makes to its users and collaborators. References: §27347350229
|
There was a problem hiding this comment.
One non-blocking gap in the new test coverage. The data additions and the embedded-fallback unit test case look correct.
### Finding details
imageTagPart missing cli-proxy assertion (docker_firewall_pin_compile_test.go line 76)
buildAWFImageTagWithDigests (in awf_helpers.go) checks five image specs — squid, agent, agent-act, api-proxy, and cli-proxy — and appends any whose digest is available. Now that cli-proxy:0.27.0 is in the embedded pins, the compiled imageTag for v0.27.0 will be 0.27.0,squid=...,agent=...,api-proxy=...,cli-proxy=.... The test asserts the first three components but not cli-proxy, leaving that part of the fix silently unverified.
Note: cli-proxy staying out of expectedPins (the container pull-list / manifest-header check) is correct — isCliProxyNeeded is false for the test workflow.
🔎 Code quality review by PR Code Quality Reviewer · ⌖ 13.5 AIC
| `0.27.0,`, | ||
| `agent=sha256:3816d1692e6d96887b27f1e4f1d64b8d7edb43ed9d7506b8f203913cbb81c248`, | ||
| `api-proxy=sha256:f28d2bd3197fb6ef9ec40ef345bbf2bb33e50151a8e72e89abb618fc3d0066eb`, | ||
| `squid=sha256:d6a01d4cf3d928e6a7fc42e34afef228e753dce87646edc91d8a5cd0b612d9a6`, |
There was a problem hiding this comment.
Missing cli-proxy digest assertion in imageTagPart checks: buildAWFImageTagWithDigests unconditionally appends cli-proxy=sha256:... to the AWF imageTag whenever that pin is available — and cli-proxy:0.27.0 is now embedded. The generated imageTag for v0.27.0 will be 0.27.0,squid=...,agent=...,api-proxy=...,cli-proxy=..., but the test does not verify the cli-proxy component. A regression that dropped cli-proxy from the imageTag computation would go undetected.
💡 Suggested fix
Add a sixth entry to the imageTagPart slice:
`squid=sha256:d6a01d4cf3d928e6a7fc42e34afef228e753dce87646edc91d8a5cd0b612d9a6`,
`cli-proxy=sha256:42529ecb9f90da5adb00593d268dfdbd35d14bb1dc92dd897286b27ce1e3d58d`,Note: cli-proxy intentionally stays out of expectedPins (the manifest-header / pull-list check), because isCliProxyNeeded is false for this test workflow. Only the AWF config imageTag field needs the extra assertion.
Compiling workflows with
gh aw v0.79.xleftgh-aw-firewall/{agent,api-proxy,squid}at:0.27.0tag-only references while other container images remained digest-pinned. This restores immutable pinning for those firewall images everywhere they are emitted in compiled lock files.Pin data
0.27.0container pins for:ghcr.io/github/gh-aw-firewall/agentghcr.io/github/gh-aw-firewall/api-proxyghcr.io/github/gh-aw-firewall/squidghcr.io/github/gh-aw-firewall/cli-proxyCompiled output behavior
collectDockerImages/applyContainerPinscan now resolve AWF0.27.0sidecars toimage:tag@sha256:...using embedded pins, matching existing behavior forgh-aw-mcpg,github-mcp-server, and other pinned images.imageTagdigest metadataRegression coverage
v0.27.0, asserting pinned firewall refs appear in the manifest, download step, and AWF configExample of the restored emitted form: