Skip to content

Commit 7241f8b

Browse files
llwtFrozenPandaz
authored andcommitted
fix(devkit): add startTime and endTime to TaskResult interface (#34996)
## Current Behavior The `TaskResult` interface exported from the devkit is missing `startTime` and `endTime` properties. At runtime, these properties are present on `TaskResult` objects — set by the task orchestrator during execution and consumed by multiple lifecycle implementations (profiling, timings, history, store-run-information) — but the public type does not declare them. This means the [TaskResult reference docs](https://nx.dev/docs/reference/devkit/TaskResult) don't show these fields. ## Expected Behavior The `TaskResult` interface includes optional `startTime` and `endTime` properties (Unix timestamps) matching what is actually present on runtime objects. The generated devkit reference docs will now include these fields. ## Related Issue(s) N/A (cherry picked from commit 6cc8735)
1 parent 792d09b commit 7241f8b

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

packages/nx/src/tasks-runner/life-cycle.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ import { TaskStatus } from './tasks-runner';
99

1010
/**
1111
* The result of a completed {@link Task}
12+
*
13+
* Task timing information (start and end timestamps) is available
14+
* on the {@link Task} object itself via {@link Task.startTime} and
15+
* {@link Task.endTime}.
1216
*/
1317
export interface TaskResult {
1418
task: Task;

packages/nx/src/tasks-runner/task-orchestrator.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,6 @@ export class TaskOrchestrator {
622622
task.startTime = result.startTime;
623623
task.endTime = result.endTime;
624624
return {
625-
...result,
626625
code: result.success ? 0 : 1,
627626
task,
628627
status: (result.success ? 'success' : 'failure') as TaskStatus,

0 commit comments

Comments
 (0)