Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 3, 2025

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/rush globally installed version? 5.155.1
rushVersion from rush.json? 5.155.1
useWorkspaces from 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-autoinstaller performs installation, so the last-install flag should be written when it completes, same as if the autoinstaller is automatically installed, or if the user runs rush 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.

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: iclanton <5010588+iclanton@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix last-install.flag not being written during update-autoinstallers [rush] Write last-install.flag after update-autoinstaller completes Dec 3, 2025
Copilot AI requested a review from iclanton December 3, 2025 19:26
@iclanton
Copy link
Member

iclanton commented Dec 3, 2025

@copilot the description mentions the wrong issue. It should mention #5464

Copy link
Contributor Author

Copilot AI commented Dec 3, 2025

@copilot the description mentions the wrong issue. It should mention #5464

Updated the PR description to reference issue #5464.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs triage

Development

Successfully merging this pull request may close these issues.

[rush] Can update-autoinstallers write common/autoinstallers/rush-plugins/.rush/temp/last-install.flag?

2 participants