Skip to content

Commit 16df23f

Browse files
committed
chore(webapp,run-store): apply oxfmt to new files
1 parent 8891394 commit 16df23f

3 files changed

Lines changed: 46 additions & 17 deletions

File tree

apps/webapp/app/routes/admin.api.v1.feature-flags.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ import { prisma } from "~/db.server";
44
import { env } from "~/env.server";
55
import { requireAdminApiRequest } from "~/services/personalAccessToken.server";
66
import { makeSetMultipleFlags } from "~/v3/featureFlags.server";
7-
import { FEATURE_FLAG, type FeatureFlagCatalog, validatePartialFeatureFlags } from "~/v3/featureFlags";
7+
import {
8+
FEATURE_FLAG,
9+
type FeatureFlagCatalog,
10+
validatePartialFeatureFlags,
11+
} from "~/v3/featureFlags";
812
import { stampMintKindFlip } from "~/v3/runOpsMigration/mintFlipGrace";
913

1014
export async function action({ request }: ActionFunctionArgs) {
@@ -57,8 +61,9 @@ export async function action({ request }: ActionFunctionArgs) {
5761
}
5862

5963
// Anchor the cutover to the control-plane DB clock, not this process's wall clock.
60-
const [{ now: controlPlaneNow }] =
61-
await prisma.$queryRaw<{ now: Date }[]>`SELECT now() AS now`;
64+
const [{ now: controlPlaneNow }] = await prisma.$queryRaw<
65+
{ now: Date }[]
66+
>`SELECT now() AS now`;
6267

6368
flagsToWrite = stampMintKindFlip(
6469
existingGlobal,

internal-packages/run-store/src/PostgresRunStore.hydratorSelectPushdown.test.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,13 @@ function withCapturedTaskRunFindManyArgs(real: RunOpsPrismaClient) {
7979
const extended = (real as unknown as { $extends: (config: unknown) => unknown }).$extends({
8080
query: {
8181
taskRun: {
82-
findMany({ args, query }: { args: Record<string, unknown>; query: (args: unknown) => Promise<unknown> }) {
82+
findMany({
83+
args,
84+
query,
85+
}: {
86+
args: Record<string, unknown>;
87+
query: (args: unknown) => Promise<unknown>;
88+
}) {
8389
capturedArgs.push(args);
8490
return query(args);
8591
},

internal-packages/run-store/src/runOpsStore.residencyMismatchFallback.test.ts

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,20 @@ function makeDedicatedStore(prisma17: RunOpsPrismaClient) {
4040
}
4141

4242
function makeLegacyStore(prisma14: PrismaClient) {
43-
return new PostgresRunStore({ prisma: prisma14, readOnlyPrisma: prisma14, schemaVariant: "legacy" });
43+
return new PostgresRunStore({
44+
prisma: prisma14,
45+
readOnlyPrisma: prisma14,
46+
schemaVariant: "legacy",
47+
});
4448
}
4549

4650
// Wrap a real store so findRun/findRunOnPrimary calls are COUNTED while every method still delegates
4751
// to the REAL PostgresRunStore (this is instrumentation, not a behavior mock — the underlying reads,
4852
// writes, getters all run for real). Lets us assert the FAST PATH does not touch the other store.
49-
function countingReads(inner: RunStore, counts: { findRun: number; findRunOnPrimary: number }): RunStore {
53+
function countingReads(
54+
inner: RunStore,
55+
counts: { findRun: number; findRunOnPrimary: number }
56+
): RunStore {
5057
return new Proxy(inner, {
5158
get(target, prop) {
5259
// Read via target[prop] so getters (e.g. primaryReadClient) run with `this` = the real store.
@@ -139,7 +146,13 @@ function buildCreateRunInput(params: {
139146
// residency/classification MISMATCH: the row is physically on #new while `classify` calls its id LEGACY.
140147
async function insertRunOnNewStore(
141148
prisma17: RunOpsPrismaClient,
142-
params: { runId: string; friendlyId: string; environmentId: string; organizationId: string; projectId: string }
149+
params: {
150+
runId: string;
151+
friendlyId: string;
152+
environmentId: string;
153+
organizationId: string;
154+
projectId: string;
155+
}
143156
) {
144157
await prisma17.taskRun.create({
145158
data: {
@@ -258,21 +271,26 @@ describe("RoutingRunStore.findRun — on-miss fan-out for a classifiable id (res
258271
newCounts.findRun = 0;
259272
legacyCounts.findRun = 0;
260273

261-
const hitLegacy = (await router.findRun({ id: legacyId }, { select: { id: true } })) as Record<
262-
string,
263-
unknown
264-
> | null;
274+
const hitLegacy = (await router.findRun(
275+
{ id: legacyId },
276+
{ select: { id: true } }
277+
)) as Record<string, unknown> | null;
265278
expect(hitLegacy?.id).toBe(legacyId);
266279
expect(legacyCounts.findRun).toBe(1);
267280
expect(newCounts.findRun).toBe(0);
268281
}
269282
);
270283

271284
// ── A genuine miss on BOTH stores still returns null (fan-out exhausted) ──
272-
heteroRunOpsPostgresTest("returns null when the run is on neither store", async ({ prisma14, prisma17 }) => {
273-
const newStore = makeDedicatedStore(prisma17);
274-
const legacyStore = makeLegacyStore(prisma14);
275-
const router = new RoutingRunStore({ new: newStore, legacy: legacyStore });
276-
expect(await router.findRun({ id: cuidLegacy("ghost") }, { select: { id: true } })).toBeNull();
277-
});
285+
heteroRunOpsPostgresTest(
286+
"returns null when the run is on neither store",
287+
async ({ prisma14, prisma17 }) => {
288+
const newStore = makeDedicatedStore(prisma17);
289+
const legacyStore = makeLegacyStore(prisma14);
290+
const router = new RoutingRunStore({ new: newStore, legacy: legacyStore });
291+
expect(
292+
await router.findRun({ id: cuidLegacy("ghost") }, { select: { id: true } })
293+
).toBeNull();
294+
}
295+
);
278296
});

0 commit comments

Comments
 (0)