fix(miniflare): decouple KV plugin from Secrets Store plugin to avoid service name conflicts#9106
Conversation
🦋 Changeset detectedLatest commit: 9ad0ae2 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 |
|
A Wrangler prerelease is available for testing. You can install this latest build in your project with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/15183895082/npm-package-wrangler-9106Prereleases for other packages:
wget https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/15183895082/npm-package-cloudflare-workers-bindings-extension-9106 -O ./cloudflare-workers-bindings-extension.0.0.0-vfac1e8d94.vsix && code --install-extension ./cloudflare-workers-bindings-extension.0.0.0-vfac1e8d94.vsix
npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/15183895082/npm-package-create-cloudflare-9106 --no-auto-update
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/15183895082/npm-package-cloudflare-kv-asset-handler-9106
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/15183895082/npm-package-miniflare-9106
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/15183895082/npm-package-cloudflare-pages-shared-9106
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/15183895082/npm-package-cloudflare-unenv-preset-9106
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/15183895082/npm-package-cloudflare-vite-plugin-9106
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/15183895082/npm-package-cloudflare-vitest-pool-workers-9106
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/15183895082/npm-package-cloudflare-workers-editor-shared-9106
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/15183895082/npm-package-cloudflare-workers-shared-9106
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/15183895082/npm-package-cloudflare-workflows-shared-9106Note that these links will no longer work once the GitHub Actions artifact expires. |
c13df86 to
a2aa378
Compare
dario-piotrowicz
left a comment
There was a problem hiding this comment.
Looks good to me 🙂
I think this could use a test where you do check that users can use the secrets store alongside a KV binding, but maybe that's a bit of an overkill 🤔
| # Regression test for https://github.com/cloudflare/workers-sdk/issues/9006 | ||
| kv_namespaces = [ | ||
| ${isLocal ? `{ binding = "KV", id = "LOCAL_ONLY" }` : ""} | ||
| ] |
There was a problem hiding this comment.
I added a regression test in the PR and ran the same test without the fix here: https://github.com/cloudflare/workers-sdk/actions/runs/15183927642/job/42699817229?pr=9338#step:5:4996
Fixes #9006.
We were relying on the KV plugin to setup the object and storage service for the internal KV namespaced used by the local sercets store binding. However, this creates an issue when the users have both a KV namespace and secret binding defined with each creating a storage service sharing the same name while having a different persist path.
This decouples kv plugin from the sercets store plugin by copying the implementation in the kv bindings with the service named customzied for the secret store plugin.