[rush] Fix bug including unnecessary operations #5141
Merged
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
Fixes an issue where
--include-phase-deps
and watch mode rebuilds were both scheduling more operations than necessary.Details
The new calculation for what is in scope is:
All
be the set of operations necessary to form a complete graph that contains the originally requested phases and originally selected projects, including their dependencies.ToExecute
be the set of operations that are in a project with changes and are one of the originally requested phases.ToExecute
all operations inAll
that depend on any operation inToExecute
--include-phase-deps
is true and it is not a watch-mode rebuild, additionally include inToExecute
all operations that are dependencies of the operations inToExecute
.enabled
state of all operations inAll
based on their membership inToExecute
, with an additional filter for the explicit selection (if--include-phase-deps
is not set), to facilitate unsafe selections.How it was tested
rush test --include-phase-deps -o rush-lib -o rush
ran_phase:build
in all dependencies, but only invoked_phase:test
forrush-lib
andrush
.rush start --to heft-webpack5-everything-test
, then manually alteringwebpack5-module-minifier-plugin
ran_phase:build
and_phase:test
inwebpack5-module-minifier-plugin
andheft-webpack5-everything-test
, but no other operations.Impacted documentation
Makes the command do what it says it does, so none.