You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When defining a task graph that has tasks defined in both nx.json and project.json, it is expected that the dependsOn is inherited by the nx.json implemention if not otherwise overridden by project.json.
In fact, this is consistent with the task graph displayed by nx graph.
However, when overriding targets in project.json, the dependency order is not always respected. This conflicts with the graph which claims it still is.
Create two "meta-targets" build and test. These are simply nx:noop executors that point to a series of real targets for user convenicence.
Building is bound to a single target build-impl.
Testing is bound to two targets test-impl and report-impl. These both depend on build being complete.
For simplicity, these default implementations are a 1 second wait, then logging their name.
report-impl is overwritten in project.json to just immediately log the name.
Inspect the task graph nx graph appears to confirm that a test command would:
Run build
Run test
Generate report
Running nx run foo:test actually results in the following logs:
REPORT
BUILD
TEST
The report step is executed immediately, despite the dependency graph claiming otherwise.
Expected Behavior
Running nx run foo:test should result in the following logs:
No failure logs, just unexpected execution order.
This _can_ easily induce unrelated failure logs, like in the example above trying to execute tests before the build even starts.
Package Manager Version
pnpm 9.5.0
Operating System
macOS
Linux
Windows
Other (Please specify)
Additional Information
I've tried reducing the example case and don't always see it, but definitely experiencing it 10-fold in my live repo.
Attached is image of nx graph. While the dependency explanation above may seem a bit unclear, hopefully it is fairly obvious here that a fairly linear execution of tasks is expected here. I agree with the output provided by nx graph, it is the actual execution of run that is out of order.
The text was updated successfully, but these errors were encountered:
Current Behavior
When defining a task graph that has tasks defined in both
nx.json
andproject.json
, it is expected that thedependsOn
is inherited by thenx.json
implemention if not otherwise overridden byproject.json
.In fact, this is consistent with the task graph displayed by
nx graph
.However, when overriding targets in
project.json
, the dependency order is not always respected. This conflicts with the graph which claims it still is.Create two "meta-targets"
build
andtest
. These are simplynx:noop
executors that point to a series of real targets for user convenicence.Building is bound to a single target
build-impl
.Testing is bound to two targets
test-impl
andreport-impl
. These both depend onbuild
being complete.For simplicity, these default implementations are a 1 second wait, then logging their name.
report-impl
is overwritten inproject.json
to just immediately log the name.Inspect the task graph
nx graph
appears to confirm that a test command would:Running
nx run foo:test
actually results in the following logs:The report step is executed immediately, despite the dependency graph claiming otherwise.
Expected Behavior
Running
nx run foo:test
should result in the following logs:GitHub Repo
https://github.com/JacobLey/issue-recreator/tree/nx-task-dependency-order
Steps to Reproduce
pnpm i
nx graph
report-impl
task has bothbuild-imp
andtest-impl
as dependenciesnx run foo:test
REPORT
beforeBUILD
(andTEST
), meaning that it did not properly block on a dependency.Nx Report
Failure Logs
No failure logs, just unexpected execution order. This _can_ easily induce unrelated failure logs, like in the example above trying to execute tests before the build even starts.
Package Manager Version
pnpm 9.5.0
Operating System
Additional Information
I've tried reducing the example case and don't always see it, but definitely experiencing it 10-fold in my live repo.
Attached is image of
![Screenshot 2024-07-13 at 9 54 49 PM](https://private-user-images.githubusercontent.com/37151850/348512899-8570cf5d-7a10-4cb3-a4a3-8c1ef193d4c6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU1OTI1NTAsIm5iZiI6MTcyNTU5MjI1MCwicGF0aCI6Ii8zNzE1MTg1MC8zNDg1MTI4OTktODU3MGNmNWQtN2ExMC00Y2IzLWE0YTMtOGMxZWYxOTNkNGM2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA2VDAzMTA1MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPThkYmQwZjFmOWVhZDcyZDNiOWVkMDYxMjgzZmJkMzM0NWJiYmZlZWUzNmYyYjU4Yjk0YTcyZDVlZjYxNzMyZmImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.JVwjEVxjZVz4uIKG25StBqTtJU2PI1UfhYr3SeEKiwM)
nx graph
. While the dependency explanation above may seem a bit unclear, hopefully it is fairly obvious here that a fairly linear execution of tasks is expected here. I agree with the output provided bynx graph
, it is the actual execution ofrun
that is out of order.The text was updated successfully, but these errors were encountered: