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

wrangler: some additions #4013

Merged
merged 33 commits into from
Sep 26, 2023
Merged

wrangler: some additions #4013

merged 33 commits into from
Sep 26, 2023

Conversation

elithrar
Copy link
Contributor

@elithrar elithrar commented Sep 22, 2023

This PR adds:

  • a new command surface: wrangler vectorize
  • support for the new [[vectorize]] binding
➜  node bin/wrangler.js vectorize --help
wrangler vectorize

🧮 Interact with Vectorize indexes

Commands:
  wrangler vectorize create <name>  Create a Vectorize index
  wrangler vectorize delete <name>  Delete a Vectorize index
  wrangler vectorize get <name>     Get a Vectorize index by name
  wrangler vectorize list           List your Vectorize indexes

Author has included the following, where applicable:

@elithrar elithrar requested a review from a team as a code owner September 22, 2023 14:52
@changeset-bot
Copy link

changeset-bot bot commented Sep 22, 2023

🦋 Changeset detected

Latest commit: 4692d92

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

This PR includes changesets to release 1 package
Name Type
wrangler Minor

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

@elithrar elithrar self-assigned this Sep 22, 2023
@elithrar
Copy link
Contributor Author

I've removed the 'bad' mTLS test, which a) had the wrong snapshot and b) shouldn't force other commands to update the mTLS test when they add a new top-level command.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 22, 2023

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/6302953085/npm-package-wrangler-4013

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

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

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6302953085/npm-package-wrangler-4013 dev path/to/script.js
Additional artifacts:
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6302953085/npm-package-cloudflare-pages-shared-4013

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


wrangler@3.9.1 includes the following runtime dependencies:

Package Constraint Resolved
miniflare 3.20230922.0 3.20230922.0
workerd 1.20230922.0 1.20230922.0
workerd --version 1.20230922.0 2023-09-22

|

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

Copy link
Contributor

@penalosa penalosa left a comment

Choose a reason for hiding this comment

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

General comment around renaming from indexes-> indices, but other than that this is looking pretty good! Couple merge issues, and it looks like some bits are still WIP, but no major issues at this stage.

packages/wrangler/src/index.ts Outdated Show resolved Hide resolved
packages/wrangler/src/index.ts Outdated Show resolved Hide resolved
packages/wrangler/src/index.ts Show resolved Hide resolved
packages/wrangler/src/vectorize/list.ts Outdated Show resolved Hide resolved
packages/wrangler/src/vectorize/query.ts Outdated Show resolved Hide resolved
packages/wrangler/src/vectorize/query.ts Outdated Show resolved Hide resolved
packages/wrangler/src/vectorize/delete.ts Outdated Show resolved Hide resolved
packages/wrangler/src/vectorize/delete.ts Outdated Show resolved Hide resolved
.changeset/good-ads-fold.md Outdated Show resolved Hide resolved
@elithrar
Copy link
Contributor Author

@penalosa this should be OK to merge from my perspective, pending any final review.

Both vectorize query and vectorize insert are stubbed out, and we'll be following up with these in a few days, but don't want to miss the next release.

@elithrar elithrar requested a review from a team as a code owner September 23, 2023 19:38
@elithrar elithrar changed the title improve wrangler: some additions Sep 23, 2023
@codecov
Copy link

codecov bot commented Sep 23, 2023

Codecov Report

Merging #4013 (4692d92) into main (ef94939) will decrease coverage by 0.03%.
Report is 3 commits behind head on main.
The diff coverage is 70.18%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4013      +/-   ##
==========================================
- Coverage   75.01%   74.98%   -0.03%     
==========================================
  Files         200      207       +7     
  Lines       11665    11826     +161     
  Branches     3058     3079      +21     
==========================================
+ Hits         8750     8868     +118     
- Misses       2915     2958      +43     
Files Coverage Δ
...ler/src/api/pages/create-worker-bundle-contents.ts 100.00% <ø> (ø)
packages/wrangler/src/deploy/deploy.ts 87.33% <ø> (ø)
packages/wrangler/src/dev.tsx 83.19% <ø> (ø)
packages/wrangler/src/index.ts 82.74% <100.00%> (+0.24%) ⬆️
packages/wrangler/src/secret/index.ts 87.32% <ø> (ø)
packages/wrangler/src/vectorize/common.ts 100.00% <100.00%> (ø)
packages/wrangler/src/vectorize/index.ts 100.00% <100.00%> (ø)
...src/deployment-bundle/create-worker-upload-form.ts 88.61% <50.00%> (-0.64%) ⬇️
packages/wrangler/src/cfetch/internal.ts 83.33% <33.33%> (-1.29%) ⬇️
packages/wrangler/src/config/validation.ts 90.12% <83.33%> (-0.10%) ⬇️
... and 6 more

... and 3 files with indirect coverage changes

@elithrar
Copy link
Contributor Author

Waiting on final review & merge.

@elithrar
Copy link
Contributor Author

General comment around renaming from indexes-> indices, but other than that this is looking pretty good! Couple merge issues, and it looks like some bits are still WIP, but no major issues at this stage.

We’re going to stick with “indexes”, since this is convention in this use-case and not incorrect (e.g. database indexes, not indices).

packages/wrangler/src/cfetch/internal.ts Show resolved Hide resolved
packages/wrangler/src/config/validation.ts Show resolved Hide resolved
packages/wrangler/src/vectorize/create.tsx Outdated Show resolved Hide resolved
packages/wrangler/src/vectorize/create.tsx Outdated Show resolved Hide resolved
packages/wrangler/src/vectorize/create.tsx Outdated Show resolved Hide resolved
packages/wrangler/src/vectorize/create.tsx Outdated Show resolved Hide resolved
packages/wrangler/src/vectorize/create.tsx Outdated Show resolved Hide resolved
packages/wrangler/src/vectorize/create.tsx Show resolved Hide resolved
@penalosa
Copy link
Contributor

@elithrar Mostly looking good, but it would be great to see some tests of the added Wrangler functionality, including:

  • tests of the configuration validation
  • tests of the new command surface, with mocked out implementations of the underlying APIs

@penalosa penalosa added the e2e Run e2e tests on a PR label Sep 25, 2023
Copy link
Contributor

@JacobMGEvans JacobMGEvans left a comment

Choose a reason for hiding this comment

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

Ran Prettier. Looks good, thanks for adding tests!!

@penalosa penalosa closed this Sep 25, 2023
@penalosa penalosa reopened this Sep 25, 2023
@lrapoport-cf lrapoport-cf merged commit 3cd7286 into main Sep 26, 2023
23 checks passed
@lrapoport-cf lrapoport-cf deleted the silverlock/wrangler-vectorize branch September 26, 2023 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e2e Run e2e tests on a PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants