fix(devkit): add timing guidance to TaskResult and remove unintentional spread#34996
Conversation
✅ Deploy Preview for nx-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for nx-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
View your CI Pipeline Execution ↗ for commit 03df73e
☁️ Nx Cloud last updated this comment at |
…al spread The TaskResult interface's JSDoc now points users to Task.startTime and Task.endTime for timing information. Also removes the ...result spread in the batch execution path that was unintentionally leaking batch-only properties (startTime, endTime) onto the TaskResult object.
a3f48ac to
434ced2
Compare
There was a problem hiding this comment.
Nx Cloud has identified a flaky task in your failed CI:
🔂 Since the failure was identified as flaky, we triggered a CI rerun by adding an empty commit to this branch.
🔔 Heads up, your workspace has pending recommendations ↗ to auto-apply fixes for similar failures.
🎓 Learn more about Self-Healing CI on nx.dev
…al spread The TaskResult interface's JSDoc now points users to Task.startTime and Task.endTime for timing information. Also removes the ...result spread in the batch execution path that was unintentionally leaking batch-only properties (startTime, endTime) onto the TaskResult object. [Self-Healing CI Rerun]
## 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)
|
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Current Behavior
The
TaskResultinterface has no JSDoc guidance about where to find task timing information. Users looking at the TaskResult reference docs don't seestartTime/endTimeand have no indication that timing is available on the nestedTaskobject.Additionally, the batch execution path in
task-orchestrator.tsuses...resultto spread the batchTaskResult(frommisc-interfaces.ts) onto the lifecycleTaskResult, which unintentionally leaksstartTime,endTime, andsuccessproperties onto the object. This only happens for batch tasks, not for regular tasks, making the behavior inconsistent.Expected Behavior
TaskResultJSDoc now points users toTask.startTimeandTask.endTimefor timing information, which will surface on the generated reference docs...resultspread is removed from the batch path so that only the intendedTaskResultproperties (code,task,status,terminalOutput) are set — timing stays on theTaskobject where it belongs (already copied viatask.startTime = result.startTime/task.endTime = result.endTimeon the lines above)Related Issue(s)
N/A