Skip to content

Miniflare config followups - #15130

Open
emily-shen wants to merge 4 commits into
mainfrom
emily/miniflare-fixups
Open

Miniflare config followups#15130
emily-shen wants to merge 4 commits into
mainfrom
emily/miniflare-fixups

Conversation

@emily-shen

@emily-shen emily-shen commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Each commit contains a fixup

  1. remove hasAssetsAndIsVitest - This is dead code, assets has not worked in vitest for a while.
  2. remove remote option from workflow config - Workflows' config had an option for remote but this never worked.
  3. add r2 s3 credentials - this is in wrangler config, but not cloudflare config, and therefore wasn't inherited into miniflare. so we incorrectly extended this in miniflare previously.
  4. make name requried for AE binding - workerd requires this, but it is not required at deploy time i think? either way, to prevent workerd crashing, we set a default.

  • 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: fixups

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

@changeset-bot

changeset-bot Bot commented Aug 11, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1cfafe6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 10 packages
Name Type
@cloudflare/config Patch
miniflare Major
wrangler Patch
@cloudflare/build-output-utils Patch
@cloudflare/vite-plugin Patch
@cloudflare/deploy-helpers Patch
@cloudflare/pages-shared Patch
@cloudflare/remote-bindings Patch
@cloudflare/runtime-types Patch
@cloudflare/vitest-pool-workers Patch

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

@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

✅ All changesets look good

@ask-bonk

ask-bonk Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

No deploy-time reliance on workflow remote. The two removals are clean, dead-code eliminations with:

  • Full removal of all references verified
  • Graceful degradation in miniflare (reads binding.remote which is now always undefined)
  • A soft-warning migration path for users with remote still in config
  • Appropriate changesets

I've reviewed both commits thoroughly. The changes are consistent, all references are cleaned up, downstream code degrades gracefully, and the tests properly cover the new warning behavior. No logic bugs, security issues, backward-compat violations, or incorrect API behavior found.

LGTM

github run

@emily-shen
emily-shen force-pushed the emily/miniflare-fixups branch from a990bc3 to ad7762d Compare August 12, 2026 11:11
@emily-shen
emily-shen force-pushed the emily/miniflare-fixups branch from ad7762d to 1cfafe6 Compare August 12, 2026 14:15
@pkg-pr-new

pkg-pr-new Bot commented Aug 12, 2026

Copy link
Copy Markdown
@cloudflare/autoconfig

npm i https://pkg.pr.new/@cloudflare/autoconfig@15130

@cloudflare/build-output-utils

npm i https://pkg.pr.new/@cloudflare/build-output-utils@15130

@cloudflare/config

npm i https://pkg.pr.new/@cloudflare/config@15130

create-cloudflare

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

@cloudflare/deploy-helpers

npm i https://pkg.pr.new/@cloudflare/deploy-helpers@15130

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-functions

npm i https://pkg.pr.new/@cloudflare/pages-functions@15130

@cloudflare/pages-shared

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

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-pool-workers

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

@cloudflare/workers-auth

npm i https://pkg.pr.new/@cloudflare/workers-auth@15130

@cloudflare/workers-editor-shared

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

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@15130

wrangler

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

commit: 1cfafe6

