Skip to content

Commit c02f1ea

Browse files
committed
feat(core,run-engine): expose a deployment's external id on the run context
A run knew its version but not the --external-id it was deployed under, so it could not tell whether it was the deployment a version skew protection pin currently names. A version cannot answer that: the pin is an opaque string and nothing maps one to the other. The deployment row is already fully selected and SWR-cached where the run context is built, so this adds no query.
1 parent 8d73d80 commit c02f1ea

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

internal-packages/run-engine/src/engine/systems/runAttemptSystem.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2008,6 +2008,7 @@ export class RunAttemptSystem {
20082008
runtime: worker.deployment.runtime ?? "unknown",
20092009
runtimeVersion: worker.deployment.runtimeVersion ?? "unknown",
20102010
git: safeParseGitMeta(worker.deployment.git),
2011+
externalId: worker.deployment.externalId ?? undefined,
20112012
};
20122013
});
20132014

packages/core/src/v3/schemas/common.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,12 @@ export const TaskRunExecutionDeployment = z.object({
340340
runtime: z.string(),
341341
runtimeVersion: z.string(),
342342
git: GitMeta.optional(),
343+
/**
344+
* The `--external-id` this deployment was deployed under. Lets a run tell whether
345+
* it is the deployment a version-skew pin currently names, which a version alone
346+
* cannot answer.
347+
*/
348+
externalId: z.string().optional(),
343349
});
344350

345351
export type TaskRunExecutionDeployment = z.infer<typeof TaskRunExecutionDeployment>;

0 commit comments

Comments
 (0)