Restore repo-tracked files after copying test binaries - #14632
Open
sean-mcmanus wants to merge 1 commit into
Open
Restore repo-tracked files after copying test binaries#14632sean-mcmanus wants to merge 1 commit into
sean-mcmanus wants to merge 1 commit into
Conversation
The install/copy-binaries script rm -rf's and re-copies the installed extension's bin, debugAdapters, and LLVM folders. A few files under bin are checked into the repo (bin/cpp.hint and bin/messages/**/messages.json); the copy overwrote them with the installed extension's versions (differing line endings and/or content), leaving spurious local modifications that had to be reverted by hand. Restore any tracked files the copy changed so only the untracked binaries remain, and gitignore the generated bin/binaryVersion.json marker.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Extension’s binary-copy test workflow to avoid leaving the working tree in a modified state after copying installed binaries into the repo, by restoring repo-tracked files that were overwritten during the copy and ignoring a generated marker file.
Changes:
- Add a post-copy step in
copyExtensionBinaries.tsto restore repo-tracked files overwritten by the copy. - Add
bin/binaryVersion.jsontoExtension/.gitignoreto prevent untracked marker noise.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
Extension/.scripts/copyExtensionBinaries.ts |
Restores tracked files modified by the copy step so tests can use real binaries without leaving spurious git changes. |
Extension/.gitignore |
Ignores bin/binaryVersion.json generated by the copy workflow to keep git status clean. |
Suppressed comments (1)
Extension/.scripts/copyExtensionBinaries.ts:173
restoreTrackedFiles()is invoked after the copy, but without capturing what was already modified beforehand. That means any pre-existing unstaged edits to tracked files under these folders will be reverted by the restore step.
Capture the modified-tracked-file set before copying and pass it to restoreTrackedFiles so it only restores files newly modified by the copy.
note(`Copied installed binaries into ${$root}`);
await restoreTrackedFiles();
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
yarn install-and-copy-binaries-for-test(andyarn copy-extension-binaries) copies the installed extension'sbin,debugAdapters, andLLVMfolders into the repo so tests can run against real binaries. A few files underbinare checked into the repo —bin/cpp.hintandbin/messages/**/messages.json— and the copy overwrote them with the installed (pre-release) extension's versions, which differ in line endings (CRLF vs LF) and/or content. That left spurious local modifications (plus an untrackedbin/binaryVersion.json) that had to be reverted by hand after every run.This change makes
copyExtensionBinaries.tsrestore any repo-tracked files that the copy modified (viagit ls-files --modified+git checkout), so only the untracked binaries remain, and gitignores the generatedbin/binaryVersion.jsonmarker. The result is a cleangit statusafter running the script.