@emily-shen
emily-shen marked this pull request as ready for review August 12, 2026 14:48
@workers-devprod
workers-devprod requested review from a team and edmundhung and removed request for a team August 12, 2026 14:49
@workers-devprod

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • @cloudflare/wrangler
Show detailed file reviewers
  • .changeset/default-analytics-engine-name.md: [@cloudflare/wrangler]
  • .changeset/inherit-r2-creds-config.md: [@cloudflare/wrangler]
  • .changeset/remove-miniflare-vitest-assets-flag.md: [@cloudflare/wrangler]
  • .changeset/remove-workflow-remote-config.md: [@cloudflare/wrangler]
  • .changeset/reshape-miniflare-r2-s3-credentials.md: [@cloudflare/wrangler]
  • packages/config/src/tests/convert.test.ts: [@cloudflare/wrangler]
  • packages/config/src/bindings.ts: [@cloudflare/wrangler]
  • packages/config/src/convert.ts: [@cloudflare/wrangler]
  • packages/config/src/index.ts: [@cloudflare/wrangler]
  • packages/config/src/schema.ts: [@cloudflare/wrangler]
  • packages/config/src/worker-definition.ts: [@cloudflare/wrangler]
  • packages/deploy-helpers/src/deploy/helpers/config-diffs.ts: [@cloudflare/wrangler]
  • packages/deploy-helpers/src/deploy/helpers/print-bindings.ts: [@cloudflare/wrangler]
  • packages/miniflare/src/config/schema.ts: [@cloudflare/wrangler]
  • packages/miniflare/src/config/v4-convert.ts: [@cloudflare/wrangler]
  • packages/miniflare/src/config/v4-schema.ts: [@cloudflare/wrangler]
  • packages/miniflare/src/plugins/r2/index.ts: [@cloudflare/wrangler]
  • packages/miniflare/test/config/schema.spec.ts: [@cloudflare/wrangler]
  • packages/miniflare/test/config/v4-convert.spec.ts: [@cloudflare/wrangler]
  • packages/miniflare/test/plugins/r2/s3.spec.ts: [@cloudflare/wrangler]
  • packages/vitest-pool-workers/src/pool/config.ts: [@cloudflare/wrangler]
  • packages/workers-utils/src/config/binding-local-support.ts: [@cloudflare/wrangler]
  • packages/workers-utils/src/config/environment.ts: [@cloudflare/wrangler]
  • packages/workers-utils/src/config/validation.ts: [@cloudflare/wrangler]
  • packages/workers-utils/src/worker.ts: [@cloudflare/wrangler]
  • packages/workers-utils/tests/config/validation/normalize-and-validate-config.test.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/tests/deploy/get-remote-config-diff.test.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/tests/workflows.test.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/dev/miniflare/index.ts: [@cloudflare/wrangler]

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

View 1 additional finding in Devin Review.

Open in Devin Review

Comment on lines -186 to -190
if (normalizedConfig.workflows?.length) {
normalizedConfig.workflows = normalizedConfig.workflows.map(
({ remote: _, ...binding }) => binding
);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Leftover remote setting on a Workflow binding makes deploy report a fake configuration change

The step that hides the Workflow binding's remote setting before comparing local and deployed configuration was deleted (removeRemoteConfigFieldFromBindings in packages/deploy-helpers/src/deploy/helpers/config-diffs.ts:186-190), so any project that still has that setting in its config file is told its deployed configuration differs when it does not.

Impact: Users upgrading with an old remote entry on a workflow see a bogus, non-destructive-looking config difference (and possibly an extra confirmation prompt) during deploy.

Why the stale field survives validation and reaches the diff

validateWorkflowBinding in packages/workers-utils/src/config/validation.ts:2987-2995 no longer lists remote as an allowed key, but validateAdditionalProperties only emits a warning — it does not delete the key, and normalizeAndValidateConfig passes the raw workflow objects through untouched (packages/workers-utils/src/config/validation.ts:1700-1712). The resolved local config therefore still contains remote: true|false on each workflow entry. In normalizeRemoteConfigAsResolvedLocal the API-returned workflows array overrides the local one wholesale, and the API never returns remote, so diffJsonObjects reports a difference. The test at packages/wrangler/src/__tests__/deploy/get-remote-config-diff.test.ts:507-513 had to drop remote: false for the "no diff" expectation to keep passing, which confirms the new behaviour.

Prompt for agents
Removing `remote` from the Workflow binding type also removed the normalization step in packages/deploy-helpers/src/deploy/helpers/config-diffs.ts that stripped `remote` from `normalizedConfig.workflows` before diffing local against remote config. Because config validation only warns about unexpected fields (validateAdditionalProperties in packages/workers-utils/src/config/validation.ts) and does not remove them, existing user configs that still contain `remote` on workflow bindings keep that key in the resolved local config, producing a spurious diff during `wrangler deploy`. Consider either keeping the stripping step for backwards compatibility, or making config normalization actually drop the deprecated `remote` key from workflow bindings.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +1 to +3
---
"@cloudflare/config": patch
---

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changeset for the new R2 local credentials option is classified as a bug fix instead of a feature

The changeset adding the new localDev.experimentalS3Credentials configuration option to @cloudflare/config is declared as patch, but repository changeset rules classify new configuration options / new API capabilities as minor.

Impact: The package will be released with a version bump that understates the added functionality.

Rule reference

REVIEW.md — "Minor (new features): ... new commands/flags/options, new API capabilities or exports, behavior changes that add functionality." .changeset/README.md also lists "new configuration options" and "changes to pre-1.0 features" as minor. The change adds a brand-new localDev.experimentalS3Credentials field to the shared R2 binding shape (packages/config/src/bindings.ts:380-387, packages/config/src/schema.ts:59-69).

Suggested change
---
"@cloudflare/config": patch
---
---
"@cloudflare/config": minor
---
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

2 participants