Skip to content

Commit 5de29cb

Browse files
d-csclaude
andcommitted
style(run-ops): apply oxfmt
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent ee6e86b commit 5de29cb

2 files changed

Lines changed: 15 additions & 11 deletions

File tree

apps/webapp/app/services/runsReplicationInstance.server.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export function buildReplicationSources(args: {
6868
export class SplitReplicationMisconfiguredError extends Error {
6969
constructor() {
7070
super(
71-
"RUN_OPS_SPLIT_ENABLED is on but the runs-replication sources[] has no \"new\" source: " +
71+
'RUN_OPS_SPLIT_ENABLED is on but the runs-replication sources[] has no "new" source: ' +
7272
"ksuid runs on the new DB would not replicate to ClickHouse, under-counting every " +
7373
"ClickHouse-fronted aggregate. Enable the new replication source " +
7474
"(RUN_REPLICATION_NEW_ENABLED / RUN_OPS_DATABASE_URL) or turn the split off."
@@ -162,8 +162,7 @@ function initializeRunsReplicationInstance() {
162162
splitEnabled,
163163
legacyUrl: DATABASE_URL,
164164
newUrl: env.RUN_OPS_DATABASE_URL ?? env.TASK_RUN_DATABASE_URL,
165-
newSourceOverride:
166-
env.RUN_REPLICATION_NEW_ENABLED === "disabled" ? false : undefined,
165+
newSourceOverride: env.RUN_REPLICATION_NEW_ENABLED === "disabled" ? false : undefined,
167166
legacySlotName: env.RUN_REPLICATION_SLOT_NAME,
168167
legacyPublicationName: env.RUN_REPLICATION_PUBLICATION_NAME,
169168
legacyOriginGeneration: env.RUN_REPLICATION_LEGACY_ORIGIN_GENERATION,

apps/webapp/test/runsReplicationInstance.test.ts

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ describe("assertReplicationCoversSplit (boot gate-coupling)", () => {
168168
newOriginGeneration: 1,
169169
};
170170

171-
it("throws when split is on but sources[] has no \"new\" source (the silent under-count)", () => {
171+
it('throws when split is on but sources[] has no "new" source (the silent under-count)', () => {
172172
// Split on, but the new replication source is forced off — ksuid runs would not
173173
// reach ClickHouse. This is the exact misconfiguration the boot gate must refuse to boot with.
174174
const sources = buildReplicationSources({
@@ -268,9 +268,16 @@ describe("RunsReplication new-source backfill origin generation (integration)",
268268

269269
// Create org/project/env/run on the legacy DB (the FK schema lives there).
270270
// This simulates a pre-existing run that was migrated to the dedicated DB.
271-
const organization = await prisma.organization.create({ data: { title: "bf-gen", slug: "bf-gen" } });
271+
const organization = await prisma.organization.create({
272+
data: { title: "bf-gen", slug: "bf-gen" },
273+
});
272274
const project = await prisma.project.create({
273-
data: { name: "bf-gen", slug: "bf-gen", organizationId: organization.id, externalRef: "bf-gen" },
275+
data: {
276+
name: "bf-gen",
277+
slug: "bf-gen",
278+
organizationId: organization.id,
279+
externalRef: "bf-gen",
280+
},
274281
});
275282
const runtimeEnvironment = await prisma.runtimeEnvironment.create({
276283
data: {
@@ -303,16 +310,14 @@ describe("RunsReplication new-source backfill origin generation (integration)",
303310

304311
try {
305312
// Backfill the run via the "new" source — must encode gen=1 in _version.
306-
await service.backfill(
307-
[{ ...run, masterQueue: run.workerQueue ?? "main" }],
308-
"new"
309-
);
313+
await service.backfill([{ ...run, masterQueue: run.workerQueue ?? "main" }], "new");
310314

311315
await setTimeout(500);
312316

313317
const queryRuns = clickhouse.reader.query({
314318
name: "runs-replication-backfill-gen",
315-
query: "SELECT run_id, _version FROM trigger_dev.task_runs_v2 WHERE run_id = {run_id:String}",
319+
query:
320+
"SELECT run_id, _version FROM trigger_dev.task_runs_v2 WHERE run_id = {run_id:String}",
316321
schema: z.object({ run_id: z.string(), _version: z.number() }),
317322
params: z.object({ run_id: z.string() }),
318323
});

0 commit comments

Comments
 (0)