fix(core): ensure batch tasks always have hash for DTE#34764
fix(core): ensure batch tasks always have hash for DTE#34764FrozenPandaz merged 15 commits intomasterfrom
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 7b2587f
☁️ Nx Cloud last updated this comment at |
3c776e5 to
30776d5
Compare
868a863 to
533dd9f
Compare
🐳 We have a release for that!This PR has a release associated with it. You can try it out using this command: npx create-nx-workspace@22.6.0-pr.34764.868a863 my-workspaceOr just copy this version and use it in your own command: 22.6.0-pr.34764.868a863
To request a new release for this pull request, mention someone from the Nx team or the |
🐳 We have a release for that!This PR has a release associated with it. You can try it out using this command: npx create-nx-workspace@22.6.0-pr.34764.c1c3b27 my-workspaceOr just copy this version and use it in your own command: 22.6.0-pr.34764.c1c3b27
To request a new release for this pull request, mention someone from the Nx team or the |
|
Failed to publish a PR release of this pull request, triggered by @FrozenPandaz. |
🐳 We have a release for that!This PR has a release associated with it. You can try it out using this command: npx create-nx-workspace@22.6.0-pr.34764.a957296 my-workspaceOr just copy this version and use it in your own command: 22.6.0-pr.34764.a957296
To request a new release for this pull request, mention someone from the Nx team or the |
|
Failed to publish a PR release of this pull request, triggered by @AgentEnder. |
|
Failed to publish a PR release of this pull request, triggered by @FrozenPandaz. |
|
Failed to publish a PR release of this pull request, triggered by @FrozenPandaz. |
|
Failed to publish a PR release of this pull request, triggered by @FrozenPandaz. |
In batch mode, Phase 2 tasks (those with depsOutputs and non-cached deps) are hashed after execution, not before. The streaming callback was calling endTasks for these tasks before they had a hash, sending undefined to Cloud which rejects null hashes on runs/end. Remove endTasks from the streaming callback entirely and let postRunSteps handle it for all batch tasks. This ensures every task has its correct final hash when Cloud/DTE receives the completion event. Also removes the now-unnecessary batchTaskResultsStreamed set.
Split streaming callback concerns: setTaskTiming + setTaskStatus for real-time TUI updates, endTasks fires once from postRunSteps after hashing so Cloud always receives correct hash values.
The tui-summary lifecycle didn't need to change for the batch hash fix. Reverting to master restores the working endTasks counting logic.
Instead of deferring hashing for ineligible tasks, hash all tasks at each level (preliminary hash). Only skip cache lookup for depsOutputs tasks with non-cached deps. After execution, re-hash only those tasks so they get correct hashes based on fresh outputs on disk.
…Batches Move scheduleTask calls to after applyBatchCachedResults so tasks have valid hashes when the cloud lifecycle reads scheduledTasks. Remove the now-unused processedBatches map.
Co-authored-by: FrozenPandaz <FrozenPandaz@users.noreply.github.com>
110f2d0 to
07d8b15
Compare
|
Failed to publish a PR release of this pull request, triggered by @AgentEnder. |
🐳 We have a release for that!This PR has a release associated with it. You can try it out using this command: npx create-nx-workspace@22.6.0-pr.34764.07d8b15 my-workspaceOr just copy this version and use it in your own command: 22.6.0-pr.34764.07d8b15
To request a new release for this pull request, mention someone from the Nx team or the |
…s-runner [Self-Healing CI Rerun]
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
|
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
After #34446, batch tasks with
depsOutputsinputs had their hashing deferred until after execution. This meant the streamingendTaskscallback fired withtask.hash = undefined, which Cloud/DTE rejects.Expected Behavior
All batch tasks always have a valid hash when
endTasksis called. Tasks withdepsOutputsget a preliminary hash upfront (based on whatever outputs are on disk), then are re-hashed after execution with fresh outputs for correct cache storage.How it works
Related Issue(s)
Fixes the undefined hash regression from #34446