Skip to content

Commit f398bff

Browse files
d-csclaude
andcommitted
chore(run-ops): rename env var RUN_OPS_MINT_ENABLED and flag key runOpsMintKind
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 163f1ed commit f398bff

6 files changed

Lines changed: 12 additions & 12 deletions

File tree

apps/webapp/app/env.server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1728,9 +1728,9 @@ const EnvironmentSchema = z
17281728
RUN_REPLICATION_NEW_ORIGIN_GENERATION: z.coerce.number().int().default(1),
17291729

17301730
// Run-ops id mint cutover — per-env, canary-first, OFF by default.
1731-
// Even when on, an env mints run-ops ids only if its per-org runOpsMintKsuid flag is
1731+
// Even when on, an env mints run-ops ids only if its per-org runOpsMintKind flag is
17321732
// "runOpsId" AND isSplitEnabled() is true. Cache mirrors REALTIME_BACKEND_FLAG_CACHE_*.
1733-
RUN_OPS_MINT_KSUID_ENABLED: BoolEnv.default(false),
1733+
RUN_OPS_MINT_ENABLED: BoolEnv.default(false),
17341734
RUN_OPS_MINT_FLAG_CACHE_TTL_MS: z.coerce.number().int().default(30_000),
17351735
RUN_OPS_MINT_FLAG_CACHE_MAX_ENTRIES: z.coerce.number().int().default(10_000),
17361736

apps/webapp/app/v3/featureFlags.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const FEATURE_FLAG = {
1818
computeMigrationPaidPercentage: "computeMigrationPaidPercentage",
1919
computeMigrationRequireTemplate: "computeMigrationRequireTemplate",
2020
devBranchesEnabled: "devBranchesEnabled",
21-
runOpsMintKsuid: "runOpsMintKsuid",
21+
runOpsMintKind: "runOpsMintKind",
2222
} as const;
2323

2424
export const FeatureFlagCatalog = {
@@ -52,8 +52,8 @@ export const FeatureFlagCatalog = {
5252
// Per-org access to development branches. Off unless enabled for the org.
5353
[FEATURE_FLAG.devBranchesEnabled]: z.coerce.boolean(),
5454
// Per-org run-ops-id mint cutover. Defaults to "cuid"; only honored when
55-
// RUN_OPS_MINT_KSUID_ENABLED is on AND isSplitEnabled() is true.
56-
[FEATURE_FLAG.runOpsMintKsuid]: z.enum(["cuid", "runOpsId"]),
55+
// RUN_OPS_MINT_ENABLED is on AND isSplitEnabled() is true.
56+
[FEATURE_FLAG.runOpsMintKind]: z.enum(["cuid", "runOpsId"]),
5757
};
5858

5959
export type FeatureFlagKey = keyof typeof FeatureFlagCatalog;

apps/webapp/app/v3/runOpsMigration/runOpsMintKind.server.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ describe("computeRunIdMintKind (pure)", () => {
3333

3434
it("passes the already-loaded org feature flags through to the flag fn (no extra DB read)", async () => {
3535
const flag = vi.fn().mockResolvedValue("runOpsId");
36-
const orgFeatureFlags = { runOpsMintKsuid: "runOpsId" };
36+
const orgFeatureFlags = { runOpsMintKind: "runOpsId" };
3737
await computeRunIdMintKind(
3838
{ organizationId: "org_1", id: "env_1", orgFeatureFlags },
3939
{ masterEnabled: true, splitEnabled: async () => true, flag }

apps/webapp/app/v3/runOpsMigration/runOpsMintKind.server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export async function resolveRunIdMintKind(environment: {
5151
orgFeatureFlags?: unknown;
5252
}): Promise<RunIdMintKind> {
5353
return computeRunIdMintKind(environment, {
54-
masterEnabled: env.RUN_OPS_MINT_KSUID_ENABLED,
54+
masterEnabled: env.RUN_OPS_MINT_ENABLED,
5555
splitEnabled: isSplitEnabled,
5656
flag: async (orgId, orgFeatureFlags) => {
5757
// The cache stores only "cuid"|"runOpsId" (never undefined), so the cache's
@@ -73,7 +73,7 @@ export async function resolveRunIdMintKind(environment: {
7373
)?.featureFlags;
7474

7575
const kind = await flagFn({
76-
key: FEATURE_FLAG.runOpsMintKsuid,
76+
key: FEATURE_FLAG.runOpsMintKind,
7777
defaultValue: "cuid",
7878
overrides: (overrides as Record<string, unknown>) ?? {},
7979
});

apps/webapp/test/runOpsMintCutover.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ async function seedOrgEnv(prisma: PrismaClient, mintFlag?: RunIdMintKind) {
4848
if (mintFlag) {
4949
await prisma.organization.update({
5050
where: { id: organization.id },
51-
data: { featureFlags: { [FEATURE_FLAG.runOpsMintKsuid]: mintFlag } },
51+
data: { featureFlags: { [FEATURE_FLAG.runOpsMintKind]: mintFlag } },
5252
});
5353
}
5454
return { organization, environment };
@@ -70,7 +70,7 @@ function realFlag(prisma: PrismaClient) {
7070
})
7171
)?.featureFlags;
7272
return flagFn({
73-
key: FEATURE_FLAG.runOpsMintKsuid,
73+
key: FEATURE_FLAG.runOpsMintKind,
7474
defaultValue: "cuid",
7575
overrides: (overrides as Record<string, unknown>) ?? {},
7676
});
@@ -145,7 +145,7 @@ describe("per-env run-ops-id mint cutover", () => {
145145
// Roll the org back to cuid (drain-new-forward — set the flag to "cuid").
146146
await prisma.organization.update({
147147
where: { id: a.organization.id },
148-
data: { featureFlags: { [FEATURE_FLAG.runOpsMintKsuid]: "cuid" } },
148+
data: { featureFlags: { [FEATURE_FLAG.runOpsMintKind]: "cuid" } },
149149
});
150150

151151
// The NEXT run mints cuid again (the env-bound resolver's TTL cache is not used here,

packages/core/src/v3/isomorphic/runOpsResidency.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export type Residency = "LEGACY" | "NEW";
66
/**
77
* Underlying id lineage. "runOpsId" (formerly "ksuid") is the label for the
88
* NEW-store mint path — a base32hex run-ops v1 id (see friendlyId.ts). It is
9-
* the value persisted in the runOpsMintKsuid feature flag. "cuid" is every
9+
* the value persisted in the runOpsMintKind feature flag. "cuid" is every
1010
* legacy shape (cuid, nanoid, pre-cutover 27-char base62).
1111
*/
1212
export type ResidencyKind = "cuid" | "runOpsId";

0 commit comments

Comments
 (0)