[rush] Add an option to not pass phase-control flag parameters on to project commands. #3124
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Currently the design for flag parameters that manipulate which phases are executed conflicts with the design for caching. Using a flag to omit a phase from execution suggests that the phase may not be necessary to get a developer who has just pulled changes into their local clone ready to start work (a
_phase:test
phase excluded by a--lite
flag for example). However, if the flag is also passed on to the_phase:build
phase, it ends up being part of the_phase:build
's cache entry's hash, meaning that_phase:build
won't be able to be restored from cache unless the cache was populated by arush build --lite
run.I expect that a repo with phased commands and a remote cache will commonly run
rush build
in CI and then expect developers to runrush build --lite
to get going in the morning on their local machines.rush build --lite
should pull the output of the_phase:build
phase from the cache that was populated by the CI run. This doesn't work if_phase:build
's cache entry IDs include the--lite
flag.Details
To address this issue, I propose adding a
"doNotIncludeInProjectCommandLine"
property to"flag"
parameters incommon/config/rush/command-line.json
that prevents the parameter from being passed on to projects' individual script executions. This property is only allowed for flags that control which phases are executed.How it was tested
TBD.