-
Notifications
You must be signed in to change notification settings - Fork 610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[rush] Revise command line selection operations #2422
Conversation
e2a8f9d
to
885ec36
Compare
@dmichon-msft #1234 doesn't seem like the right reference. |
Fixed reference to 2354 |
Thanks a ton for making this PR! I really need this feature. :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the PR discussion, this PR is making a nontrivial design change that conflicts with #2349
We need to sort that out before merging.
Thanks for the work done here! Running into these issues myself now with --from flag. Any chance this could be done for the install command as well? |
@octogonz , give this another look with the reverted behavior and new version of the internals? |
With regards to my comment in #2345
Would it be drastic to let --from be "--with-dependencies", and have a flag that says "--without-dependencies"? I want to merge this really badly, so it pains me to bring this up, but a good design is important too. 😄 |
Yes, I was actually thinking the same thing. Do the safe internally consistent thing by default, and then the extra CLI parameter would be for people know what they are doing. We could even argue that it's not exactly a breaking design change, to broaden the set of projects. (PR #2349 had assumed that was the intended behavior, for example.) We can think a little more about whether |
0f41cb5
to
3e13b57
Compare
@wbern , with latest iteration, Adding a @octogonz , latest iteration should now resolve the behavior conflict. |
Fixes #1447 |
All of the generating functions feel more complicated than necessary. |
8343173
to
0652a86
Compare
Here's an initial draft of the docs for @dmichon-msft's feature. |
@octogonz , is there supposed to be a link here? |
@dmichon-msft looks like I forgot to paste it: :-) |
Looks really good! |
@octogonz , I believe I have addressed all of your comments at this point. |
Released with Rush 5.38.0 |
Summary
Adds support for
--from-except
and--to-except
to invoke a command onall dependents on a specific project, orall dependencies of a specified project.Adds support for
--only PROJECT
to invoke a command onPROJECT
without adding its dependents or dependencies to the selection.Adds support for
--affected-by PROJECT
and--affected-by-except PROJECT
to provide the functionality formerly provided by--from
(i.e. execute the command on PROJECT and all dependents thereof, without reprocessing the dependencies).Updates the interaction between--from
and--to
inTaskSelector
to intersect the results of the former with the latter.This ensures that
rush build --from A --to B
builds all projects that depend onA
(includingA
) and are dependencies ofB
(includingB
). This is intended to support watch scenarios where some files have changed inA
and the developer is interested in the effects onB
.Adds new properties to
RushConfigurationProject
that contain the dependencies and dependents asReadonlySet<RushConfigurationProject>
for ease of graph analysis.Factors out directed graph manipulation functions for compositing. Adds unit tests for the same.
Switches to using generators for collection manipulation where appropriate.
Adds--with-dependencies
flag to include all dependencies of the selected projects.Fixes #2354
Alters behavior of
--from
to include all dependencies per #2349Details
Name of parameters subject to revision, pending discussion in #2354.
Optimized the calculation of the dependency graph to use a loop instead of recursion.
Moves responsibility for evaluating
--from
,--to
, etc. out of TaskSelector and into the calling command, with the aid of selection helper functions. This change is to allow--watch
to specify exactly the set of projects it wishes to execute.How it was tested
Invoked a variety of
rush build
scenarios with a combination of--from
,--to
,--to-except
,--affected-by
,--affected-by-except
,--only
on the@rushstack
repo.Selection helpers have unit test coverage.
Edit: fixed issue reference
Edit 2: reverted behavioral changes to
--to
and--from
Edit 3: added
--with-dependencies
flagEdit 4: removed
--with-dependencies
flag and made it the default behavior of--from
. Removed--from-except
since including dependencies makes the option nonsense.