Skip to content

nx.json should support parallel as a percentage to be consistent with cli arg #31694

Open
@Tungsten78

Description

@Tungsten78

Current Behavior

The docs for nx.json constrain parallel as a number.

This is inconsistent with Run Tasks in Parallel which additionally supports a percentage.

Expected Behavior

For consistency and flexibility, support both number and percentage.

The percentage is desirable in order to handle various host environments - our dev systems have way more cores than our hosted azure agents (2 cores).

GitHub Repo

No response

Steps to Reproduce

  1. In nx.json, set "parallel": "50%"
  2. nx run-many -t build

Expected:

  • see parallel task count equal to half the available cores

Actual:

  • failure with error
    -| NX The "setMaxListeners" argument must be of type number. Received type string ('50%10')

Nx Report

Node           : 22.16.0
OS             : win32-x64
Native Target  : x86_64-windows
npm            : 10.5.0

nx (global)            : 20.0.6
nx                     : 20.8.2
@nx/js                 : 20.8.2
@nx/jest               : 20.8.2
@nx/eslint             : 20.8.2
@nx/workspace          : 20.8.2
@nx/angular            : 20.8.2
@nx/cypress            : 20.8.2
@nx/devkit             : 20.8.2
@nx/eslint-plugin      : 20.8.2
@nx/module-federation  : 20.8.2
@nx/plugin             : 20.8.2
@nx/rspack             : 20.8.2
@nx/web                : 20.8.2
@nx/webpack            : 20.8.2
typescript             : 5.7.3
---------------------------------------

Failure Logs

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions