Skip to content

feat(wb): reuse published container images from committed contexts - #1602

Merged
ponharu merged 10 commits into
mainfrom
reuse-committed-cloudflare-container-images
Nov 4, 2026
Merged

ponharu merged 10 commits into
mainfrom
reuse-committed-cloudflare-container-images

Conversation

@ponharu

@ponharu ponharu commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Why

Cloudflare container images rebuilt on separate CI runners can have different digests even when their committed build context is unchanged. Publishing those rebuilds can trigger unnecessary container replacements.

Requirements

required: not recorded — ask the requester

Customer Summary

Adds the opt-in wb deploy --reuse-container-images option to reuse a published container image when its committed build inputs are unchanged.

Technical Summary

  • Derive a registry tag from the effective Worker name, committed Git context, Dockerfile path, build variables, and target platform.
  • Build missing images from a Git archive and reject uncommitted tracked context changes.
  • Substitute account-relative registry image references before Wrangler's dry run, preserving config-relative paths and migration ordering.
  • Share explicit config selection and sanitized deployment environments across Wrangler commands; let Wrangler resolve account and registry hosts.
  • Load single-platform Docker images before publishing, and clean temporary contexts/configs on success, failure, and handled shutdown signals.
  • Document the supported build-context constraints in the wb README and repository rules.

Testing

  • bun run verify passed.
  • bun wb test test/unit/containerImages.test.ts (from packages/wb): 21 cases passed with 90 assertions, covering cross-checkout reuse, target isolation, changed inputs, container identifiers/build arguments, registry/account selection, profile environment isolation, root/workspace contexts, vinext paths, dirty contexts, and cancellation/failure cleanup.
  • Full local verification encountered existing process-lifecycle test timeouts outside the changed code; a focused rerun of the failing case passed.
  • A real Docker scratch build produced an inspectable linux/amd64 image with --load --provenance=false; its temporary image was removed.
  • A real Wrangler dry run accepted account-relative image references without invoking Docker.
  • All four current-head PR checks passed.
  • No live deployment was performed.

Notes

The Requirements section uses the missing-request fallback because no public implementation specification is linked.
Build contexts are exported from Git; untracked files are not available to image builds. Changes to tracked context files can cause a rebuild even when Docker would ignore them.

Co-authored-by: WillBooster (Codex CLI) <agent@willbooster.com>
@ponharu ponharu self-assigned this Nov 4, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

ponharu and others added 9 commits November 4, 2026 14:18
…ation

Co-authored-by: WillBooster (Codex CLI) <agent@willbooster.com>
…ands

Co-authored-by: WillBooster (Codex CLI) <agent@willbooster.com>
…d arguments

Co-authored-by: WillBooster (Codex CLI) <agent@willbooster.com>
…ages

Co-authored-by: WillBooster (Codex CLI) <agent@willbooster.com>
Co-authored-by: WillBooster (Codex CLI) <agent@willbooster.com>
Co-authored-by: WillBooster (Codex CLI) <agent@willbooster.com>
Co-authored-by: WillBooster (Codex CLI) <agent@willbooster.com>
Co-authored-by: WillBooster (Codex CLI) <agent@willbooster.com>
Co-authored-by: WillBooster (Codex CLI) <agent@willbooster.com>
@ponharu
ponharu merged commit 0e2037d into main Nov 4, 2026
5 checks passed
@ponharu
ponharu deleted the reuse-committed-cloudflare-container-images branch November 4, 2026 06:53
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.

1 participant