Repository navigation
fix(workers-utils): validate optional D1 database binding fields - #14530
Merged
petebacondarwin merged 2 commits intoJul 6, 2026
Merged
Conversation
…onfig fields Add optional string validation checks for database_name, migrations_dir, migrations_table, and database_internal_env inside validateD1Binding. This aligns D1's validation behavior with other bindings (like KV, R2, and Durable Objects) that typecheck all optional parameters.
🦋 Changeset detectedLatest commit: 9f72fbc The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
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 |
workers-devprod
requested review from
a team and
petebacondarwin
and removed request for
a team
July 3, 2026 08:48
Contributor
|
Codeowners approval required for this PR:
Show detailed file reviewers |
@cloudflare/autoconfig
create-cloudflare
@cloudflare/deploy-helpers
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-auth
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
petebacondarwin
requested changes
Jul 3, 2026
petebacondarwin
left a comment
Contributor
There was a problem hiding this comment.
Thanks for submitting this PR @Partha-Shankar - in order to land it we need a few additional items:
- please update the PR description with the checkboxes from the PR template properly selected - this is a requirement to pass our PR description CI check
- please add a changeset, with
patchtype, describing the change - please update the validation tests to check the changes you have made
petebacondarwin
marked this pull request as draft
July 3, 2026 09:19
… database fields Also add changeset for type validation of optional D1 configuration fields.
Contributor
Author
|
Thanks for the feedback! I've addressed the requested changes:
All checks are now passing. |
Partha-Shankar
marked this pull request as ready for review
July 4, 2026 06:23
petebacondarwin
approved these changes
Jul 6, 2026
workers-devprod
approved these changes
Jul 6, 2026
workers-devprod
left a comment
Contributor
There was a problem hiding this comment.
Codeowners reviews satisfied
Merged
colinhacks
added a commit
to colinhacks/workers-sdk
that referenced
this pull request
Jul 8, 2026
Adding one entry to the recognised-package-manager list is additive, same scale as the D1-bindings validation changeset (cloudflare#14530), not a headline feature on the order of cloudflare#14474 (cache options for WorkerEntrypoint exports) — patch fits workers-utils' own convention better than minor.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds missing type validation for optional D1 database binding configuration fields in
@cloudflare/workers-utils.Previously, the following optional fields were recognised by the validator but were not type-checked:
database_namemigrations_dirmigrations_tabledatabase_internal_envThis change validates these fields as optional strings using the existing validation pattern, making D1 binding validation consistent with other binding types such as KV, R2, and Durable Objects.
Tests
Public documentation