refactor(run-engine): make taskIdentifier optional on run-queue messages (#3559)
## Summary Make `taskIdentifier` optional on the run-queue message schema. No behavior change in this PR; readers continue to accept payloads that include the field. A separate change will stop writing it on the wire to shrink the per-run payload that lives in Redis while runs wait to be dequeued. ## Design The field is written into every payload at enqueue time but no consumer reads it back on the dequeue path. Both the run-engine and supervisor derive `taskIdentifier` from the loaded `TaskRun` row instead. Relaxing the schema first means readers tolerate payloads that omit it, so the writer-side change can ship without producing schema-parse errors during a rolling deploy. `projectId` is left required: `WorkerQueueResolver.#getOverride` reads it for project-scoped runtime worker-queue overrides. ## Test plan - [x] `pnpm run typecheck --filter @internal/run-engine` - [x] `pnpm run typecheck --filter webapp` - [x] `pnpm run test ./src/run-queue/tests/enqueueMessage.test.ts ./src/run-queue/tests/workerQueueResolver.test.ts --run` (28/28 passing)
This commit is contained in:
@@ -4,7 +4,8 @@ import type { MinimalAuthenticatedEnvironment } from "../shared/index.js";
|
||||
|
||||
export const InputPayload = z.object({
|
||||
runId: z.string(),
|
||||
taskIdentifier: z.string(),
|
||||
/** Deprecated: not read on the V2 dequeue path; will stop being written in a follow-up. Optional to keep new readers compatible with old payloads that still include it, and vice versa. */
|
||||
taskIdentifier: z.string().optional(),
|
||||
orgId: z.string(),
|
||||
projectId: z.string(),
|
||||
environmentId: z.string(),
|
||||
|
||||
Reference in New Issue
Block a user