Skip to content

Commit 6f8cca2

Browse files
NicolappsConvex, Inc.
authored andcommitted
cli: Temporarily disable the large index deletion check (#43091)
GitOrigin-RevId: 8c113c9a5396cb0b657cacc194fb379c5db54472
1 parent 516f8a5 commit 6f8cca2

File tree

2 files changed

+12
-46
lines changed

2 files changed

+12
-46
lines changed

src/cli/lib/checkForLargeIndexDeletion.ts

Lines changed: 12 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,9 @@ export async function checkForLargeIndexDeletion({
9090
}),
9191
);
9292

93-
const minDocumentsForWarning = minDocumentsForIndexDeleteWarning();
9493
if (
9594
!deletedIndexesWithDocumentsCount.some(
96-
({ count }) => count >= minDocumentsForWarning,
95+
({ count }) => count >= MIN_DOCUMENTS_FOR_INDEX_DELETE_WARNING,
9796
)
9897
) {
9998
logFinishedStep("No large indexes are deleted by this push");
@@ -105,13 +104,12 @@ from your production deployment (${options.url}):
105104
106105
${deletedIndexesWithDocumentsCount
107106
.map(({ componentDefinitionPath, index, count }) =>
108-
formatDeletedIndex({
107+
formatDeletedIndex(
109108
componentDefinitionPath,
110109
index,
111-
indexDiff: indexDiffs[componentDefinitionPath],
112-
documentsCount: count,
113-
minDocumentsForWarning,
114-
}),
110+
indexDiffs[componentDefinitionPath],
111+
count,
112+
),
115113
)
116114
.join("\n")}
117115
@@ -153,26 +151,19 @@ to be backfilled again if you want to restore it later.
153151
logFinishedStep("Proceeding with push.");
154152
}
155153

156-
function formatDeletedIndex({
157-
componentDefinitionPath,
158-
index,
159-
indexDiff,
160-
documentsCount,
161-
minDocumentsForWarning,
162-
}: {
163-
componentDefinitionPath: string;
164-
index: DeveloperIndexConfig;
165-
indexDiff: IndexDiff;
166-
documentsCount: number;
167-
minDocumentsForWarning: number;
168-
}) {
154+
function formatDeletedIndex(
155+
componentDefinitionPath: string,
156+
index: DeveloperIndexConfig,
157+
indexDiff: IndexDiff,
158+
documentsCount: number,
159+
) {
169160
const componentNameFormatted =
170161
componentDefinitionPath !== ""
171162
? `${chalk.gray(componentDefinitionPath)}:`
172163
: "";
173164

174165
const documentsCountFormatted =
175-
documentsCount >= minDocumentsForWarning
166+
documentsCount >= MIN_DOCUMENTS_FOR_INDEX_DELETE_WARNING
176167
? ` ${chalk.yellowBright(`⚠️ ${documentsCount.toLocaleString()} documents`)}`
177168
: ` ${documentsCount.toLocaleString()} ${documentsCount === 1 ? "document" : "documents"}`;
178169

@@ -194,14 +185,3 @@ function getTableName(index: DeveloperIndexConfig) {
194185
const [tableName, _indexName] = index.name.split(".");
195186
return tableName;
196187
}
197-
198-
function minDocumentsForIndexDeleteWarning(): number {
199-
const envValue = process.env.CONVEX_MIN_DOCUMENTS_FOR_INDEX_DELETE_WARNING;
200-
if (envValue !== undefined) {
201-
const parsed = parseInt(envValue, 10);
202-
if (!isNaN(parsed)) {
203-
return parsed;
204-
}
205-
}
206-
return MIN_DOCUMENTS_FOR_INDEX_DELETE_WARNING;
207-
}

src/cli/lib/components.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ import { DEFINITION_FILENAME_TS } from "./components/constants.js";
5454
import { DeploymentSelection } from "./deploymentSelection.js";
5555
import { deploymentDashboardUrlPage } from "./dashboard.js";
5656
import { formatIndex, LargeIndexDeletionCheck } from "./indexes.js";
57-
import { checkForLargeIndexDeletion } from "./checkForLargeIndexDeletion.js";
5857
import { LogManager } from "./logs.js";
5958

6059
export type PushOptions = {
@@ -366,19 +365,6 @@ async function startComponentsPushAndCodegen(
366365
}
367366
logStartPushSizes(parentSpan, startPushRequest);
368367

369-
if (options.largeIndexDeletionCheck !== "no verification") {
370-
await parentSpan.enterAsync("checkForLargeIndexDeletion", (span) =>
371-
checkForLargeIndexDeletion({
372-
ctx,
373-
span,
374-
request: startPushRequest,
375-
options,
376-
askForConfirmation:
377-
options.largeIndexDeletionCheck === "ask for confirmation",
378-
}),
379-
);
380-
}
381-
382368
changeSpinner("Uploading functions to Convex...");
383369
const startPushResponse = await parentSpan.enterAsync("startPush", (span) =>
384370
startPush(ctx, span, startPushRequest, options),

0 commit comments

Comments
 (0)