Repository navigation
[wrangler] Fetch the remote config diff from the configured compliance region - #16370
Conversation
When a Worker was last deployed from the dashboard, deploy and versions upload fetch its remote configuration (bindings, routes, custom domains, subdomain, environment metadata and cron triggers) to diff against the local config. fetchWorkerConfig passed COMPLIANCE_REGION_CONFIG_UNKNOWN for all six requests, so only the CLOUDFLARE_COMPLIANCE_REGION env var was honoured and the compliance_region field in the Wrangler config was ignored. A FedRAMP High Worker configured via the config file sent these requests to api.cloudflare.com and the deploy failed with 401s. fetchWorkerConfig and downloadWorkerConfig now take a ComplianceConfig. The deploy validation passes the loaded config, and `wrangler init --from-dash` keeps passing COMPLIANCE_REGION_CONFIG_UNKNOWN since it has no config file.
🦋 Changeset detectedLatest commit: 673c7fc The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 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 |
|
Codeowners approval required for this PR:
Show detailed file reviewers |
|
LGTM |
|
✅ Approved — No issues found. The compliance config now reaches all six remote-config requests. Every caller has been updated, and the new test covers both the config-file and the env-var cases. The decision is advisory: this comment never approves, blocks or requests changes on the pull request. ✅ All checks passed📋 Code Quality: ✅ LGTM
📝 Documentation: ✅ LGTMThe changeset bumps both Reviewed commit: |
@cloudflare/autoconfig
@cloudflare/build-output-utils
@cloudflare/codemods
@cloudflare/config
@cloudflare/containers-shared
create-cloudflare
@cloudflare/deploy-helpers
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-functions
@cloudflare/pages-shared
@cloudflare/runtime-types
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-plugin
@cloudflare/workers-auth
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
workers-devprod
left a comment
There was a problem hiding this comment.
Codeowners reviews satisfied
When a Worker was last deployed from the dashboard (
last_deployed_from === "dash"),wrangler deployandwrangler versions uploaddownload its remote configuration and diff it against the local config.fetchWorkerConfigsends six parallel requests for this (bindings, routes, custom domains, subdomain, environment metadata and cron triggers). All six passedCOMPLIANCE_REGION_CONFIG_UNKNOWN, so they only honoured theCLOUDFLARE_COMPLIANCE_REGIONenv var and ignoredcompliance_regionin the Wrangler config file.With
compliance_region: "fedramp_high"set in the config file, the rest of the deploy goes toapi.fed.cloudflare.com, but after a dashboard deploy these six requests went toapi.cloudflare.com. They failed with 401s and the deploy aborted. After the next successful Wrangler deploy,last_deployed_fromis no longerdashand the failure goes away. That made it look intermittent.This change passes a
ComplianceConfigthroughfetchWorkerConfig/downloadWorkerConfig. Deploy validation passes the loaded config.wrangler init --from-dashhas no config file, so it keeps passingCOMPLIANCE_REGION_CONFIG_UNKNOWN, which still honours the env var.The new test deploys a dash-deployed Worker with the region set in the config file, then again with it set in the env var. It checks that every request goes to
api.fed.cloudflare.com. Without the fix, the config-file case fails.