From 0111edb9da466184885085be5e755ceb4970a486 Mon Sep 17 00:00:00 2001 From: Garvit Gupta Date: Fri, 25 Oct 2024 05:54:25 -0500 Subject: [PATCH] [Vectorize] Replace the Vectorize Beta banner with the GA Announcement Banner (#6999) --- .changeset/early-parents-run.md | 5 ++++ .../src/__tests__/vectorize/vectorize.test.ts | 25 +++++++++++++------ packages/wrangler/src/vectorize/common.ts | 7 +++--- packages/wrangler/src/vectorize/create.ts | 10 ++++++-- .../src/vectorize/createMetadataIndex.ts | 4 +-- packages/wrangler/src/vectorize/delete.ts | 4 +-- .../wrangler/src/vectorize/deleteByIds.ts | 4 +-- .../src/vectorize/deleteMetadataIndex.ts | 4 +-- packages/wrangler/src/vectorize/get.ts | 4 +-- packages/wrangler/src/vectorize/getByIds.ts | 4 +-- packages/wrangler/src/vectorize/index.ts | 4 +-- packages/wrangler/src/vectorize/info.ts | 4 +-- packages/wrangler/src/vectorize/insert.ts | 4 +-- packages/wrangler/src/vectorize/list.ts | 4 +-- .../src/vectorize/listMetadataIndex.ts | 4 +-- packages/wrangler/src/vectorize/query.ts | 4 +-- packages/wrangler/src/vectorize/upsert.ts | 4 +-- 17 files changed, 60 insertions(+), 39 deletions(-) create mode 100644 .changeset/early-parents-run.md diff --git a/.changeset/early-parents-run.md b/.changeset/early-parents-run.md new file mode 100644 index 000000000000..92e0aba6b1f3 --- /dev/null +++ b/.changeset/early-parents-run.md @@ -0,0 +1,5 @@ +--- +"wrangler": minor +--- + +docs: Vectorize GA Announcement Banner diff --git a/packages/wrangler/src/__tests__/vectorize/vectorize.test.ts b/packages/wrangler/src/__tests__/vectorize/vectorize.test.ts index bb87fdac5ef0..502d30db16f6 100644 --- a/packages/wrangler/src/__tests__/vectorize/vectorize.test.ts +++ b/packages/wrangler/src/__tests__/vectorize/vectorize.test.ts @@ -46,9 +46,10 @@ describe("vectorize help", () => { -v, --version Show version number [boolean] -------------------- - 📣 Vectorize is currently in open beta + 📣 Vectorize is now Generally Available. 📣 Please use the '--deprecated-v1' flag to create, get, list, delete and insert vectors into legacy Vectorize indexes - 📣 See the Vectorize docs for how to get started and known issues: https://developers.cloudflare.com/vectorize + 📣 Creation of legacy Vectorize indexes will be blocked by December 2024. Other operations will continue to function + 📣 See the Vectorize docs to get started: https://developers.cloudflare.com/vectorize 📣 Please report any bugs to https://github.com/cloudflare/workers-sdk/issues/new/choose 📣 To give feedback, visit https://discord.cloudflare.com/ --------------------" @@ -94,9 +95,10 @@ describe("vectorize help", () => { -v, --version Show version number [boolean] -------------------- - 📣 Vectorize is currently in open beta + 📣 Vectorize is now Generally Available. 📣 Please use the '--deprecated-v1' flag to create, get, list, delete and insert vectors into legacy Vectorize indexes - 📣 See the Vectorize docs for how to get started and known issues: https://developers.cloudflare.com/vectorize + 📣 Creation of legacy Vectorize indexes will be blocked by December 2024. Other operations will continue to function + 📣 See the Vectorize docs to get started: https://developers.cloudflare.com/vectorize 📣 Please report any bugs to https://github.com/cloudflare/workers-sdk/issues/new/choose 📣 To give feedback, visit https://discord.cloudflare.com/ --------------------" @@ -134,9 +136,10 @@ describe("vectorize help", () => { --deprecated-v1 Fetch a deprecated V1 Vectorize index. This must be enabled if the index was created with V1 option. [boolean] [default: false] -------------------- - 📣 Vectorize is currently in open beta + 📣 Vectorize is now Generally Available. 📣 Please use the '--deprecated-v1' flag to create, get, list, delete and insert vectors into legacy Vectorize indexes - 📣 See the Vectorize docs for how to get started and known issues: https://developers.cloudflare.com/vectorize + 📣 Creation of legacy Vectorize indexes will be blocked by December 2024. Other operations will continue to function + 📣 See the Vectorize docs to get started: https://developers.cloudflare.com/vectorize 📣 Please report any bugs to https://github.com/cloudflare/workers-sdk/issues/new/choose 📣 To give feedback, visit https://discord.cloudflare.com/ --------------------" @@ -186,9 +189,10 @@ describe("vectorize help", () => { Filter the query results. -------------------- - 📣 Vectorize is currently in open beta + 📣 Vectorize is now Generally Available. 📣 Please use the '--deprecated-v1' flag to create, get, list, delete and insert vectors into legacy Vectorize indexes - 📣 See the Vectorize docs for how to get started and known issues: https://developers.cloudflare.com/vectorize + 📣 Creation of legacy Vectorize indexes will be blocked by December 2024. Other operations will continue to function + 📣 See the Vectorize docs to get started: https://developers.cloudflare.com/vectorize 📣 Please report any bugs to https://github.com/cloudflare/workers-sdk/issues/new/choose 📣 To give feedback, visit https://discord.cloudflare.com/ --------------------" @@ -221,6 +225,11 @@ describe("vectorize commands", () => { await runWrangler( "vectorize create some-index --dimensions=768 --metric=cosine --deprecated-v1=true" ); + expect(std.warn).toMatchInlineSnapshot(` + "▲ [WARNING] Creation of legacy Vectorize indexes will be blocked by December 2024 + +" + `); expect(std.out).toMatchInlineSnapshot(` "🚧 Creating index: 'some-index' ✅ Successfully created a new Vectorize index: 'test-index' diff --git a/packages/wrangler/src/vectorize/common.ts b/packages/wrangler/src/vectorize/common.ts index ba23a124e00f..23f31ef232d0 100644 --- a/packages/wrangler/src/vectorize/common.ts +++ b/packages/wrangler/src/vectorize/common.ts @@ -1,10 +1,11 @@ import { logger } from "../logger"; import type { Interface as RLInterface } from "node:readline"; -export const vectorizeBetaWarning = `-------------------- -📣 Vectorize is currently in open beta +export const vectorizeGABanner = `-------------------- +📣 Vectorize is now Generally Available. 📣 Please use the '--deprecated-v1' flag to create, get, list, delete and insert vectors into legacy Vectorize indexes -📣 See the Vectorize docs for how to get started and known issues: https://developers.cloudflare.com/vectorize +📣 Creation of legacy Vectorize indexes will be blocked by December 2024. Other operations will continue to function +📣 See the Vectorize docs to get started: https://developers.cloudflare.com/vectorize 📣 Please report any bugs to https://github.com/cloudflare/workers-sdk/issues/new/choose 📣 To give feedback, visit https://discord.cloudflare.com/ -------------------- diff --git a/packages/wrangler/src/vectorize/create.ts b/packages/wrangler/src/vectorize/create.ts index 2f5d604c8cd1..b6386b300576 100644 --- a/packages/wrangler/src/vectorize/create.ts +++ b/packages/wrangler/src/vectorize/create.ts @@ -2,7 +2,7 @@ import { stringify } from "@iarna/toml"; import { readConfig } from "../config"; import { logger } from "../logger"; import { createIndex } from "./client"; -import { deprecatedV1DefaultFlag, vectorizeBetaWarning } from "./common"; +import { deprecatedV1DefaultFlag, vectorizeGABanner } from "./common"; import type { CommonYargsArgv, StrictYargsOptionsToInterface, @@ -62,7 +62,7 @@ export function options(yargs: CommonYargsArgv) { describe: "Create a deprecated Vectorize V1 index. This is not recommended and indexes created with this option need all other Vectorize operations to have this option enabled.", }) - .epilogue(vectorizeBetaWarning); + .epilogue(vectorizeGABanner); } export async function handler( @@ -90,6 +90,12 @@ export async function handler( return; } + if (args.deprecatedV1) { + logger.warn( + "Creation of legacy Vectorize indexes will be blocked by December 2024" + ); + } + const index = { name: args.name, description: args.description, diff --git a/packages/wrangler/src/vectorize/createMetadataIndex.ts b/packages/wrangler/src/vectorize/createMetadataIndex.ts index e24a4652b61b..b9643b5fe745 100644 --- a/packages/wrangler/src/vectorize/createMetadataIndex.ts +++ b/packages/wrangler/src/vectorize/createMetadataIndex.ts @@ -1,7 +1,7 @@ import { readConfig } from "../config"; import { logger } from "../logger"; import { createMetadataIndex } from "./client"; -import { vectorizeBetaWarning } from "./common"; +import { vectorizeGABanner } from "./common"; import type { CommonYargsArgv, StrictYargsOptionsToInterface, @@ -30,7 +30,7 @@ export function options(yargs: CommonYargsArgv) { description: "The type of metadata property to index. Valid types are 'string', 'number' and 'boolean'.", }) - .epilogue(vectorizeBetaWarning); + .epilogue(vectorizeGABanner); } export async function handler( diff --git a/packages/wrangler/src/vectorize/delete.ts b/packages/wrangler/src/vectorize/delete.ts index 896a260671b3..fdad147b6811 100644 --- a/packages/wrangler/src/vectorize/delete.ts +++ b/packages/wrangler/src/vectorize/delete.ts @@ -2,7 +2,7 @@ import { readConfig } from "../config"; import { confirm } from "../dialogs"; import { logger } from "../logger"; import { deleteIndex } from "./client"; -import { deprecatedV1DefaultFlag, vectorizeBetaWarning } from "./common"; +import { deprecatedV1DefaultFlag, vectorizeGABanner } from "./common"; import type { CommonYargsArgv, StrictYargsOptionsToInterface, @@ -26,7 +26,7 @@ export function options(yargs: CommonYargsArgv) { default: deprecatedV1DefaultFlag, describe: "Delete a deprecated Vectorize V1 index.", }) - .epilogue(vectorizeBetaWarning); + .epilogue(vectorizeGABanner); } export async function handler( diff --git a/packages/wrangler/src/vectorize/deleteByIds.ts b/packages/wrangler/src/vectorize/deleteByIds.ts index ee8a3415f2c2..bdb88df24bfc 100644 --- a/packages/wrangler/src/vectorize/deleteByIds.ts +++ b/packages/wrangler/src/vectorize/deleteByIds.ts @@ -1,7 +1,7 @@ import { readConfig } from "../config"; import { logger } from "../logger"; import { deleteByIds } from "./client"; -import { vectorizeBetaWarning } from "./common"; +import { vectorizeGABanner } from "./common"; import type { CommonYargsArgv, StrictYargsOptionsToInterface, @@ -24,7 +24,7 @@ export function options(yargs: CommonYargsArgv) { coerce: (arg: unknown[]) => arg.map((a) => a?.toString() ?? ""), }, }) - .epilogue(vectorizeBetaWarning); + .epilogue(vectorizeGABanner); } export async function handler( diff --git a/packages/wrangler/src/vectorize/deleteMetadataIndex.ts b/packages/wrangler/src/vectorize/deleteMetadataIndex.ts index 45e74b1ffeed..e8e3fc3e5e09 100644 --- a/packages/wrangler/src/vectorize/deleteMetadataIndex.ts +++ b/packages/wrangler/src/vectorize/deleteMetadataIndex.ts @@ -1,7 +1,7 @@ import { readConfig } from "../config"; import { logger } from "../logger"; import { deleteMetadataIndex } from "./client"; -import { vectorizeBetaWarning } from "./common"; +import { vectorizeGABanner } from "./common"; import type { CommonYargsArgv, StrictYargsOptionsToInterface, @@ -20,7 +20,7 @@ export function options(yargs: CommonYargsArgv) { demandOption: true, description: "The name of the metadata property to index.", }) - .epilogue(vectorizeBetaWarning); + .epilogue(vectorizeGABanner); } export async function handler( diff --git a/packages/wrangler/src/vectorize/get.ts b/packages/wrangler/src/vectorize/get.ts index 60c646c0c720..4df4145aaef8 100644 --- a/packages/wrangler/src/vectorize/get.ts +++ b/packages/wrangler/src/vectorize/get.ts @@ -1,7 +1,7 @@ import { readConfig } from "../config"; import { logger } from "../logger"; import { getIndex } from "./client"; -import { deprecatedV1DefaultFlag, vectorizeBetaWarning } from "./common"; +import { deprecatedV1DefaultFlag, vectorizeGABanner } from "./common"; import type { CommonYargsArgv, StrictYargsOptionsToInterface, @@ -25,7 +25,7 @@ export function options(yargs: CommonYargsArgv) { describe: "Fetch a deprecated V1 Vectorize index. This must be enabled if the index was created with V1 option.", }) - .epilogue(vectorizeBetaWarning); + .epilogue(vectorizeGABanner); } export async function handler( diff --git a/packages/wrangler/src/vectorize/getByIds.ts b/packages/wrangler/src/vectorize/getByIds.ts index 8f27fa015de7..b3e4af85ce71 100644 --- a/packages/wrangler/src/vectorize/getByIds.ts +++ b/packages/wrangler/src/vectorize/getByIds.ts @@ -1,7 +1,7 @@ import { readConfig } from "../config"; import { logger } from "../logger"; import { getByIds } from "./client"; -import { vectorizeBetaWarning } from "./common"; +import { vectorizeGABanner } from "./common"; import type { CommonYargsArgv, StrictYargsOptionsToInterface, @@ -24,7 +24,7 @@ export function options(yargs: CommonYargsArgv) { coerce: (arg: unknown[]) => arg.map((a) => a?.toString() ?? ""), }, }) - .epilogue(vectorizeBetaWarning); + .epilogue(vectorizeGABanner); } export async function handler( diff --git a/packages/wrangler/src/vectorize/index.ts b/packages/wrangler/src/vectorize/index.ts index 5bd97583557c..968766c8fe24 100644 --- a/packages/wrangler/src/vectorize/index.ts +++ b/packages/wrangler/src/vectorize/index.ts @@ -1,4 +1,4 @@ -import { vectorizeBetaWarning } from "./common"; +import { vectorizeGABanner } from "./common"; import { handler as createHandler, options as createOptions } from "./create"; import { handler as createMetadataIndexHandler, @@ -104,5 +104,5 @@ export function vectorize(yargs: CommonYargsArgv) { deleteMetadataIndexOptions, deleteMetadataIndexHandler ) - .epilogue(vectorizeBetaWarning); + .epilogue(vectorizeGABanner); } diff --git a/packages/wrangler/src/vectorize/info.ts b/packages/wrangler/src/vectorize/info.ts index f07fd3a91ee4..05f2f6939da3 100644 --- a/packages/wrangler/src/vectorize/info.ts +++ b/packages/wrangler/src/vectorize/info.ts @@ -1,7 +1,7 @@ import { readConfig } from "../config"; import { logger } from "../logger"; import { indexInfo } from "./client"; -import { vectorizeBetaWarning } from "./common"; +import { vectorizeGABanner } from "./common"; import type { CommonYargsArgv, StrictYargsOptionsToInterface, @@ -19,7 +19,7 @@ export function options(yargs: CommonYargsArgv) { type: "boolean", default: false, }) - .epilogue(vectorizeBetaWarning); + .epilogue(vectorizeGABanner); } export async function handler( diff --git a/packages/wrangler/src/vectorize/insert.ts b/packages/wrangler/src/vectorize/insert.ts index ddf8cec42547..81ac6c3f0611 100644 --- a/packages/wrangler/src/vectorize/insert.ts +++ b/packages/wrangler/src/vectorize/insert.ts @@ -11,7 +11,7 @@ import { VECTORIZE_MAX_UPSERT_VECTOR_RECORDS, VECTORIZE_UPSERT_BATCH_SIZE, VECTORIZE_V1_MAX_BATCH_SIZE, - vectorizeBetaWarning, + vectorizeGABanner, } from "./common"; import type { CommonYargsArgv, @@ -50,7 +50,7 @@ export function options(yargs: CommonYargsArgv) { "Insert into a deprecated V1 Vectorize index. This must be enabled if the index was created with the V1 option.", }, }) - .epilogue(vectorizeBetaWarning); + .epilogue(vectorizeGABanner); } export async function handler( diff --git a/packages/wrangler/src/vectorize/list.ts b/packages/wrangler/src/vectorize/list.ts index 9c88e2d6bd50..14b92a78597e 100644 --- a/packages/wrangler/src/vectorize/list.ts +++ b/packages/wrangler/src/vectorize/list.ts @@ -1,7 +1,7 @@ import { readConfig } from "../config"; import { logger } from "../logger"; import { listIndexes } from "./client"; -import { deprecatedV1DefaultFlag, vectorizeBetaWarning } from "./common"; +import { deprecatedV1DefaultFlag, vectorizeGABanner } from "./common"; import type { CommonYargsArgv, StrictYargsOptionsToInterface, @@ -19,7 +19,7 @@ export function options(yargs: CommonYargsArgv) { default: deprecatedV1DefaultFlag, describe: "List deprecated Vectorize V1 indexes for your account.", }) - .epilogue(vectorizeBetaWarning); + .epilogue(vectorizeGABanner); } export async function handler( diff --git a/packages/wrangler/src/vectorize/listMetadataIndex.ts b/packages/wrangler/src/vectorize/listMetadataIndex.ts index 062ad41d6290..2c7230503f36 100644 --- a/packages/wrangler/src/vectorize/listMetadataIndex.ts +++ b/packages/wrangler/src/vectorize/listMetadataIndex.ts @@ -1,7 +1,7 @@ import { readConfig } from "../config"; import { logger } from "../logger"; import { listMetadataIndex } from "./client"; -import { vectorizeBetaWarning } from "./common"; +import { vectorizeGABanner } from "./common"; import type { CommonYargsArgv, StrictYargsOptionsToInterface, @@ -19,7 +19,7 @@ export function options(yargs: CommonYargsArgv) { type: "boolean", default: false, }) - .epilogue(vectorizeBetaWarning); + .epilogue(vectorizeGABanner); } export async function handler( diff --git a/packages/wrangler/src/vectorize/query.ts b/packages/wrangler/src/vectorize/query.ts index 8043bf546ae7..eaf5985b17c4 100644 --- a/packages/wrangler/src/vectorize/query.ts +++ b/packages/wrangler/src/vectorize/query.ts @@ -1,7 +1,7 @@ import { readConfig } from "../config"; import { logger } from "../logger"; import { queryIndex } from "./client"; -import { vectorizeBetaWarning } from "./common"; +import { vectorizeGABanner } from "./common"; import type { CommonYargsArgv, StrictYargsOptionsToInterface, @@ -85,7 +85,7 @@ export function options(yargs: CommonYargsArgv) { " Filter the query results.", ], ]) - .epilogue(vectorizeBetaWarning); + .epilogue(vectorizeGABanner); } export async function handler( diff --git a/packages/wrangler/src/vectorize/upsert.ts b/packages/wrangler/src/vectorize/upsert.ts index 84a4fedb53d0..86402d800951 100644 --- a/packages/wrangler/src/vectorize/upsert.ts +++ b/packages/wrangler/src/vectorize/upsert.ts @@ -8,7 +8,7 @@ import { getBatchFromFile, VECTORIZE_MAX_BATCH_SIZE, VECTORIZE_MAX_UPSERT_VECTOR_RECORDS, - vectorizeBetaWarning, + vectorizeGABanner, } from "./common"; import type { CommonYargsArgv, @@ -41,7 +41,7 @@ export function options(yargs: CommonYargsArgv) { default: false, }, }) - .epilogue(vectorizeBetaWarning); + .epilogue(vectorizeGABanner); } export async function handler(