Skip to content

[miniflare] Fix mixed pipelines records#12987

Merged
petebacondarwin merged 1 commit into
mainfrom
pbacondarwin/fix-mixed-pipelines-binding
Mar 21, 2026
Merged

[miniflare] Fix mixed pipelines records#12987
petebacondarwin merged 1 commit into
mainfrom
pbacondarwin/fix-mixed-pipelines-binding

Conversation

@petebacondarwin
Copy link
Copy Markdown
Contributor

@petebacondarwin petebacondarwin commented Mar 20, 2026

Fixes the same schema validation bug as was fixed for r2Buckets, kvNamespaces, and d1Databasespipelines bindings could not mix plain string values and object values in the same record.

Previously, passing a config like:

new Miniflare({
  pipelines: {
    LOCAL_PIPELINE: "local-pipeline",
    REMOTE_PIPELINE: { pipeline: "remote-pipeline", remoteProxyConnectionString: ... },
  },
})

would throw a Zod validation error because the schema used two separate z.record(...) union branches — one accepting only strings, one accepting only objects. Zod would fail both branches when the values were mixed.

The fix collapses the two z.record(...) branches into a single z.record(z.union([z.string(), z.object({...})])), matching the pattern already applied to r2Buckets. The bindingEntries() local helper already handled mixed values correctly at runtime (typeof opts === "string") — only the schema validation was too restrictive. The helper's TypeScript parameter type has also been updated to reflect the new union.


  • 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: this is a bug fix for an internal schema validation constraint; no public API surface changed

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


Open with Devin

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 20, 2026

🦋 Changeset detected

Latest commit: 492538a

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

@petebacondarwin petebacondarwin force-pushed the pbacondarwin/fix-mixed-pipelines-binding branch from 4f1b65e to 9a1255d Compare March 20, 2026 15:08
@github-project-automation github-project-automation Bot moved this to Untriaged in workers-sdk Mar 20, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 20, 2026

✅ All changesets look good

@petebacondarwin petebacondarwin marked this pull request as ready for review March 20, 2026 15:11
@petebacondarwin petebacondarwin requested a review from a team as a code owner March 20, 2026 15:11
@workers-devprod
Copy link
Copy Markdown
Contributor

workers-devprod commented Mar 20, 2026

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

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 2 additional findings.

Open in Devin Review

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Mar 20, 2026

create-cloudflare

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

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-shared

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

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-pool-workers

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

@cloudflare/workers-editor-shared

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

wrangler

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

commit: 492538a

@github-project-automation github-project-automation Bot moved this from Untriaged to Approved in workers-sdk Mar 20, 2026
@petebacondarwin petebacondarwin force-pushed the pbacondarwin/fix-mixed-pipelines-binding branch from 9a1255d to 492538a Compare March 20, 2026 21:51
@petebacondarwin petebacondarwin merged commit f8516dd into main Mar 21, 2026
45 checks passed
@petebacondarwin petebacondarwin deleted the pbacondarwin/fix-mixed-pipelines-binding branch March 21, 2026 16:04
@github-project-automation github-project-automation Bot moved this from Approved to Done in workers-sdk Mar 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants