Skip to content

[rush] Feature Request - Allow project-level ignoring of custom command-line parameters #5432

@dmichon-msft

Description

@dmichon-msft

Summary

Currently support for custom parameters in command-line.json is all-or-nothing with respect to which projects they get forwarded to. Which phases they get forwarded to is configurable, however.

Since the exact CLI is used as part of the cache key for the build cache (and propagates into downstream operations since they include the cache keys of their dependencies), this means that if you have a CLI parameter (e.g. --production) that has no effect on a given project, adding or removing the parameter will cause a cache break without providing any value.

We should allow projects to mark (via rush-project.json) that for a given operation, certain custom command-line parameters should be discarded when deriving the CLI.

Details

Add a new field parameterNamesToIgnore (name negotiable) in the operationSettings sub-objects in rush-project.json that is an array of the parameterLongName values defined in command-line.json.

When expanding the command line arguments to be passed to ShellOperationRunner, any custom parameters that match the parameterNamesToIgnore entry for the operation should be discarded. We emit a verbose log line alongside the "Invoking ..." log that remarks on any parameters that were ignored.

Standard questions

Please answer these questions to help us investigate your issue more quickly:

Question Answer
@microsoft/rush globally installed version? 5.162.0
rushVersion from rush.json? 5.162.0
useWorkspaces from rush.json? Yes
Operating system? Linux
Would you consider contributing a PR? Yes
Node.js version (node -v)? 22.16.0

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions