Skip to content

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

Open
oliy wants to merge 2 commits into
mainfrom
oli/pipelines_stream
Open

Support stream (but keep pipeline backwards compatible) binding for Pipelines#13860
oliy wants to merge 2 commits into
mainfrom
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):
    • Documentation not necessary because: covered later and tracked in PIPE-633

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: 89f375d

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

This PR includes changesets to release 7 packages
Name Type
wrangler Minor
@cloudflare/workers-utils Minor
miniflare Minor
@cloudflare/vite-plugin Major
@cloudflare/vitest-pool-workers Patch
@cloudflare/cli-shared-helpers Patch
@cloudflare/pages-shared Patch

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

workers-devprod commented May 7, 2026

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/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/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: 89f375d

@oliy oliy force-pushed the oli/pipelines_stream branch from bd3cc65 to 6bcd95d Compare May 7, 2026 19:55
@oliy oliy force-pushed the oli/pipelines_stream branch 2 times, most recently from 0b9b309 to a4ed9d6 Compare May 12, 2026 19:21
@jamesopstad jamesopstad requested review from petebacondarwin and removed request for jamesopstad May 13, 2026 18:33
@workers-devprod
Copy link
Copy Markdown
Contributor

workers-devprod commented May 13, 2026

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

@oliy oliy force-pushed the oli/pipelines_stream branch from bfd1312 to 328dae5 Compare May 14, 2026 07:23
Copy link
Copy Markdown
Contributor

@workers-devprod workers-devprod left a comment

Choose a reason for hiding this comment

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

Codeowners reviews satisfied

@github-project-automation github-project-automation Bot moved this from Untriaged to Approved in workers-sdk May 14, 2026
oliy and others added 2 commits May 14, 2026 17:25
Keeps the existing legacy `pipeline` binding test (now labelled as
legacy) and adds a parallel test that exercises the new `stream`
binding against the `preserve_e2e_pipelines` resource.
binding: string;
/** Name of the Pipeline to bind */
pipeline: string;
/** Name of the Stream to bind */
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

These should be Id, not name for both stream and pipeline

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: Approved

Development

Successfully merging this pull request may close these issues.

4 participants