Add regional and jurisdictional placement constraints#13571
Add regional and jurisdictional placement constraints#13571petebacondarwin merged 15 commits intocloudflare:mainfrom
Conversation
🦋 Changeset detectedLatest commit: 609a434 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 |
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
wrangler
commit: |
emily-shen
left a comment
There was a problem hiding this comment.
would you be able to add a test to containers/deploy.test.ts as well?
I added tests in |
There was a problem hiding this comment.
Devin Review found 1 new potential issue.
🐛 1 issue in files not directly in the diff
🐛 Jurisdiction validation is case-sensitive, rejecting valid uppercase input that normalization would handle (packages/workers-utils/src/config/validation.ts:3527-3528)
The jurisdiction validation in packages/workers-utils/src/config/validation.ts:3527-3528 checks !['eu', 'fedramp'].includes(constraints.jurisdiction) without lowercasing the input first. This means a user who writes jurisdiction = "EU" or jurisdiction = "FedRAMP" in their config will get a validation error. This is inconsistent with how regions is validated just below (validRegions.includes(region.toUpperCase()) at line 3549), which does case-insensitive comparison. The normalization code in packages/wrangler/src/containers/config.ts:118 calls .toLowerCase(), confirming case-insensitive input was intended. Since validation runs before normalization, any non-lowercase jurisdiction value will be rejected before it can be normalized. The test at packages/wrangler/src/__tests__/containers/config.test.ts:462 uses jurisdiction: "EU" and expects "eu" as output, but this only passes because the test bypasses validation via as Partial<Config> as Config.
View 5 additional findings in Devin Review.
It's not entirely redundant (there is some overlap though) because deploy also tests these values get passed to the API as expected. you could probably just set some jurisdiction/region values in an existing test in |
workers-devprod
left a comment
There was a problem hiding this comment.
Codeowners reviews satisfied
@emily-shen done! |
Fixes #13570
This merge request adds support for
constraints.regionsandconstraints.jurisdictionin the container configuration, allowing users to control where their containers run.