Skip to content

Commit 50bc28e

Browse files
nipunn1313Convex, Inc.
authored andcommitted
Remove ability for clients to select partition_id (#39001)
GitOrigin-RevId: 34551c28ee8824bbe5aaabee1bacbccb665fa163
1 parent 6cd0d73 commit 50bc28e

File tree

9 files changed

+9
-103
lines changed

9 files changed

+9
-103
lines changed

crates/backend_harness/src/provision.rs

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ use backoff::{
1818
};
1919
use big_brain_client::BigBrainClient;
2020
use big_brain_private_api_types::{
21-
types::PartitionId,
2221
DeploymentAuthPreviewArgs,
2322
DeploymentAuthProdArgs,
2423
DeploymentAuthResponse,
@@ -284,14 +283,9 @@ async fn deployment_credentials(
284283
.await
285284
},
286285
DeploymentSelector::Prod => {
287-
let partition_id = env::var("PARTITION_ID")
288-
.ok()
289-
.map(|s| anyhow::Ok(PartitionId(s.parse::<u64>()?)))
290-
.transpose()?;
291286
client
292287
.prod_deployment_credentials(DeploymentAuthProdArgs {
293288
deployment_name: configured_deployment_name,
294-
partition_id,
295289
})
296290
.await
297291
},
@@ -311,10 +305,7 @@ async fn preview_deploy_key(
311305
.get_project_and_team_for_deployment(deployment_name.clone())
312306
.await?;
313307
let prod_credentials = client
314-
.prod_deployment_credentials(DeploymentAuthProdArgs {
315-
deployment_name,
316-
partition_id: None,
317-
})
308+
.prod_deployment_credentials(DeploymentAuthProdArgs { deployment_name })
318309
.await?;
319310

320311
let admin_key_parts = prod_credentials.admin_key.split_once('|');
@@ -687,9 +678,6 @@ async fn provision_from_big_brain(
687678
.arg("--configure=new")
688679
.arg("--project")
689680
.arg("load_generator");
690-
if let Ok(partition_id) = env::var("PARTITION_ID") {
691-
cmd.arg("--partition-id").arg(partition_id);
692-
}
693681
logs.spawn_with_prefixed_logs(
694682
"npx convex dev --configure=new".into(),
695683
cmd.env("CONVEX_PROVISION_HOST", provision_host)
@@ -711,9 +699,6 @@ async fn provision_from_big_brain(
711699
.arg("deploy")
712700
.arg("--preview-create")
713701
.arg(identifier);
714-
if let Ok(partition_id) = env::var("PARTITION_ID") {
715-
cmd.arg("--partition-id").arg(partition_id);
716-
}
717702
logs.spawn_with_prefixed_logs(
718703
format!("npx convex deploy --preview-create {identifier}"),
719704
cmd.env("CONVEX_PROVISION_HOST", provision_host)
@@ -783,10 +768,6 @@ async fn deploy(
783768
.arg("--yes")
784769
.env("CONVEX_PROVISION_HOST", provision_host)
785770
.env("CONVEX_OVERRIDE_ACCESS_TOKEN", access_token);
786-
if let Ok(partition_id) = env::var("PARTITION_ID") {
787-
tracing::info!("Using partition_id: {partition_id}");
788-
cmd.arg("--partition-id").arg(partition_id);
789-
}
790771
cmd
791772
},
792773
// Only pass the ADMIN_KEY in directly with local backend to bypass dependency on

crates/big_brain_private_api_types/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ impl DeploymentAuthArgs {
7070
#[serde(deny_unknown_fields)]
7171
pub struct DeploymentAuthProdArgs {
7272
pub deployment_name: String,
73-
pub partition_id: Option<PartitionId>,
7473
}
7574

7675
#[derive(Deserialize, Serialize)]

npm-packages/convex/src/cli/configure.ts

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ export async function deploymentCredentialsOrConfigure(
110110
deploymentSelection: DeploymentSelection,
111111
chosenConfiguration: ChosenConfiguration,
112112
cmdOptions: ConfigureCmdOptions,
113-
partitionId?: number | undefined,
114113
): Promise<
115114
DeploymentCredentials & {
116115
deploymentFields: {
@@ -126,7 +125,6 @@ export async function deploymentCredentialsOrConfigure(
126125
deploymentSelection,
127126
chosenConfiguration,
128127
cmdOptions,
129-
partitionId,
130128
);
131129

132130
if (selectedDeployment.deploymentFields !== null) {
@@ -161,7 +159,6 @@ export async function _deploymentCredentialsOrConfigure(
161159
deploymentSelection: DeploymentSelection,
162160
chosenConfiguration: ChosenConfiguration,
163161
cmdOptions: ConfigureCmdOptions,
164-
partitionId?: number | undefined,
165162
): Promise<
166163
DeploymentCredentials & {
167164
deploymentFields: {
@@ -215,7 +212,6 @@ export async function _deploymentCredentialsOrConfigure(
215212
chosenConfiguration,
216213
{
217214
globallyForceCloud,
218-
partitionId,
219215
},
220216
cmdOptions,
221217
);
@@ -232,7 +228,6 @@ export async function _deploymentCredentialsOrConfigure(
232228
targetProject: deploymentSelection.targetProject,
233229
cmdOptions,
234230
globallyForceCloud,
235-
partitionId,
236231
});
237232
}
238233
case "anonymous": {
@@ -255,7 +250,6 @@ export async function _deploymentCredentialsOrConfigure(
255250
chosenConfiguration,
256251
{
257252
globallyForceCloud,
258-
partitionId,
259253
},
260254
cmdOptions,
261255
);
@@ -311,7 +305,6 @@ export async function _deploymentCredentialsOrConfigure(
311305
chosenConfiguration,
312306
{
313307
globallyForceCloud,
314-
partitionId,
315308
},
316309
cmdOptions,
317310
);
@@ -326,13 +319,11 @@ async function handleDeploymentWithinProject(
326319
targetProject,
327320
cmdOptions,
328321
globallyForceCloud,
329-
partitionId,
330322
}: {
331323
chosenConfiguration: ChosenConfiguration;
332324
targetProject: ProjectSelection;
333325
cmdOptions: ConfigureCmdOptions;
334326
globallyForceCloud: boolean;
335-
partitionId?: number | undefined;
336327
},
337328
) {
338329
const hasAuth = ctx.bigBrainAuth() !== null;
@@ -353,7 +344,6 @@ async function handleDeploymentWithinProject(
353344
chosenConfiguration,
354345
{
355346
globallyForceCloud,
356-
partitionId,
357347
},
358348
cmdOptions,
359349
);
@@ -368,7 +358,6 @@ async function handleDeploymentWithinProject(
368358
chosenConfiguration,
369359
{
370360
globallyForceCloud,
371-
partitionId,
372361
},
373362
cmdOptions,
374363
);
@@ -410,7 +399,6 @@ async function handleChooseProject(
410399
chosenConfiguration: ChosenConfiguration,
411400
args: {
412401
globallyForceCloud: boolean;
413-
partitionId?: number | undefined;
414402
},
415403
cmdOptions: ConfigureCmdOptions,
416404
): Promise<
@@ -435,7 +423,6 @@ async function handleChooseProject(
435423
devDeployment: cmdOptions.devDeployment,
436424
local: args.globallyForceCloud ? false : cmdOptions.local,
437425
cloud: args.globallyForceCloud ? true : cmdOptions.cloud,
438-
partitionId: args.partitionId,
439426
});
440427
// TODO complain about any non-default cmdOptions.localOptions here
441428
// because we're ignoring them if this isn't a local development.
@@ -454,7 +441,6 @@ async function handleChooseProject(
454441
teamSlug: project.teamSlug,
455442
projectSlug: project.projectSlug,
456443
deploymentOptions,
457-
partitionId: args.partitionId,
458444
});
459445
return {
460446
url,
@@ -503,7 +489,6 @@ export async function selectProject(
503489
devDeployment?: "cloud" | "local" | undefined;
504490
local?: boolean | undefined;
505491
cloud?: boolean | undefined;
506-
partitionId?: number;
507492
defaultProjectName?: string | undefined;
508493
},
509494
): Promise<{
@@ -540,7 +525,6 @@ async function selectNewProject(
540525
devDeployment?: "cloud" | "local" | undefined;
541526
cloud?: boolean | undefined;
542527
local?: boolean | undefined;
543-
partitionId?: number | undefined;
544528
defaultProjectName?: string | undefined;
545529
},
546530
) {
@@ -578,7 +562,6 @@ async function selectNewProject(
578562
({ projectSlug, teamSlug, projectsRemaining } = await createProject(ctx, {
579563
teamSlug: selectedTeam,
580564
projectName,
581-
partitionId: config.partitionId,
582565
// We have to create some deployment initially for a project.
583566
deploymentTypeToProvision: devDeployment === "local" ? "prod" : "dev",
584567
}));
@@ -712,7 +695,6 @@ async function ensureDeploymentProvisioned(
712695
teamSlug: string;
713696
projectSlug: string;
714697
deploymentOptions: DeploymentOptions;
715-
partitionId: number | undefined;
716698
},
717699
): Promise<DeploymentDetails> {
718700
switch (options.deploymentOptions.kind) {
@@ -727,7 +709,6 @@ async function ensureDeploymentProvisioned(
727709
projectSlug: options.projectSlug,
728710
},
729711
options.deploymentOptions.kind,
730-
options.partitionId,
731712
);
732713
return {
733714
...credentials,

npm-packages/convex/src/cli/deploy.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ async function deployToNewPreviewDeployment(
174174

175175
debug?: boolean | undefined;
176176
debugBundlePath?: string | undefined;
177-
partitionId?: string | undefined;
178177
},
179178
) {
180179
const previewName = options.previewCreate ?? gitBranchFromEnvironment();
@@ -215,9 +214,6 @@ async function deployToNewPreviewDeployment(
215214
data: {
216215
projectSelection: deploymentSelection.projectSelection,
217216
identifier: previewName,
218-
partitionId: options.partitionId
219-
? parseInt(options.partitionId)
220-
: undefined,
221217
},
222218
});
223219

@@ -285,7 +281,6 @@ async function deployToExistingDeployment(
285281
url?: string | undefined;
286282
writePushRequest?: string | undefined;
287283
liveComponentSources?: boolean | undefined;
288-
partitionId?: string | undefined;
289284
envFile?: string | undefined;
290285
},
291286
) {

npm-packages/convex/src/cli/dev.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,6 @@ Same format as .env.local or .env files, and overrides them.`,
224224
localOptions["forceUpgrade"] = cmdOptions.localForceUpgrade;
225225
}
226226

227-
const partitionId = cmdOptions.partitionId
228-
? parseInt(cmdOptions.partitionId)
229-
: undefined;
230227
const configure =
231228
cmdOptions.configure === true ? "ask" : (cmdOptions.configure ?? null);
232229
const deploymentSelection = await getDeploymentSelection(ctx, cmdOptions);
@@ -239,7 +236,6 @@ Same format as .env.local or .env files, and overrides them.`,
239236
localOptions,
240237
selectionWithinProject,
241238
},
242-
partitionId,
243239
);
244240

245241
if (credentials.deploymentFields !== null) {

0 commit comments

Comments
 (0)