Skip to content

[rush] Fix bug including unnecessary operations #5141

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

Merged
merged 2 commits into from
Mar 1, 2025

Conversation

dmichon-msft
Copy link
Contributor

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:

  1. Let 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.
  2. Let ToExecute be the set of operations that are in a project with changes and are one of the originally requested phases.
  3. Additionally include in ToExecute all operations in All that depend on any operation in ToExecute
  4. If --include-phase-deps is true and it is not a watch-mode rebuild, additionally include in ToExecute all operations that are dependencies of the operations in ToExecute.
  5. Configure the enabled state of all operations in All based on their membership in ToExecute, 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 for rush-lib and rush.
rush start --to heft-webpack5-everything-test, then manually altering webpack5-module-minifier-plugin ran _phase:build and _phase:test in webpack5-module-minifier-plugin and heft-webpack5-everything-test, but no other operations.
 

Impacted documentation

Makes the command do what it says it does, so none.

@octogonz
Copy link
Collaborator

@L-Qun FYI

Co-authored-by: Pete Gonzalez <[email protected]>
@dmichon-msft dmichon-msft enabled auto-merge (squash) March 1, 2025 00:13
@dmichon-msft dmichon-msft merged commit 33db957 into microsoft:main Mar 1, 2025
5 checks passed
@github-project-automation github-project-automation bot moved this from Needs triage to Closed in Bug Triage Mar 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

2 participants