workers-sdk icon indicating copy to clipboard operation
workers-sdk copied to clipboard

[KV] Remove `worker-` prefix from kv:namespace create when using wrangler in a pages project or without a `name` property

Open nora-soderlund opened this issue 1 year ago • 4 comments

Fixes #

What this PR solves / how to test: Currently the kv:namespace create command differs from other create commands where it prefixes the input with worker- when using the command in e.g. a pages project without a wrangler.toml or with a wrangler.toml but without a name property. This is a regression to how the dashboard and other products works and can cause confusion for developers.

Author has addressed the following: This has been broken into two separate PRs to focus on two different topics, see #5050 for the original change.

  • Tests
    • [X] Included
    • [ ] Not necessary because:
  • Changeset (Changeset guidelines)
    • [X] Included
    • [ ] Not necessary because:
  • Associated docs
    • [ ] Issue(s)/PR(s):
    • [ ] Not necessary because: the docs do not mention the overly zealous validation of the title passed to the command.

nora-soderlund avatar Feb 13 '24 20:02 nora-soderlund

🦋 Changeset detected

Latest commit: 2caff1c9b56a4cccb4b9aeaf89f9e8ad4b1cf081

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

This PR includes changesets to release 2 packages
Name Type
wrangler Major
@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

changeset-bot[bot] avatar Feb 13 '24 20:02 changeset-bot[bot]

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/8114334808/npm-package-wrangler-5007

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/5007/npm-package-wrangler-5007

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8114334808/npm-package-wrangler-5007 dev path/to/script.js
Additional artifacts:
npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8114334808/npm-package-create-cloudflare-5007 --no-auto-update
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8114334808/npm-package-cloudflare-kv-asset-handler-5007
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8114334808/npm-package-miniflare-5007
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8114334808/npm-package-cloudflare-pages-shared-5007
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8114334808/npm-package-cloudflare-vitest-pool-workers-5007

Note that these links will no longer work once the GitHub Actions artifact expires.


[email protected] includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 3.20240223.0
workerd 1.20240223.1 1.20240223.1
workerd --version 1.20240223.1 2024-02-23

Please ensure constraints are pinned, and miniflare/workerd minor versions match.

github-actions[bot] avatar Feb 14 '24 10:02 github-actions[bot]

Codecov Report

Attention: Patch coverage is 88.88889% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 70.39%. Comparing base (42bcc72) to head (2caff1c). Report is 3 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5007      +/-   ##
==========================================
+ Coverage   70.32%   70.39%   +0.06%     
==========================================
  Files         298      298              
  Lines       15542    15548       +6     
  Branches     3999     4002       +3     
==========================================
+ Hits        10930    10945      +15     
+ Misses       4612     4603       -9     
Files Coverage Δ
packages/wrangler/src/kv/helpers.ts 93.95% <100.00%> (+0.16%) :arrow_up:
packages/wrangler/src/kv/index.ts 99.53% <80.00%> (-0.47%) :arrow_down:

... and 7 files with indirect coverage changes

codecov[bot] avatar Feb 14 '24 10:02 codecov[bot]

Rebased and added to the V4 milestone.

petebacondarwin avatar Mar 01 '24 16:03 petebacondarwin

Merging to the v4 branch.

petebacondarwin avatar Mar 07 '24 16:03 petebacondarwin