Skip to content

Bypass container image validation when rollout_kind: none is set#13757

Open
nikitassharma wants to merge 13 commits into
mainfrom
nsharma/rollout-none
Open

Bypass container image validation when rollout_kind: none is set#13757
nikitassharma wants to merge 13 commits into
mainfrom
nsharma/rollout-none

Conversation

@nikitassharma

@nikitassharma nikitassharma commented Apr 30, 2026

Copy link
Copy Markdown
Member

Fixes CC-7586

Setting rollout_kind: none for an existing container skips making any changes
to, or rolling out that container. It behaves as a no-op for new containers.
Update the output to more explicitly describe this behavior, and make the image
field optional for existing containers that skip rollouts.

rollout_kind: none can be used when trying to deploy worker changes without
triggering a rollout for any containers.


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: rollout_kind is not a documented option

A picture of a cute animal (not mandatory, but encouraged)
image


Open in Devin Review

@changeset-bot

changeset-bot Bot commented Apr 30, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 69d7d56

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-project-automation github-project-automation Bot moved this to Untriaged in workers-sdk Apr 30, 2026
@workers-devprod
workers-devprod requested review from a team and emily-shen and removed request for a team April 30, 2026 14:21
@workers-devprod

workers-devprod commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • @cloudflare/cloudchamber
  • @cloudflare/wrangler
Show detailed file reviewers
  • packages/containers-shared/src/types.ts: [@cloudflare/cloudchamber @cloudflare/wrangler]
  • packages/vite-plugin-cloudflare/src/containers.ts: [@cloudflare/wrangler]
  • packages/workers-utils/src/config/environment.ts: [@cloudflare/wrangler]
  • packages/workers-utils/src/config/validation.ts: [@cloudflare/wrangler]
  • packages/workers-utils/tests/config/validation/normalize-and-validate-config.test.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/tests/containers/deploy.test.ts: [@cloudflare/cloudchamber @cloudflare/wrangler]
  • packages/wrangler/src/tests/containers/push.test.ts: [@cloudflare/cloudchamber @cloudflare/wrangler]
  • packages/wrangler/src/api/startDevWorker/LocalRuntimeController.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/containers/build.ts: [@cloudflare/cloudchamber @cloudflare/wrangler]
  • packages/wrangler/src/containers/config.ts: [@cloudflare/cloudchamber @cloudflare/wrangler]
  • packages/wrangler/src/containers/deploy.ts: [@cloudflare/cloudchamber @cloudflare/wrangler]
  • packages/wrangler/src/utils/print-bindings.ts: [@cloudflare/wrangler]

@github-actions

github-actions Bot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

✅ All changesets look good

@ask-bonk

ask-bonk Bot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

OK, so for a new container with rollout_kind: "none" and an image, the application will be created. That seems intentional — the initial creation has to happen, and rollout_kind: "none" only skips modifications/rollouts on existing applications.

The overall logic is sound. The changes properly handle all the edge cases:

  • Existing container + rollout_kind: "none" → skip
  • New container + rollout_kind: "none" + no image → error
  • New container + rollout_kind: "none" + image → create normally
  • Existing container + rollout_kind: "none" + no image → skip (no image needed since we skip)

The tests cover all these cases. The type changes are consistent across the codebase. The validation properly allows the missing image only when rollout_kind: "none".

LGTM

github run

devin-ai-integration[bot]

This comment was marked as resolved.

nikitassharma and others added 2 commits April 30, 2026 09:25
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@pkg-pr-new

pkg-pr-new Bot commented Apr 30, 2026

Copy link
Copy Markdown
create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@13757

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@13757

miniflare

npm i https://pkg.pr.new/miniflare@13757

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@13757

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@13757

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@13757

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@13757

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@13757

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@13757

wrangler

npm i https://pkg.pr.new/wrangler@13757

commit: 69d7d56

@devin-ai-integration devin-ai-integration Bot 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.

Devin Review found 1 new potential issue.

🐛 1 issue in files not directly in the diff

🐛 Vite plugin getContainerOptions doesn't handle undefined image, producing invalid image_uri: undefined (packages/vite-plugin-cloudflare/src/containers.ts:47-56)

The PR made ContainerApp.image optional (packages/workers-utils/src/config/environment.ts:115), but packages/vite-plugin-cloudflare/src/containers.ts was not updated to handle this new case. When container.image is undefined (e.g. rollout_kind: none without an image), isDockerfile(undefined, configPath) returns false (correctly), but the else branch at line 47 sets image_uri: container.image which is undefined. This produces an object with an invalid image_uri: undefined instead of throwing an error like the equivalent wrangler code does in packages/wrangler/src/api/startDevWorker/LocalRuntimeController.ts:494-497. Downstream consumers (e.g. prepareContainerImagesForDev) would then attempt to pull a container with an undefined image URI, causing confusing runtime failures.

View 9 additional findings in Devin Review.

Open in Devin Review

# Conflicts:
#	packages/wrangler/src/containers/deploy.ts

@emily-shen emily-shen 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.

i am a bit confused - why would we want to let people remove the image field when they are intentionally deploying something with a container, just not updating the container?

@nikitassharma

Copy link
Copy Markdown
Member Author

i am a bit confused - why would we want to let people remove the image field when they are intentionally deploying something with a container, just not updating the container?

Since setting rollout_kind: none bypasses container updates, it can be used if someone wants to split how they manage containers/workers. With workers managed through wrangler and containers managed through the API. In this situation, the image in the wrangler config drifts from reality.

This change is intended to allow a minimal wrangler config that reflects reality without having to update a config file when a container change is rolled out elsewhere.

@emily-shen emily-shen 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.

oh also i realised i never merged #12656

should we get that in first? i can do that today
probably best to do that one after

@nikitassharma

Copy link
Copy Markdown
Member Author

ooh missed that one, yeah that would be great!

@nikitassharma
nikitassharma marked this pull request as draft May 4, 2026 16:50
@nikitassharma
nikitassharma force-pushed the nsharma/rollout-none branch from 204cf2b to 52be9d8 Compare May 4, 2026 16:50
@nikitassharma
nikitassharma force-pushed the nsharma/rollout-none branch from 52be9d8 to 634c6d3 Compare May 6, 2026 14:52
@nikitassharma
nikitassharma marked this pull request as ready for review May 6, 2026 16:46
@workers-devprod

workers-devprod commented May 6, 2026

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • @cloudflare/wrangler
  • ✅ @cloudflare/cloudchamber
Show detailed file reviewers
  • .changeset/honest-sides-tap.md: [@cloudflare/wrangler]
  • packages/containers-shared/src/types.ts: [@cloudflare/wrangler]
  • packages/vite-plugin-cloudflare/src/containers.ts: [@cloudflare/wrangler]
  • packages/workers-utils/src/config/environment.ts: [@cloudflare/wrangler]
  • packages/workers-utils/src/config/validation.ts: [@cloudflare/wrangler]
  • packages/workers-utils/tests/config/validation/normalize-and-validate-config.test.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/tests/containers/deploy.test.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/api/startDevWorker/LocalRuntimeController.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/containers/build.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/containers/config.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/containers/deploy.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/utils/print-bindings.ts: [@cloudflare/wrangler]

@devin-ai-integration devin-ai-integration Bot 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.

Devin Review found 1 new potential issue.

View 14 additional findings in Devin Review.

Open in Devin Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

5 participants