Make resolveImages module-private in predownload and align tests to public API#3384
Conversation
resolveImages module-private in predownload and align tests to public API
|
| Metric | Base | PR | Delta |
|---|---|---|---|
| Lines | 95.55% | 95.48% | 📉 -0.07% |
| Statements | 95.36% | 95.29% | 📉 -0.07% |
| Functions | 96.76% | 96.55% | 📉 -0.21% |
| Branches | 88.16% | 87.91% | 📉 -0.25% |
📁 Per-file Coverage Changes (2 files)
| File | Lines (Before → After) | Statements (Before → After) |
|---|---|---|
src/commands/predownload.ts |
100.0% → 85.4% (-14.64%) | 100.0% → 85.4% (-14.64%) |
src/config-writer.ts |
83.0% → 85.6% (+2.54%) | 83.0% → 85.6% (+2.54%) |
Coverage comparison generated by scripts/ci/compare-coverage.ts
Smoke Test Results✅ GitHub API: 2 PR entries confirmed Status: PASS
|
There was a problem hiding this comment.
Pull request overview
This PR narrows the predownload command’s API surface by making resolveImages module-private and updating tests to validate behavior through the exported predownloadCommand entrypoint rather than importing an internal helper.
Changes:
- Removed the
exportfromresolveImagesinsrc/commands/predownload.ts. - Updated
src/commands/predownload.test.tsto stop importingresolveImagesand derivePredownloadOptionsfrompredownloadCommand.
Show a summary per file
| File | Description |
|---|---|
| src/commands/predownload.ts | Makes resolveImages a private helper to reduce public API surface. |
| src/commands/predownload.test.ts | Removes direct testing of resolveImages and aligns tests to the public predownloadCommand API. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comments suppressed due to low confidence (1)
src/commands/predownload.test.ts:18
- The removal of the dedicated
resolveImagestest suite drops coverage for several behaviors that are still implemented inpredownloadCommandvia the (now-private) resolver (e.g.,agentImage: 'act', custom registry/tag and digest metadata handling, custom image validation errors, and the api-proxy+cli-proxy combination). Since the intent is to test via the public command API, please add equivalent command-level tests for these cases so regressions in image selection/validation are still caught.
describe('predownload', () => {
describe('predownloadCommand', () => {
const defaults: PredownloadOptions = {
imageRegistry: 'ghcr.io/github/gh-aw-firewall',
imageTag: 'latest',
- Files reviewed: 2/2 changed files
- Comments generated: 0
🧪 Smoke Test: Copilot BYOK (Offline) Mode
Overall: PARTIAL — BYOK inference and MCP ✅; pre-computed step outputs were not substituted (raw PR author:
|
🔍 Smoke Test Results
Overall: PARTIAL — MCP confirmed working; pre-step outputs were not interpolated into the prompt. PR author:
|
|
Smoke test Codex:
Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "registry.npmjs.org"See Network Configuration for more information.
|
|
Smoke test result: FAIL. Connectivity and MCP tests failed. Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "localhost"See Network Configuration for more information.
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
Chroot Version Comparison Results
Overall: ❌ Not all versions match — Python and Node.js versions differ between host and chroot environments.
|
Smoke Test: GitHub Actions Services Connectivity
Overall: FAIL —
|
src/commands/predownload.tsexportedresolveImageseven though it had no production consumers outside the module. This left an unnecessary public symbol in the command API surface and tests were coupled to an internal helper.API surface cleanup
exportfromresolveImagesinsrc/commands/predownload.ts.predownloadCommand, so runtime behavior remains driven by the same internal resolver.Test alignment to public contract
src/commands/predownload.test.tsto stop importingresolveImages.PredownloadOptionsfrompredownloadCommandand kept assertions focused on command-level behavior (docker pullcalls, error paths, and option combinations).