rushstack
rushstack copied to clipboard
[rush] additionalProjectsToInclude not working anymore at rush deploy
Summary
As per:
https://rushjs.io/pages/configs/deploy_json/
the additionalProjectsToInclude property can be used to include additional projects in the deployment, even if they're not strict dependencies of the projects to be deployed as specified via --project parameter. However, this doesn't seem to work with the recent versions of rush and an attempt to run:
run deploy --project=projectA --scenario=deploy.json
results in an error:
ERROR: Project projectB was not found in the list of projects.
Repro steps
- Create
rush.jsonwith at least two projects:projectAandprojectB, none of which depends on each other. - Define a scenario in
deploy.jsonand specifyadditionalProjectsToIncludeforprojectAto includeprojectB. - Run
rush deploy --project=projectA --scenario=deploy.json. - The script will complain that
projectBwas not found in the list of projects.
Details
I am able to confirm that this functionality is still working in 5.120.5 and it is broken in 5.120.6 where I am getting:
Error: Project projectB was not found in the list of projects.
at PackageExtractor._performExtractionAsync (/Users/apendua/Library/Application Support/fnm/node-versions/v18.18.2/installation/lib/node_modules/@microsoft/rush/node_modules/@rushstack/package-extractor/lib/PackageExtractor.js:175:31)
at PackageExtractor.extractAsync (/Users/apendua/Library/Application Support/fnm/node-versions/v18.18.2/installation/lib/node_modules/@microsoft/rush/node_modules/@rushstack/package-extractor/lib/PackageExtractor.js:132:20)
at async DeployAction.runAsync (/Users/apendua/Library/Application Support/fnm/node-versions/v18.18.2/installation/lib/node_modules/@microsoft/rush/node_modules/@microsoft/rush-lib/dist/commons.js:8292:9)
at async RushCommandLineParser.onExecute (/Users/apendua/Library/Application Support/fnm/node-versions/v18.18.2/installation/lib/node_modules/@microsoft/rush/node_modules/@rushstack/ts-command-line/lib/providers/CommandLineParser.js:254:13)
at async RushCommandLineParser._wrapOnExecuteAsync (/Users/apendua/Library/Application Support/fnm/node-versions/v18.18.2/installation/lib/node_modules/@microsoft/rush/node_modules/@microsoft/rush-lib/dist/commons.js:5940:9)
at async RushCommandLineParser.onExecute (/Users/apendua/Library/Application Support/fnm/node-versions/v18.18.2/installation/lib/node_modules/@microsoft/rush/node_modules/@microsoft/rush-lib/dist/commons.js:5920:13)
at async RushCommandLineParser.executeWithoutErrorHandling (/Users/apendua/Library/Application Support/fnm/node-versions/v18.18.2/installation/lib/node_modules/@microsoft/rush/node_modules/@rushstack/ts-command-line/lib/providers/CommandLineParser.js:205:13)
at async RushCommandLineParser.execute (/Users/apendua/Library/Application Support/fnm/node-versions/v18.18.2/installation/lib/node_modules/@microsoft/rush/node_modules/@rushstack/ts-command-line/lib/providers/CommandLineParser.js:98:13)
at async RushCommandLineParser.execute (/Users/apendua/Library/Application Support/fnm/node-versions/v18.18.2/installation/lib/node_modules/@microsoft/rush/node_modules/@microsoft/rush-lib/dist/commons.js:5906:16)
Looking at the error stack it seems like the offending commit was:
https://github.com/microsoft/rushstack/commit/a9758226c4e6bb34de31e643a1794288d726d9ab
The process of evaluating projectConfigurations was changed to:
const projects = this._getDependencyProjects(rushConfigurationProject);
not taking into account that some entries may be required via additionalProjectsToInclude. Previously it worked fine because apparently subspace.getProjects() included all necessary projects.
Standard questions
Please answer these questions to help us investigate your issue more quickly:
| Question | Answer |
|---|---|
@microsoft/rush globally installed version? |
5.123.1 |
rushVersion from rush.json? |
5.120.6 |
useWorkspaces from rush.json? |
true |
| Operating system? | Mac |
| Would you consider contributing a PR? | Yes |
Node.js version (node -v)? |
18.18.2 |
Thanks for reporting this! Looks like it is a regression from the subspaces fix https://github.com/microsoft/rushstack/pull/4655
@EscapeB @william2958 FYI
Taking a look
@EscapeB @william2958 FYI
Got it, I think we have found the root cause and are trying to fix that. Didn't realize that there is a field that can add extra entries to package extractor before. In order to support that case, we have to pass all projects and subspaces to PackageExtractor.
@EscapeB has provided a fix in PR https://github.com/microsoft/rushstack/pull/4693
@william2958
🚀 fixed in Rush 5.124.2
@EscapeB @william2958 Thank you guys for responding so promptly! I really appreciate this as it was blocking my team from upgrading to the latest version of rush.