nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.61k stars 2.36k forks source link

core: `dependsOn` local project overrides regression (introduced between nx 19.4 - 19.5) #27258

Closed Hotell closed 3 months ago

Hotell commented 3 months ago

Current Behavior

dependsOn overrides no longer work

following configuration worked with nx 19.3:

image

with nx 19.5 it doesn't work anymore:

image

Expected Behavior

dependsOn overrides should work as before (merge of inferred target with manually specified bug)

Workaround:

if full target definition is manually provided it works as before

image

GitHub Repo

https://github.com/microsoft/fluentui/pull/32136

Steps to Reproduce

  1. see failing pipeline

Nx Report

NX   Report complete - copy this into the issue template

Node           : 20.15.0
OS             : darwin-arm64
Native Target  : aarch64-macos
yarn           : 1.23.34

nx                 : 19.5.4
@nx/js             : 19.5.4
@nx/jest           : 19.5.4
@nx/linter         : 19.5.4
@nx/eslint         : 19.5.4
@nx/workspace      : 19.5.4
@nx/devkit         : 19.5.4
@nx/eslint-plugin  : 19.5.4
@nx/node           : 19.5.4
@nx/plugin         : 19.5.4
@nrwl/tao          : 19.5.4
typescript         : 5.0.4
---------------------------------------
Local workspace plugins:
         @fluentui/workspace-plugin

Failure Logs

No response

Package Manager Version

yarn v1

Operating System

Additional Information

No response

AgentEnder commented 3 months ago

@Hotell Can you provide more detail as to what I can clone and try to run from that PR that exhibits the problem? I tried to repro in a fresh run and did not see an issue.

Hotell commented 3 months ago
  1. this is the PR I linked in issue description - https://github.com/microsoft/fluentui/pull/32136 - please check it out
  2. all the test-perf are failing because targets are not executed as before ( nx 19.3 ) https://uifabric.visualstudio.com/fabricpublic/_build/results?buildId=355023&view=logs&j=4a446d69-1b32-5c30-7305-e0c1f94959f8
  3. local repro:
    • yarn install
    • yarn nx reset
    • run yarn nx run perf-test:test-perf -> nothing will be run. this is the reported bug
      • perf-test app overrides bundle target to not run dependency build targets ( global nx config ), but it won't run anything, so test-perf wont have any assets ready to be run agains perf test
      • image

So to recap:

Before (nx 19.3)

yarn nx run perf-test:test-perf executes: -> perf-test:bundle -> perf-test:test-perf

After (nx 19.5)

yarn nx run perf-test:test-perf executes: -> nothing

when trying to run bundle directly NX throw error

yarn nx run perf-test:bundle --skip-nx-cache --verbose
yarn run v1.23.34
$ /fluentui/node_modules/.bin/nx run perf-test:bundle --skip-nx-cache --verbose

🚨 NX   Cannot find configuration for task perf-test:bundle

Error: Cannot find configuration for task perf-test:bundle
    at ProcessTasks.createTask (/Users/martinhochel/Projects/msft/fluentui/node_modules/nx/src/tasks-runner/create-task-graph.js:141:19)
    at ProcessTasks.processTasks (/Users/martinhochel/Projects/msft/fluentui/node_modules/nx/src/tasks-runner/create-task-graph.js:32:39)
    at createTaskGraph (/Users/martinhochel/Projects/msft/fluentui/node_modules/nx/src/tasks-runner/create-task-graph.js:180:21)
    at createTaskGraphAndRunValidations (/Users/martinhochel/Projects/msft/fluentui/node_modules/nx/src/tasks-runner/run-command.js:68:63)
    at /Users/martinhochel/Projects/msft/fluentui/node_modules/nx/src/tasks-runner/run-command.js:96:27
    at handleErrors (/Users/martinhochel/Projects/msft/fluentui/node_modules/nx/src/utils/params.js:22:30)
    at runCommand (/Users/martinhochel/Projects/msft/fluentui/node_modules/nx/src/tasks-runner/run-command.js:94:52)
    at Object.runOne (/Users/martinhochel/Projects/msft/fluentui/node_modules/nx/src/command-line/run/run-one.js:53:59)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /Users/martinhochel/Projects/msft/fluentui/node_modules/nx/src/command-line/run/command-object.js:19:13
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

lemme know if you need anything else. ty

AgentEnder commented 3 months ago

Ok, got a minimal repro locally. Thanks for the info @Hotell 👋

Hotell commented 3 months ago

This team rocks! Thx a ton folks for quick fix. 🍻

github-actions[bot] commented 2 months ago

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.