Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Mar 7, 2024

Conversation

nora-soderlund
Copy link
Contributor

@nora-soderlund nora-soderlund commented Feb 13, 2024

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
    • Included
    • Not necessary because:
  • Changeset (Changeset guidelines)
    • 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 nora-soderlund requested a review from a team as a code owner February 13, 2024 20:18
Copy link

changeset-bot bot commented Feb 13, 2024

🦋 Changeset detected

Latest commit: 2caff1c

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

Copy link
Contributor

github-actions bot commented Feb 14, 2024

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.


wrangler@3.30.1 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.

Copy link

codecov bot commented Feb 14, 2024

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%) ⬆️
packages/wrangler/src/kv/index.ts 99.53% <80.00%> (-0.47%) ⬇️

... and 7 files with indirect coverage changes

packages/wrangler/src/kv/index.ts Outdated Show resolved Hide resolved
packages/wrangler/src/kv/index.ts Show resolved Hide resolved
@nora-soderlund nora-soderlund changed the title fix: kv:namespace create to refer to the namespace name instead of binding name [KV] Remove worker- prefix from kv:namespace create when using wrangler in a pages project or without a name property Feb 17, 2024
@petebacondarwin petebacondarwin added this to the Wrangler v4 milestone Mar 1, 2024
@petebacondarwin petebacondarwin self-assigned this Mar 1, 2024
@petebacondarwin
Copy link
Contributor

Rebased and added to the V4 milestone.

…e` command

Previously, if there was no Worker defined by a local `wrangler.toml` or that Worker had no `name` property
then any KV namespace that was created by Wrangler would use `worker_` as a prefix, rather than the Worker's
name.

This is a minor breaking change to the name given to a newly created KV namespace, which is unlikely to affect
many, if any, developers.
@petebacondarwin petebacondarwin added the breaking change Change that will result in breaking existing behavior label Mar 1, 2024
@petebacondarwin petebacondarwin removed their assignment Mar 5, 2024
@petebacondarwin petebacondarwin changed the base branch from main to v4 March 7, 2024 16:26
@petebacondarwin
Copy link
Contributor

Merging to the v4 branch.

@petebacondarwin petebacondarwin merged commit 471b797 into cloudflare:v4 Mar 7, 2024
22 checks passed
RamIdeas pushed a commit that referenced this pull request Mar 15, 2024
…e` command (#5007)

Previously, if there was no Worker defined by a local `wrangler.toml` or that Worker had no `name` property
then any KV namespace that was created by Wrangler would use `worker_` as a prefix, rather than the Worker's
name.

This is a minor breaking change to the name given to a newly created KV namespace, which is unlikely to affect
many, if any, developers.
petebacondarwin pushed a commit that referenced this pull request Mar 16, 2024
…e` command (#5007)

Previously, if there was no Worker defined by a local `wrangler.toml` or that Worker had no `name` property
then any KV namespace that was created by Wrangler would use `worker_` as a prefix, rather than the Worker's
name.

This is a minor breaking change to the name given to a newly created KV namespace, which is unlikely to affect
many, if any, developers.
RamIdeas pushed a commit that referenced this pull request Sep 23, 2024
…e` command (#5007)

Previously, if there was no Worker defined by a local `wrangler.toml` or that Worker had no `name` property
then any KV namespace that was created by Wrangler would use `worker_` as a prefix, rather than the Worker's
name.

This is a minor breaking change to the name given to a newly created KV namespace, which is unlikely to affect
many, if any, developers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Change that will result in breaking existing behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants