Monitor Git branch changes to keep trust sharing consistent; - #17
Merged
Merged
Conversation
…ore path override for tests Refactored BuildBlockDialogViewModel to allow an optional user trust store path override and updated related tests for isolation. Enhanced SolutionMonitorService to watch for Git HEAD changes, handling submodules and worktrees, and re-apply trust sharing preferences on HEAD updates. Git watcher is now started and stopped with solution lifecycle events. Note: only for the Visual Studio extension.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Visual Studio extension to keep “trust sharing” behavior consistent across Git branch switches by (1) allowing the build-block dialog view model to use an optional user trust store path override (improving test isolation) and (2) adding a Git HEAD file watcher that re-applies trust-sharing preferences when HEAD changes.
Changes:
- Added an optional
userTrustPathoverride toBuildBlockDialogViewModelto control which user trust store is used. - Updated
BuildBlockDialogViewModelunit tests to use a temp, per-test trust store file instead of the host’s default user trust store. - Enhanced
SolutionMonitorServiceto start/stop a GitHEADwatcher with the solution lifecycle and re-apply trust-sharing preferences onHEADupdates (including worktrees/submodules via.gitresolution).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| MSBuildGuard.VisualStudio/ToolWindows/BuildBlockDialogViewModel.cs | Adds a constructor overload to allow overriding the user trust store path used for merged trust evaluation. |
| MSBuildGuard.VisualStudio/Services/SolutionMonitorService.cs | Introduces a FileSystemWatcher on Git HEAD and ties it to solution open/close lifecycle events. |
| MSBuildGuard.VisualStudio.Tests/ToolWindows/BuildBlockDialogViewModelTests.cs | Refactors tests to use an isolated trust store path and validate trust impact on risk score. |
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.
Refactored
BuildBlockDialogViewModelto allow an optional user trust store path override and updated related tests for isolation. EnhancedSolutionMonitorServiceto watch for Git HEAD changes, handling submodules and worktrees, and re-apply trust sharing preferences on HEAD updates. Git watcher is now started and stopped with solution lifecycle events.Note: only for the Visual Studio extension.