Skip to content

Restore repo-tracked files after copying test binaries - #14632

Merged
sean-mcmanus merged 2 commits into
mainfrom
seanmcm/devbox2-wsl/agent9/fix-copy-binaries-tracked-files
Aug 3, 2026
Merged

Restore repo-tracked files after copying test binaries#14632
sean-mcmanus merged 2 commits into
mainfrom
seanmcm/devbox2-wsl/agent9/fix-copy-binaries-tracked-files

Conversation

@sean-mcmanus

Copy link
Copy Markdown
Contributor

Summary

yarn install-and-copy-binaries-for-test (and yarn copy-extension-binaries) copies the installed extension's bin, debugAdapters, and LLVM folders into the repo so tests can run against real binaries. A few files under bin are checked into the repo — bin/cpp.hint and bin/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 untracked bin/binaryVersion.json) that had to be reverted by hand after every run.

This change makes copyExtensionBinaries.ts restore any repo-tracked files that the copy modified (via git ls-files --modified + git checkout), so only the untracked binaries remain, and gitignores the generated bin/binaryVersion.json marker. The result is a clean git status after running the script.

This PR was created by Copilot with Claude Opus 4.8 (in VS Code). Any PR comments starting with Copilot says: are generated by Copilot.

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.ts to restore repo-tracked files overwritten by the copy.
  • Add bin/binaryVersion.json to Extension/.gitignore to 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.

Comment thread Extension/.scripts/copyExtensionBinaries.ts
@sean-mcmanus
sean-mcmanus merged commit cd22e17 into main Aug 3, 2026
6 checks passed
@sean-mcmanus
sean-mcmanus deleted the seanmcm/devbox2-wsl/agent9/fix-copy-binaries-tracked-files branch August 3, 2026 18:05
@github-project-automation github-project-automation Bot moved this from Pull Request to Done in cpptools Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants