Skip to content

Commit a5fccbe

Browse files
committed
fix: reconcile Zod 4 migration with current schemas
1 parent ed21fe8 commit a5fccbe

20 files changed

Lines changed: 42 additions & 38 deletions

File tree

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.alerts.new/route.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ export default function Page() {
277277
if (lastSubmission !== undefined) return;
278278

279279
form.reset();
280-
}, [navigation.state, lastSubmission]);
280+
}, [navigation.state, lastSubmission, form]);
281281

282282
return (
283283
<Dialog

apps/webapp/app/routes/api.v1.deployments.$deploymentId.build-env-vars.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
8787
}
8888

8989
const decrypted = await decryptSecret(env.ENCRYPTION_KEY, envelope.data);
90-
const variables = z.record(z.string()).parse(JSON.parse(decrypted));
90+
const variables = z.record(z.string(), z.string()).parse(JSON.parse(decrypted));
9191

9292
return json({ variables } satisfies GetDeploymentBuildEnvVarsResponseBody, { status: 200 });
9393
} catch (error) {

apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.schedules.new/route.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ export function UpsertScheduleForm({
228228
const result = ScheduleWindow.safeParse(scheduleWindowValue);
229229
scheduleWindowResult = result.success
230230
? { isValid: true }
231-
: { isValid: false, error: result.error.errors[0].message };
231+
: { isValid: false, error: result.error.issues[0].message };
232232
}
233233

234234
if (cronPattern !== "") {
@@ -237,7 +237,7 @@ export function UpsertScheduleForm({
237237
if (!result.success) {
238238
cronPatternResult = {
239239
isValid: false,
240-
error: result.error.errors[0].message,
240+
error: result.error.issues[0].message,
241241
};
242242
} else {
243243
try {

apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.webhooks.endpoints.$endpointParam.send.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const SigningSecretSchema = z.object({ secret: z.string() });
2323

2424
const SendSchema = z.object({
2525
body: z.string(),
26-
headers: z.record(z.string()).optional(),
26+
headers: z.record(z.string(), z.string()).optional(),
2727
signatureMode: z.enum(["signed", "unsigned", "tampered", "simulate"]).default("signed"),
2828
redirect: z.boolean().default(true),
2929
});

apps/webapp/app/v3/alertsWorker.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const DashboardAgentWatchAlertPayload = z.object({
2929
kind: z.string(),
3030
note: z.string(),
3131
firedAt: z.string(),
32-
facts: z.record(z.unknown()),
32+
facts: z.record(z.string(), z.unknown()),
3333
// Optional so a job enqueued before this deploy still validates and delivers.
3434
resolution: watchResolutionSchema.optional().catch(undefined),
3535
// `.catch` so an unrecognized observation shape degrades instead of dropping the alert.

apps/webapp/test/helpers/apiRunListPresenterTestHelpers.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ export async function insertTaskRunV2Rows(clickhouse: ClickHouse, runs: TaskRun[
157157
task_version: run.taskVersion ?? "",
158158
sdk_version: run.sdkVersion ?? "",
159159
cli_version: run.cliVersion ?? "",
160+
output: null,
161+
error: null,
160162
machine_preset: run.machinePreset ?? "",
161163
root_run_id: "",
162164
parent_run_id: "",

internal-packages/dashboard-agent-contracts/src/blocks.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ export const reportMetricSchema = z
256256
})
257257
.passthrough()
258258
.optional(),
259-
breakdown: z.record(z.number()).optional(),
259+
breakdown: z.record(z.string(), z.number()).optional(),
260260
annotation: z
261261
.object({ code: reasonCodeSchema, value: z.number().optional() })
262262
.passthrough()
@@ -272,7 +272,7 @@ export const reportRecommendationSchema = z
272272
.passthrough();
273273

274274
const codeWithEvidenceSchema = z
275-
.object({ code: reasonCodeSchema, evidence: z.record(z.number()).optional() })
275+
.object({ code: reasonCodeSchema, evidence: z.record(z.string(), z.number()).optional() })
276276
.passthrough();
277277

278278
export const reportFindingSchema = z
@@ -337,7 +337,7 @@ export const reportViewModelSchema = z
337337
findings: z.array(reportFindingSchema).default([]),
338338
metrics: z.array(reportMetricSchema).default([]),
339339
/** Free-form. The card reads only `trustworthy`. */
340-
facts: z.record(z.unknown()).default({}),
340+
facts: z.record(z.string(), z.unknown()).default({}),
341341
links: z.array(reportLinkSchema).default([]),
342342
footer: z.array(reportFooterEntrySchema).default([]),
343343
})

internal-packages/dashboard-agent/src/watch-actions.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@ export const watchWakeActionSchema = z.object({
9696
checkEveryMinutes: z.number().optional(),
9797
})
9898
.passthrough(),
99-
facts: z.record(z.unknown()).default({}),
99+
facts: z.record(z.string(), z.unknown()).default({}),
100100
// Optional for the same reason: an older watcher predating the resolution model
101101
// sends neither, and the narration falls back to the transport encoding.
102102
resolution: z.enum(watchResolutions).optional(),
103-
observed: z.record(z.unknown()).optional(),
103+
observed: z.record(z.string(), z.unknown()).optional(),
104104
note: z.string().optional(),
105105
investigateOnAttention: z.boolean().optional(),
106106
});
@@ -147,9 +147,9 @@ export const watchInvestigateActionSchema = z.object({
147147
checkEveryMinutes: z.number().optional(),
148148
})
149149
.passthrough(),
150-
facts: z.record(z.unknown()).default({}),
150+
facts: z.record(z.string(), z.unknown()).default({}),
151151
resolution: z.enum(watchResolutions).optional(),
152-
observed: z.record(z.unknown()).optional(),
152+
observed: z.record(z.string(), z.unknown()).optional(),
153153
note: z.string().optional(),
154154
investigationId: z.string().optional(),
155155
});

internal-packages/webhook-sources/src/sampleRecord.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const SampleRecord = z.object({
2626
name: z.string(),
2727
description: z.string().optional(),
2828
body: z.unknown(),
29-
extraHeaders: z.record(z.string()).optional(),
29+
extraHeaders: z.record(z.string(), z.string()).optional(),
3030
docsUrl: z.string().optional(),
3131
provenance: SampleProvenance,
3232
});

packages/cli-v3/src/entryPoints/managed/snapshot.test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,6 @@ describe("SnapshotManager", () => {
368368
const executionOrder: string[] = [];
369369
const executionTimes: { start: number; end: number; type: string }[] = [];
370370
let currentlyExecuting = false;
371-
let _handlerExecutionCount = 0;
372371

373372
const manager = new SnapshotManager({
374373
runnerId: "test-runner-1",
@@ -381,7 +380,6 @@ describe("SnapshotManager", () => {
381380
throw new Error("Handler executed while another handler was running");
382381
}
383382
currentlyExecuting = true;
384-
handlerExecutionCount++;
385383

386384
const start = Date.now();
387385
executionOrder.push(`snapshot:${data.snapshot.friendlyId}`);
@@ -396,7 +394,6 @@ describe("SnapshotManager", () => {
396394
throw new Error("Handler executed while another handler was running");
397395
}
398396
currentlyExecuting = true;
399-
handlerExecutionCount++;
400397

401398
const start = Date.now();
402399
executionOrder.push(`suspendable:${state.id}`);

0 commit comments

Comments
 (0)