Skip to content

fix(gradle): enforce that only one gradle task can be passed into gradle executor#34269

Merged
FrozenPandaz merged 1 commit intomasterfrom
feature/nxc-3804-task-getting-interpreted-by-batch-runner-as-a-project
Feb 2, 2026
Merged

fix(gradle): enforce that only one gradle task can be passed into gradle executor#34269
FrozenPandaz merged 1 commit intomasterfrom
feature/nxc-3804-task-getting-interpreted-by-batch-runner-as-a-project

Conversation

@lourw
Copy link
Copy Markdown
Contributor

@lourw lourw commented Jan 30, 2026

Current Behavior

The Gradle executor accepts a taskName option that should not contain multiple space-separated tasks. When multiple tasks are provided, the batch runner misinterprets the space-separated string as containing project names rather than treating it as a single task argument, leading to execution errors and confusion.

This only occurs if the taskName is manually overridden and should not occur when task names are generated by the project graph plugin.

Expected Behavior

The Gradle executor now validates that taskName contains only a single task without spaces. If multiple tasks are passed, it throws a clear error message: "Task '[taskName]' contains spaces. Only a single Gradle task is allowed per executor invocation." This prevents the batch runner from misinterpreting the task name and provides immediate feedback to users about the correct usage.

Related Issue(s)

Fixes #

@lourw lourw self-assigned this Jan 30, 2026
@vercel
Copy link
Copy Markdown

vercel Bot commented Jan 30, 2026

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

Project Deployment Actions Updated (UTC)
nx-dev Ready Ready Preview Jan 30, 2026 8:32pm

Request Review

@netlify
Copy link
Copy Markdown

netlify Bot commented Jan 30, 2026

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit b1988f3
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/697d13a0865b4a0008f10864
😎 Deploy Preview https://deploy-preview-34269--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
Copy Markdown
Contributor

nx-cloud Bot commented Jan 30, 2026

View your CI Pipeline Execution ↗ for commit b1988f3

Command Status Duration Result
nx affected --targets=lint,test,test-kt,build,e... ✅ Succeeded 14m 29s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 2m 42s 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-30 20:44:24 UTC

@FrozenPandaz FrozenPandaz merged commit 94319c7 into master Feb 2, 2026
20 checks passed
@FrozenPandaz FrozenPandaz deleted the feature/nxc-3804-task-getting-interpreted-by-batch-runner-as-a-project branch February 2, 2026 15:14
FrozenPandaz pushed a commit that referenced this pull request Feb 3, 2026
…dle executor (#34269)

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

The Gradle executor accepts a taskName option that *should not* contain
multiple space-separated tasks. When multiple tasks are provided, the
batch runner misinterprets the space-separated string as containing
project names rather than treating it as a single task argument, leading
to execution errors and confusion.

This only occurs if the taskName is manually overridden and should not
occur when task names are generated by the project graph plugin.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The Gradle executor now validates that taskName contains only a single
task without spaces. If multiple tasks are passed, it throws a clear
error message: "Task '[taskName]' contains spaces. Only a single Gradle
task is allowed per executor invocation." This prevents the batch runner
from misinterpreting the task name and provides immediate feedback to
users about the correct usage.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

(cherry picked from commit 94319c7)
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 8, 2026

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 Feb 8, 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.

2 participants