Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This is a large PR that refactors the dotnet-watch Aspire integration to support macOS (and other non-Windows platforms), introduces a new three-process architecture for Aspire watch (host, server, resource), and modernizes the test infrastructure. Previously, several Aspire-related tests were restricted to Windows via PlatformSpecificFact. The PR also introduces status reporting and control command pipes for communication between the Aspire host and watch server.
Changes:
- Refactors Aspire watch into a three-process model (host, server, resource launchers) communicating via named pipes, replacing the old
DotNetWatchLauncher/DotNetWatchOptionswith command-based CLI (server,resource,hostsubcommands) and adds status/control pipe support. - Overhauls
EnvironmentOptionsto derive the muxer path fromSdkDirectoryinstead of accepting it directly, adds a configurableLogMessagePrefix, introduces notification-onlyMessageDescriptors (LogLevel.None), and updatesProjectRepresentationto arecord structwith OS-aware path equality. - Modernizes test infrastructure by replacing
IDisposablewithIAsyncDisposable, moving fromBufferBlocktoChannel<T>inAwaitableProcess, extractingTestEventObserverfromTestReporter, splitting large test classes into focused files, and removing Windows-only test restrictions.
Reviewed changes
Copilot reviewed 93 out of 94 changed files in this pull request and generated 15 comments.
Show a summary per file
| File | Description |
|---|---|
src/Dotnet.Watch/Watch/Context/EnvironmentOptions.cs |
Replace MuxerPath with SdkDirectory; derive muxer path from SDK dir |
src/Dotnet.Watch/Watch/Context/EnvironmentVariables.cs |
Add ReadTimeSpanSeconds helper |
src/Dotnet.Watch/Watch/Build/ProjectRepresentation.cs |
Convert to record struct with OS-aware equality on ProjectGraphPath |
src/Dotnet.Watch/Watch/UI/IReporter.cs |
Add notification-only MessageDescriptors, configurable log prefix |
src/Dotnet.Watch/Watch/UI/ConsoleReporter.cs |
Accept logMessagePrefix parameter |
src/Dotnet.Watch/dotnet-watch/Program.cs |
Use new EnvironmentOptions API; accept ILoggerFactory |
src/Dotnet.Watch/Watch/HotReload/HotReloadDotNetWatcher.cs |
Refactor build to emit notifications; centralize restart logic |
src/Dotnet.Watch/Watch/HotReload/CompilationHandler.cs |
OS-aware path comparers; new RestartPeripheralProjectsAsync |
src/Dotnet.Watch/Watch/Process/RunningProject.cs |
Change RestartOperation to ValueTask; add RestartAsync |
src/Dotnet.Watch/Watch/Process/ProjectLauncher.cs |
Expose CompilationHandler; use GetMuxerPath() |
src/Dotnet.Watch/Watch/Aspire/AspireServiceFactory.cs |
Return ValueTask from StartProjectAsync |
src/Dotnet.Watch/Watch.Aspire/AspireLauncher.cs |
New base class for Aspire launchers with CLI parsing |
src/Dotnet.Watch/Watch.Aspire/Server/AspireServerLauncher.cs |
New server launcher with status/control pipes |
src/Dotnet.Watch/Watch.Aspire/Server/ProcessLauncherFactory.cs |
Named pipe listener accepting resource launch requests |
src/Dotnet.Watch/Watch.Aspire/Server/WatchStatusWriter.cs |
Writes status events to named pipe |
src/Dotnet.Watch/Watch.Aspire/Server/WatchControlReader.cs |
Reads control commands (e.g., rebuild) from pipe |
src/Dotnet.Watch/Watch.Aspire/Server/StatusReportingLoggerFactory.cs |
Intercepts log events for status reporting |
src/Dotnet.Watch/Watch.Aspire/Resource/AspireResourceLauncher.cs |
Resource process connecting to server pipe |
src/Dotnet.Watch/Watch.Aspire/Host/AspireHostLauncher.cs |
Host launcher for single-project watch |
src/Dotnet.Watch/Watch.Aspire/Commands/*.cs |
CLI command definitions for server, resource, host |
src/Dotnet.Watch/Watch.Aspire/Program.cs |
Rewritten entry point dispatching to launcher |
test/.../AwaitableProcess.cs |
Replace BufferBlock with Channel<T>; async dispose |
test/.../WatchableApp.cs |
Generic launcher; async dispose; configurable executable |
test/.../DotNetWatchTestBase.cs |
IAsyncLifetime; CreateInProcWatcher factory |
test/.../TestEventObserver.cs |
Extracted event observation from TestReporter |
| Various test files | Split tests into focused files; remove Windows-only restrictions |
test/.../AspireLauncherTests.cs |
New integration test for server/resource communication |
test/.../Aspire*CliTests.cs |
CLI parsing tests for all three subcommands |
src/Dotnet.Watch/.editorconfig |
Suppress diagnostics for Watch solution |
src/Dotnet.Watch/Watch.Aspire/Utilities/AspireEnvironmentVariables.cs
Outdated
Show resolved
Hide resolved
test/Microsoft.DotNet.HotReload.Watch.Aspire.Tests/AspireLauncherTests.cs
Outdated
Show resolved
Hide resolved
This was referenced Mar 5, 2026
Open
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.
No description provided.