[rush] Write last-install.flag after update-autoinstaller completes#5484
Draft
[rush] Write last-install.flag after update-autoinstaller completes#5484
Conversation
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
Member
Contributor
Author
dmichon-msft
requested changes
Jan 2, 2026
Contributor
dmichon-msft
left a comment
There was a problem hiding this comment.
@copilot , please fix the duplicate read.
Comment on lines
284
to
285
| const packageJsonPath: string = path.join(autoinstallerFullPath, 'package.json'); | ||
| const packageJson: IPackageJson = JsonFile.load(packageJsonPath); |
Contributor
There was a problem hiding this comment.
Get the package.json contents from the existing PackageJsonEditor rather than re-reading the file.
Contributor
Author
There was a problem hiding this comment.
Fixed in c486388. Now using packageJsonEditor.saveToObject() instead of re-reading the file.
Comment on lines
+295
to
+305
| // Create file: ../common/autoinstallers/my-task/.rush/temp/last-install.flag | ||
| await lastInstallFlag.createAsync(); | ||
|
|
||
| // Example: ../common/autoinstallers/my-task/node_modules | ||
| const nodeModulesFolder: string = `${autoinstallerFullPath}/${RushConstants.nodeModulesFolderName}`; | ||
| const flagPath: string = `${nodeModulesFolder}/rush-autoinstaller.flag`; | ||
|
|
||
| FileSystem.writeFile( | ||
| flagPath, | ||
| 'If this file is deleted, Rush will assume that the node_modules folder has been cleaned and will reinstall it.' | ||
| ); |
Contributor
Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
rush update-autoinstallerdoes not writelast-install.flagfile, causing redundant reinstallation when runningrush install-autoinstallerafterwardsupdateAsync()method inAutoinstaller.tsdoesn't create thelast-install.flagfile, whileprepareAsync()does_createFlagsAsync()method and call it after installation inupdateAsync()methodFixes #5464
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.