Skip to content

Support stream (but keep pipeline backwards compatible) binding for Pipelines#13860

Open
oliy wants to merge 1 commit intomainfrom
oli/pipelines_stream
Open

Support stream (but keep pipeline backwards compatible) binding for Pipelines#13860
oliy wants to merge 1 commit intomainfrom
oli/pipelines_stream

Conversation

@oliy
Copy link
Copy Markdown
Contributor

@oliy oliy commented May 7, 2026

This reverts commit cf09891 and fixes additional items.

PIPE-374

Fixes the mismatch between original Pipeline bindings and v1 Pipeline entities. Specifically that we are binding to a Stream now, which then feeds the Pipeline that delivers traffic to a Sink. We preserve the original bindings to avoid breaking existing pipelines, but issue a warning of the deprecated usage.


  • 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): PIPE-633
    • Documentation not necessary because:

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


Open in Devin Review

@oliy oliy requested a review from workers-devprod as a code owner May 7, 2026 19:46
@oliy oliy added the run-remote-tests Run remote/E2E tests that require Cloudflare API credentials label May 7, 2026
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 7, 2026

🦋 Changeset detected

Latest commit: 6bcd95d

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 May 7, 2026
@workers-devprod workers-devprod requested review from a team and jamesopstad and removed request for a team May 7, 2026 19:47
@workers-devprod
Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • @cloudflare/wrangler
Show detailed file reviewers
  • .changeset/pipeline-stream-rename.md: [@cloudflare/wrangler]
  • fixtures/vitest-pool-workers-examples/pipelines/wrangler.jsonc: [@cloudflare/wrangler]
  • packages/miniflare/src/plugins/pipelines/index.ts: [@cloudflare/wrangler]
  • packages/workers-utils/src/config/environment.ts: [@cloudflare/wrangler]
  • packages/workers-utils/src/config/validation.ts: [@cloudflare/wrangler]
  • packages/workers-utils/src/map-worker-metadata-bindings.ts: [@cloudflare/wrangler]
  • packages/workers-utils/src/types.ts: [@cloudflare/wrangler]
  • packages/workers-utils/src/worker.ts: [@cloudflare/wrangler]
  • packages/workers-utils/tests/config/validation/normalize-and-validate-config.test.ts: [@cloudflare/wrangler]
  • packages/wrangler/e2e/remote-binding/miniflare-remote-resources.test.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/tests/api/startDevWorker/LocalRuntimeController.test.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/tests/create-worker-upload-form/bindings.test.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/tests/deploy/durable-objects.test.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/tests/deploy/get-remote-config-diff.test.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/tests/dev/remote-bindings.test.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/tests/init.test.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/tests/type-generation.test.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/api/startDevWorker/utils.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/deployment-bundle/create-worker-upload-form.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/dev/miniflare/index.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/preview/api.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/preview/shared.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/type-generation/index.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/type-generation/pipeline-schema.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/utils/print-bindings.ts: [@cloudflare/wrangler]

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

✅ All changesets look good

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 5 additional findings.

Open in Devin Review

Copy link
Copy Markdown
Contributor

@ask-bonk ask-bonk Bot left a comment

Choose a reason for hiding this comment

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

I'm Bonk, and I've done a quick review of your PR.

This PR renames pipeline to stream in pipeline bindings configuration, preserving backward compatibility with the deprecated pipeline field.

  1. Bug: Miniflare Zod schema silently drops pipeline field, breaking backward compatibility — The PipelineOptionsSchema uses a z.union of two object variants where both have their distinguishing key (stream / pipeline) as .optional(). Zod 3's default .strip() mode means { pipeline: "foo" } matches the first variant (stream object), and pipeline is silently stripped as an unknown key. The parse succeeds with {}, so opts.stream ?? opts.pipeline ?? "" resolves to "". This breaks all existing users who have pipeline: in their miniflare config during local dev. The fix is to use a single object schema with both fields optional instead of a union of two ambiguous object schemas. See inline suggestion.

Comment thread packages/miniflare/src/plugins/pipelines/index.ts Outdated
@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk Bot commented May 7, 2026

The review was successfully posted with both the summary and the inline suggestion comment.

I'm Bonk, and I've done a quick review of your PR.

This PR renames pipeline to stream in pipeline bindings configuration, preserving backward compatibility with the deprecated pipeline field.

1 issue found:

Bug: Miniflare Zod schema silently drops pipeline field, breaking backward compatibility — The PipelineOptionsSchema uses a z.union of two object variants where both have their distinguishing key (stream / pipeline) as .optional(). Zod 3's default .strip() mode means { pipeline: "foo" } matches the first variant (stream object), and pipeline is silently stripped as an unknown key. The parse succeeds with {}, so opts.stream ?? opts.pipeline ?? "" resolves to "". This breaks all existing users who have pipeline: in their miniflare config during local dev.

The fix (posted as an inline suggestion) is to collapse the two ambiguous object variants into a single z.object with both stream and pipeline as optional fields.

github run

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 7, 2026

create-cloudflare

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

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-shared

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

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-pool-workers

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

@cloudflare/workers-editor-shared

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

@cloudflare/workers-utils

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

wrangler

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

commit: 6bcd95d

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

Labels

run-remote-tests Run remote/E2E tests that require Cloudflare API credentials

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

2 participants