Skip to content

Conversation

@lourw
Copy link
Contributor

@lourw lourw commented Dec 18, 2025

Current Behavior

We have a hard coded list of task targets to not exclude depends on.

Expected Behavior

We resolve a gradle task such that we can identify if there are provider dependency relationships involved. If there are, then do not exclude depends on since Gradle needs the dependsOn tasks to fulfill providers.

Related Issue(s)

Fixes #

@lourw lourw self-assigned this Dec 18, 2025
@vercel
Copy link

vercel bot commented Dec 18, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
nx-dev Ready Ready Preview Jan 8, 2026 5:49pm

@netlify
Copy link

netlify bot commented Dec 18, 2025

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit 192e188
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/695fece3f1ea5d00076bb69f
😎 Deploy Preview https://deploy-preview-33923--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.

@nx-cloud
Copy link
Contributor

nx-cloud bot commented Dec 18, 2025

View your CI Pipeline Execution ↗ for commit 192e188

Command Status Duration Result
nx affected --targets=lint,test,test-kt,build,e... ✅ Succeeded 9m 50s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 1m 44s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 11s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 2s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-01-08 17:59:01 UTC

nx-cloud[bot]

This comment was marked as outdated.

nx-cloud[bot]

This comment was marked as outdated.

@nrwl nrwl deleted a comment from graphite-app bot Jan 6, 2026
Copy link
Contributor

@nx-cloud nx-cloud bot left a comment

Choose a reason for hiding this comment

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

✅ The fix from Nx Cloud was applied

These changes fix the ktfmt formatting check failure in the gradle-project-graph:build task. The formatter corrected minor formatting issues including removing an extra blank line and adjusting comment line wrapping in TaskUtils.kt to comply with ktfmt standards.

We had verified this fix by re-running gradle-project-graph:build.

Suggested Fix changes
diff --git a/packages/gradle/project-graph/src/main/kotlin/dev/nx/gradle/utils/TaskUtils.kt b/packages/gradle/project-graph/src/main/kotlin/dev/nx/gradle/utils/TaskUtils.kt
index 0db9cb153f..d252303e6f 100644
--- a/packages/gradle/project-graph/src/main/kotlin/dev/nx/gradle/utils/TaskUtils.kt
+++ b/packages/gradle/project-graph/src/main/kotlin/dev/nx/gradle/utils/TaskUtils.kt
@@ -96,7 +96,6 @@ fun processTask(
     }
   }
 
-
   return target
 }
 
@@ -485,8 +484,8 @@ fun isCacheable(task: Task): Boolean {
  * resolution. Uses Gradle internal APIs to access raw dependency values and check for providers
  * with known producer tasks.
  *
- * These are the dependencies that will cause "Querying the mapped value of flatmap(...) before
- * task has completed" errors when the provider value is queried before the producing task completes.
+ * These are the dependencies that will cause "Querying the mapped value of flatmap(...) before task
+ * has completed" errors when the provider value is queried before the producing task completes.
  *
  * @param task the task to analyze
  * @param project the project containing the task (unused but kept for API compatibility)
diff --git a/packages/gradle/project-graph/src/test/kotlin/dev/nx/gradle/utils/ProcessTaskUtilsTest.kt b/packages/gradle/project-graph/src/test/kotlin/dev/nx/gradle/utils/ProcessTaskUtilsTest.kt
index 4825d074f1..3e36a9a2c6 100644
--- a/packages/gradle/project-graph/src/test/kotlin/dev/nx/gradle/utils/ProcessTaskUtilsTest.kt
+++ b/packages/gradle/project-graph/src/test/kotlin/dev/nx/gradle/utils/ProcessTaskUtilsTest.kt
@@ -547,9 +547,11 @@ class ProcessTaskUtilsTest {
 
     @Test
     fun `identifies ProviderInternal from task output files`() {
-      val producerProvider = project.tasks.register("producer") { task ->
-        task.outputs.file(java.io.File(project.layout.buildDirectory.asFile.get(), "output.jar"))
-      }
+      val producerProvider =
+          project.tasks.register("producer") { task ->
+            task.outputs.file(
+                java.io.File(project.layout.buildDirectory.asFile.get(), "output.jar"))
+          }
       val consumerProvider = project.tasks.register("consumer")
       consumerProvider.configure { it.dependsOn(producerProvider.map { p -> p.outputs.files }) }
 
@@ -560,9 +562,10 @@ class ProcessTaskUtilsTest {
 
     @Test
     fun `identifies ProviderInternal from task output directory`() {
-      val compileProvider = project.tasks.register("compile") { task ->
-        task.outputs.dir(java.io.File(project.layout.buildDirectory.asFile.get(), "classes"))
-      }
+      val compileProvider =
+          project.tasks.register("compile") { task ->
+            task.outputs.dir(java.io.File(project.layout.buildDirectory.asFile.get(), "classes"))
+          }
       val jarProvider = project.tasks.register("jar")
       jarProvider.configure { it.dependsOn(compileProvider.map { p -> p.outputs.files }) }
 

Revert fix via Nx Cloud  

View interactive diff ↗

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

@lourw lourw marked this pull request as ready for review January 7, 2026 18:25
Comment on lines 488 to 482
* has completed" errors when the provider value is queried before the producing task completes.
*
* @param task the task to analyze
* @param project the project containing the task (unused but kept for API compatibility)
* @return set of task paths that are provider-based dependencies with known producers
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

Documentation Bug: References non-existent parameter

The documentation mentions @param project the project containing the task (unused but kept for API compatibility) but the function signature findProviderBasedDependencies(task: Task): Set<String> has no project parameter. This will confuse developers and the comment is misleading.

Fix: Remove the incorrect parameter documentation or add the project parameter if it's actually needed.

Suggested change
* has completed" errors when the provider value is queried before the producing task completes.
*
* @param task the task to analyze
* @param project the project containing the task (unused but kept for API compatibility)
* @return set of task paths that are provider-based dependencies with known producers
*/
* has completed" errors when the provider value is queried before the producing task completes.
*
* @param task the task to analyze
* @return set of task paths that are provider-based dependencies with known producers
*/

Spotted by Graphite Agent

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

@lourw lourw enabled auto-merge (squash) January 8, 2026 17:44
@lourw lourw merged commit 4af6080 into master Jan 8, 2026
19 of 20 checks passed
@lourw lourw deleted the lourw/providers branch January 8, 2026 17:59
@github-actions
Copy link
Contributor

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants