Skip to content

fix(ci): reduce supply-chain scan timeouts with PR-image shards - #11399

Merged
lpcox merged 1 commit into
mainfrom
lpcox-supply-chain-scan-timeout
Nov 10, 2026
Merged

lpcox merged 1 commit into
mainfrom
lpcox-supply-chain-scan-timeout

Conversation

@lpcox

@lpcox lpcox commented Nov 10, 2026

Copy link
Copy Markdown
Collaborator

Why

The PR-image scan in run 42742678454 exhausted its 40-minute job limit. The build-tools apt layer alone took 2,164.7 seconds (36m 5s): index downloads took 9m 12s and package downloads took 25m 46s. Build-tools completed and Grype ran, but the job was cancelled shortly after the next image build began. This was slow native-amd64 package retrieval, not a demonstrated CVE rejection or compilation failure.

Changes

  • Split PR-image builds into three independent matrix jobs: build-tools + enclave-agent, agent, and the six remaining service images. Each PR-image job gets 60 minutes, instead of all nine builds sharing one 40-minute budget.
  • Keep build-tools and enclave-agent on the same runner, using the exact locally built base without pulling a replacement. Reject empty/unknown shard definitions and an enclave-agent shard without build-tools.
  • Preserve all nine blocking High/Critical image scans, pinned scanners, refreshed Grype DB, daily UTC package-cache scopes, sequential per-shard builds and per-image builder/archive/image cleanup. Native ubuntu-latest runners are unchanged; no emulation is introduced.
  • Keep compilation, published-image CVE and license scans, their report-only policy, and the stable required aggregate check. Report-only jobs retain 40-minute limits; matrix fail-fast remains disabled.
  • Extend executable workflow regressions across every shard, including build/cache-export/scan/archive failures, exact-base retention, daily freshness, disk lifetime, complete image coverage, and invalid selections. Document the new budgets and topology.

Validation

  • npm exec --no -- jest scripts/ci/docker-registry-ci.test.ts scripts/ci/cloud-hypervisor-enclave-artifacts.test.ts scripts/ci/apt-mirror-dockerfiles.test.ts --runInBand — 114 tests passed.
  • npm run type-check — passed.
  • actionlint .github/workflows/supply-chain-scan.yml — passed.
  • git diff --check — passed.

Limitations: Local Docker is installed but its daemon is unavailable, so no Linux image build or live throughput comparison was run. Existing failed-run logs confirm the slow apt transfers; the tests execute the real embedded workflow scripts with mocked Docker boundaries. Sharding isolates slow downloads and adds headroom but cannot guarantee completion during a prolonged upstream outage. It adds two hosted-runner jobs and their scanner/cache setup overhead. No manual workflow dispatch, mirror change, merge, or auto-merge enablement.

Created from current main in an isolated worktree; unrelated edits from the original checkout are not included.

Keep build-tools and enclave-agent on the same runner, isolate agent and service builds, and allow each PR-image shard 60 minutes. Preserve daily cache freshness, per-image cleanup, and the aggregate security gate.

Co-authored-by: Copilot App <[email protected]>
Copilot AI adaptive review requested due to automatic review settings November 10, 2026 06:12
@github-actions

Copy link
Copy Markdown
Contributor

Documentation Preview

Documentation has been built for this PR.

Download preview artifact

To view locally:

  1. Download the docs-preview-pr-11399 artifact from the workflow run
  2. Unzip and open index.html in your browser

Built from commit d316504

@github-actions

Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 93.83% 93.83% ➡️ +0.00%
Statements 92.38% 92.38% ➡️ +0.00%
Functions 93.06% 93.06% ➡️ +0.00%
Branches 86.75% 86.75% ➡️ +0.00%
📁 Per-file Coverage Changes (1 files)
File Lines (Before → After) Statements (Before → After)
src/enclave/host-executor-server.ts 91.2% → 91.2% (+0.00%) 90.1% → 89.8% (-0.29%)

Coverage comparison generated by scripts/ci/compare-coverage.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The shard coverage test uses a hard-coded list instead of the build script’s container inventory, allowing newly added images to miss blocking scans without failing CI.

1 open issue
What changed in this PR

Reduces timeout risk in AWF’s supply-chain gate by distributing PR-image builds across three runners, while preserving blocking High/Critical scans and the stable aggregate check.

Changes:

  • Gives each PR-image shard 60 minutes; published-image CVE and license scans retain 40-minute limits.
  • Keeps build-tools and enclave-agent together and validates shard selections.
  • Extends regression coverage and documents the new topology and budgets.
File Description
scripts/​ci/​docker-registry-ci.test.ts Adds per-shard checks for image coverage, failures, caching, and cleanup.
docs/​INTEGRATION-TESTS.md Documents shard grouping, time budgets, and aggregate-check behavior.
.github/​workflows/​supply-chain-scan.yml Defines three PR-image shards with separate budgets and validated image selections.

Review effort: Max (auto)

Comment on lines +439 to +444
const images = prShards.flatMap(shard => shard.images!);
expect([...images].sort()).toEqual([
'agent', 'api-proxy', 'build-tools', 'cli-proxy', 'enclave-agent',
'enclave-mcp-server', 'enclave-script', 'gh-aw-node', 'router',
]);
expect(new Set(images).size).toBe(images.length);
@lpcox
lpcox merged commit 589ab57 into main Nov 10, 2026
46 of 47 checks passed
@lpcox
lpcox deleted the lpcox-supply-chain-scan-timeout branch November 10, 2026 15:15
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.

2 participants