[rush] Write last-install.flag after update-autoinstaller completes
Summary
Fixes #5464
rush update-autoinstaller performs installation but does not write the last-install.flag file, causing subsequent rush install-autoinstaller to redundantly reinstall.
Details
Added _createFlagsAsync() method to Autoinstaller.ts that writes both:
-
.rush/temp/last-install.flag- tracks install state (node version, package manager, package.json contents) -
node_modules/rush-autoinstaller.flag- marker file for node_modules validity
Called at the end of updateAsync() after successful installation, matching the behavior of prepareAsync().
How it was tested
- Built rush-lib and verified compilation
- Ran full test suite (528 tests pass)
Original prompt
This section details on the original issue you should resolve
<issue_title>[rush] Can update-autoinstallers write common/autoinstallers/rush-plugins/.rush/temp/last-install.flag?</issue_title> <issue_description>## Summary
After executing rush update-autoinstaller, the .rush/temp/last-install.flag file was not written, causing subsequent related commands to perform the installation again.
Repro steps
- Change any dependencies version in autoinstallers/*/package.json
- Run
rush update-autoinstaller --name xxx.- Run
rush install-autoinstaller --name xxx. Expect to skip installation.Standard questions
Please answer these questions to help us investigate your issue more quickly:
Question Answer @microsoft/rushglobally installed version?5.155.1 rushVersionfrom rush.json?5.155.1 useWorkspacesfrom rush.json?Yes Operating system? Mac Would you consider contributing a PR? Yes Node.js version ( node -v)?22.20.0 </issue_description> <agent_instructions>Running
rush update-autoinstallerperforms installation, so the last-install flag should be written when it completes, same as if the autoinstaller is automatically installed, or if the user runsrush install-autoinstaller.</agent_instructions>Comments on the Issue (you are @copilot in this section)
@iclanton Looks like a simple oversight. @LPegasus, that seems like the right place.
- Fixes microsoft/rushstack#5464
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
@copilot the description mentions the wrong issue. It should mention https://github.com/microsoft/rushstack/issues/5464
@copilot the description mentions the wrong issue. It should mention https://github.com/microsoft/rushstack/issues/5464
Updated the PR description to reference issue #5464.