Skip to content

fix(core): include continuous and default-config dependencies in show target - #36374

Merged
AgentEnder merged 2 commits into
masterfrom
nxc-4682
Jul 16, 2026
Merged

fix(core): include continuous and default-config dependencies in show target#36374
AgentEnder merged 2 commits into
masterfrom
nxc-4682

Conversation

@leosvelperez

Copy link
Copy Markdown
Member

Current Behavior

nx show target <project>:<target> reports no Depends On entries in two cases:

  • the target declares a defaultConfiguration
  • a dependsOn entry resolves to a continuous task, such as a dev server

In both cases the dependency is not dropped from the output entirely, it is misfiled: it shows up in the transitive task summary instead. With a defaultConfiguration, the target's own root task also leaks into its transitive task list.

This is visible on a Playwright e2e target whose dependsOn points at a continuous serve task: nx show project lists the dependency, while nx show target shows nothing under Depends On.

Both regressed in #35367, when show target moved from static config resolution to task-graph resolution.

Expected Behavior

nx show target lists continuous and default-configuration dependencies under Depends On, matching what nx show project reports, and the transitive task summary contains only genuinely transitive tasks.

Implementation Details

Two separate causes, both in resolveTaskGraphDependencies:

  • The root task id was rebuilt with createTaskId(project, target, configuration) from the raw configuration argument. createTaskGraph resolves the target's defaultConfiguration, so the real root task id carries a :<config> suffix that the reconstructed id lacked. The lookup missed, leaving dependsOn empty and letting the root task fall through into its own transitiveTasks. The root task is now resolved from the task graph by (project, target) instead of being reconstructed.
  • A dependsOn edge that resolves to a continuous task is stored in taskGraph.continuousDependencies, not taskGraph.dependencies, and the command only read the latter. The direct dependencies are now the union of both maps.

The two compound: with the wrong root id, continuousDependencies[rootId] is also undefined, so reading the continuous map only takes effect once the root id is correct.

Added a regression test covering both: a target with a defaultConfiguration depending on a continuous target in another project. It fails on the current code (dependsOn comes back undefined) and passes with the fix.


View session information ↗

… target

`nx show target` reported no direct dependencies for a target whose `dependsOn`
resolves to a continuous task, or whose target declares a `defaultConfiguration`.
In both cases the dependency instead leaked into the transitive task list, and
the root task leaked into its own transitive tasks.

The root task id was rebuilt from the raw `configuration` argument, so a target
with a `defaultConfiguration` never matched the `project:target:<config>` id that
`createTaskGraph` resolves it to, leaving the dependency lookup empty. Separately,
a `dependsOn` edge that resolves to a continuous task is stored in
`continuousDependencies` rather than `dependencies`, which the command never read.

Resolve the root task from the task graph by project and target instead of
reconstructing its id, and union both dependency maps for the direct dependencies.
@netlify

netlify Bot commented Jul 16, 2026

Copy link
Copy Markdown

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit c5fe06b
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/6a58afa4cdb1950007b13cf9
😎 Deploy Preview https://deploy-preview-36374--nx-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Jul 16, 2026

Copy link
Copy Markdown

Deploy Preview for nx-dev ready!

Name Link
🔨 Latest commit c5fe06b
🔍 Latest deploy log https://app.netlify.com/projects/nx-dev/deploys/6a58afa41f660100076b1cb9
😎 Deploy Preview https://deploy-preview-36374--nx-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@nx-cloud

nx-cloud Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit f47dc54

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 22m 20s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 2s View ↗
nx-cloud record -- pnpm nx-cloud conformance:check ✅ Succeeded 45s View ↗
nx build workspace-plugin ✅ Succeeded <1s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 14s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 4s View ↗

☁️ Nx Cloud last updated this comment at 2026-07-16 10:43:42 UTC

@leosvelperez leosvelperez self-assigned this Jul 16, 2026

@nx-cloud nx-cloud Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Nx Cloud View detailed reasoning in Nx Cloud ↗


🎓 Learn more about Self-Healing CI on nx.dev

@leosvelperez
leosvelperez marked this pull request as ready for review July 16, 2026 10:54
@leosvelperez
leosvelperez requested a review from a team as a code owner July 16, 2026 10:54
@leosvelperez
leosvelperez requested a review from lourw July 16, 2026 10:54
@AgentEnder
AgentEnder merged commit eff4e9c into master Jul 16, 2026
18 checks passed
@AgentEnder
AgentEnder deleted the nxc-4682 branch July 16, 2026 13:32
FrozenPandaz pushed a commit that referenced this pull request Jul 20, 2026
… target (#36374)

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
(cherry picked from commit eff4e9c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants