mirror of
https://github.com/whyour/qinglong.git
synced 2026-09-20 16:07:11 +08:00
feat(ql3): establish 3.0 incubation baseline
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import type { ExecutionSpec } from './execution';
|
||||
import { cloneExecutionSpec } from './executionSpec';
|
||||
import type { RunDispatchCandidate } from './runDispatchCandidate';
|
||||
|
||||
/** Normalizes a trusted plan and binds it to one persisted candidate identity. */
|
||||
export function executionSpecForRunDispatchCandidate(
|
||||
candidate: RunDispatchCandidate,
|
||||
value: ExecutionSpec,
|
||||
): ExecutionSpec {
|
||||
const executionSpec = cloneExecutionSpec(value);
|
||||
if (
|
||||
executionSpec.runId !== candidate.runId ||
|
||||
executionSpec.attemptId !== candidate.attemptId ||
|
||||
executionSpec.projectId !== candidate.projectId ||
|
||||
executionSpec.taskId !== candidate.taskId ||
|
||||
executionSpec.taskRevision !== candidate.taskRevision
|
||||
) {
|
||||
throw new TypeError(
|
||||
'ExecutionSpec identity does not match its dispatch candidate',
|
||||
);
|
||||
}
|
||||
return executionSpec;
|
||||
}
|
||||
Reference in New Issue
Block a user