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
I run nx print-affected --targets=lint | jq .targets to see which lint commands need to be run. This gives back a JSON with targets, commands and the task hash:
We can see that the task hash for running the command yarn nx run crush-report-e2e:lint should be 13337821e832dcffc9afa0bdf9598aea274acc99f03f9defa6a2d21f91705890.
I then run rm -rf .nx-cache and yarn nx run crush-report-e2e:lint which lints and then writes the cache files - but with a different hash. e.g. 5bbb49c819e3dcd0bfc4b7a8b05a31ea86a3250ecccae516a0a28d05e1791bba.
Expected Behavior
I'd expect that the hash from .targets[0].hash that nx print-affected outputs matches the hash that is computed for running .targets[0].command.
The call to the default Hasher.hashTask() returns the same hash in both cases. But the custom hasher for the linter returns a different hash (and details).
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs.
If we missed this issue please reply to keep it active.
Thanks for being a part of the Nx community! 🙏
This cannot always be the case because tasks can depend on something from dependent tasks. This is only correct when the dependent task is actually run. I'm going to close this issue in favor of the discussion here which also discusses seeing hashes in affected --graph
Current Behavior
I run
nx print-affected --targets=lint | jq .targets
to see which lint commands need to be run. This gives back a JSON with targets, commands and the task hash:We can see that the task hash for running the command
yarn nx run crush-report-e2e:lint
should be13337821e832dcffc9afa0bdf9598aea274acc99f03f9defa6a2d21f91705890
.I then run
rm -rf .nx-cache
andyarn nx run crush-report-e2e:lint
which lints and then writes the cache files - but with a different hash. e.g.5bbb49c819e3dcd0bfc4b7a8b05a31ea86a3250ecccae516a0a28d05e1791bba
.Expected Behavior
I'd expect that the hash from
.targets[0].hash
thatnx print-affected
outputs matches the hash that is computed for running.targets[0].command
.GitHub Repo
No response
Steps to Reproduce
This can be reproduced in nrwl/nx-examples
yarn nx run cart:lint
yarn nx run cart:lint
used for remote cache:yarn nx print-affected --target=lint
and look at the JSON output. The task has a different hash:Nx Report
Failure Logs
No response
Additional Information
Brief investigation into this makes me suspect that the difference is coming from
hasher.ts
innx/packages/linter/src/executors/eslint/hasher.ts
Line 10 in c53d9c3
The call to the default
Hasher.hashTask()
returns the same hash in both cases. But the custom hasher for the linter returns a different hash (and details).The text was updated successfully, but these errors were encountered: