Skip to content

Commit

Permalink
[Vectorize] Replace the Vectorize Beta banner with the GA Announcemen…
Browse files Browse the repository at this point in the history
…t Banner (#6999)
  • Loading branch information
garvit-gupta authored Oct 25, 2024
1 parent 924ec18 commit 0111edb
Show file tree
Hide file tree
Showing 17 changed files with 60 additions and 39 deletions.
5 changes: 5 additions & 0 deletions .changeset/early-parents-run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wrangler": minor
---

docs: Vectorize GA Announcement Banner
25 changes: 17 additions & 8 deletions packages/wrangler/src/__tests__/vectorize/vectorize.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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/
--------------------"
Expand Down Expand Up @@ -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/
--------------------"
Expand Down Expand Up @@ -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/
--------------------"
Expand Down Expand Up @@ -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/
--------------------"
Expand Down Expand Up @@ -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'
Expand Down
7 changes: 4 additions & 3 deletions packages/wrangler/src/vectorize/common.ts
Original file line number Diff line number Diff line change
@@ -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/
--------------------
Expand Down
10 changes: 8 additions & 2 deletions packages/wrangler/src/vectorize/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions packages/wrangler/src/vectorize/createMetadataIndex.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions packages/wrangler/src/vectorize/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions packages/wrangler/src/vectorize/deleteByIds.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions packages/wrangler/src/vectorize/deleteMetadataIndex.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions packages/wrangler/src/vectorize/get.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions packages/wrangler/src/vectorize/getByIds.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions packages/wrangler/src/vectorize/index.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -104,5 +104,5 @@ export function vectorize(yargs: CommonYargsArgv) {
deleteMetadataIndexOptions,
deleteMetadataIndexHandler
)
.epilogue(vectorizeBetaWarning);
.epilogue(vectorizeGABanner);
}
4 changes: 2 additions & 2 deletions packages/wrangler/src/vectorize/info.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -19,7 +19,7 @@ export function options(yargs: CommonYargsArgv) {
type: "boolean",
default: false,
})
.epilogue(vectorizeBetaWarning);
.epilogue(vectorizeGABanner);
}

export async function handler(
Expand Down
4 changes: 2 additions & 2 deletions packages/wrangler/src/vectorize/insert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions packages/wrangler/src/vectorize/list.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions packages/wrangler/src/vectorize/listMetadataIndex.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -19,7 +19,7 @@ export function options(yargs: CommonYargsArgv) {
type: "boolean",
default: false,
})
.epilogue(vectorizeBetaWarning);
.epilogue(vectorizeGABanner);
}

export async function handler(
Expand Down
4 changes: 2 additions & 2 deletions packages/wrangler/src/vectorize/query.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -85,7 +85,7 @@ export function options(yargs: CommonYargsArgv) {
" Filter the query results.",
],
])
.epilogue(vectorizeBetaWarning);
.epilogue(vectorizeGABanner);
}

export async function handler(
Expand Down
4 changes: 2 additions & 2 deletions packages/wrangler/src/vectorize/upsert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
getBatchFromFile,
VECTORIZE_MAX_BATCH_SIZE,
VECTORIZE_MAX_UPSERT_VECTOR_RECORDS,
vectorizeBetaWarning,
vectorizeGABanner,
} from "./common";
import type {
CommonYargsArgv,
Expand Down Expand Up @@ -41,7 +41,7 @@ export function options(yargs: CommonYargsArgv) {
default: false,
},
})
.epilogue(vectorizeBetaWarning);
.epilogue(vectorizeGABanner);
}

export async function handler(
Expand Down

0 comments on commit 0111edb

Please sign in to comment.