Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const baseInfo: InvocationInfo = {
executionInput: {},
operations: {},
updatedOperations: {},
executionStartTimestamp: new Date("2024-01-01T00:00:00Z"),
};

describe("xRayContextExtractor", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ function makeInvocationInfo(
executionInput: {},
operations: {},
updatedOperations: {},
executionStartTimestamp: new Date("2024-01-01T00:00:00Z"),
...overrides,
};
}
Expand All @@ -57,6 +58,7 @@ function makeInvocationEndInfo(
status: "SUCCEEDED" as any,
executionResult: undefined,
executionError: undefined,
executionStartTimestamp: new Date("2024-01-01T00:00:00Z"),
...overrides,
};
}
Expand Down
6 changes: 6 additions & 0 deletions packages/aws-durable-execution-sdk-js/src/types/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ export interface InvocationBaseInfo {
executionArn: string;
executionInput: unknown;
operations: Record<string, OperationInfo>;
/**
* The timestamp when the overall durable execution was first started,
* as reported by the backend. This remains the same across all
* invocations (including replays) of a given execution.
*/
executionStartTimestamp?: Date;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ describe("createPluginRunner", () => {
executionInput: { test: true },
operations: {},
updatedOperations: {},
executionStartTimestamp: new Date("2024-01-01T00:00:00Z"),
};

const operationInfo: OperationInfo = {
Expand Down Expand Up @@ -723,6 +724,7 @@ describe("createPluginRunner", () => {
executionResult: { data: "test" },
executionInput: { event: "input" },
operations: {},
executionStartTimestamp: new Date("2024-01-01T00:00:00Z"),
};

it.each([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,14 @@ const mockTerminationManager = {
setCheckpointTerminatingCallback: jest.fn(),
};
const mockExecutionContext = {
_stepData: {},
_stepData: {
"initial-op": {
StartTimestamp: new Date("2024-06-01T12:00:00Z"),
ExecutionDetails: {
InputPayload: "{}",
},
},
},
durableExecutionArn: "arn:test",
requestId: "req-123",
terminationManager: mockTerminationManager,
Expand Down Expand Up @@ -89,6 +96,7 @@ describe("plugin hooks", () => {
executionInput: expect.anything(),
operations: expect.any(Object),
updatedOperations: expect.any(Object),
executionStartTimestamp: new Date("2024-06-01T12:00:00Z"),
});
});

Expand All @@ -111,6 +119,7 @@ describe("plugin hooks", () => {
executionInput: expect.anything(),
operations: expect.any(Object),
updatedOperations: expect.any(Object),
executionStartTimestamp: new Date("2024-06-01T12:00:00Z"),
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ async function runHandler<
executionArn: executionContext.durableExecutionArn,
executionInput: customerHandlerEvent,
operations: allOperations,
executionStartTimestamp: initialExecutionEvent?.StartTimestamp ?? undefined,
};

const invocationInfo: InvocationInfo = {
Expand Down
Loading