Support stream (but keep pipeline backwards compatible) binding for Pipelines#13860
Support stream (but keep pipeline backwards compatible) binding for Pipelines#13860
Conversation
🦋 Changeset detectedLatest 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 |
|
Codeowners approval required for this PR:
Show detailed file reviewers
|
|
✅ All changesets look good |
There was a problem hiding this 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.
- Bug: Miniflare Zod schema silently drops
pipelinefield, breaking backward compatibility — ThePipelineOptionsSchemauses az.unionof 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 (streamobject), andpipelineis silently stripped as an unknown key. The parse succeeds with{}, soopts.stream ?? opts.pipeline ?? ""resolves to"". This breaks all existing users who havepipeline: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.
|
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 1 issue found: Bug: Miniflare Zod schema silently drops The fix (posted as an inline suggestion) is to collapse the two ambiguous object variants into a single |
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
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.
A picture of a cute animal (not mandatory, but encouraged)