-
Notifications
You must be signed in to change notification settings - Fork 925
thomasgauvin: add rename command to kv wrangler #9835
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
base: main
Are you sure you want to change the base?
thomasgauvin: add rename command to kv wrangler #9835
Conversation
|
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
wrangler
commit: |
packages/wrangler/src/kv/index.ts
Outdated
throw new UserError("Unable to determine namespace ID"); | ||
} | ||
|
||
if (!args.newName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't think this is necessary, yargs should already have errored
packages/wrangler/src/kv/index.ts
Outdated
namespaceId = namespace.id; | ||
} | ||
|
||
if (!namespaceId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i dont think this check is necessary? or at the least, it shouldn't be a user error - either it'll have been set by args or already errored out above.
if its a types issue, you should use assert
to narrow the type.
packages/wrangler/src/kv/index.ts
Outdated
metrics.sendMetricsEvent("rename kv namespace", { | ||
sendMetrics: config.send_metrics, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is no longer necessary, all commands have metrics automatically added for start/complete/error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you also add a changeset please?
addresses #7765