Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge branch 'release/9.0.2xx' => 'main' #45614

Merged
merged 24 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
d2a4a8f
Fix failing tests using "UseUwp"
Sergio0694 Nov 14, 2024
436d2aa
Workaround for issue 40015: nuget restore uses 'resource' instead of …
YehezkelShB Nov 3, 2024
0bf8fbd
Bump MSTest templates to 3.6.4
Evangelink Dec 3, 2024
adcb4b4
Merge branch 'release/9.0.2xx' into mstest
Evangelink Dec 6, 2024
71538aa
Update dependencies from https://github.com/nuget/nuget.client build …
dotnet-maestro[bot] Dec 18, 2024
c28152f
use the scouting image to unblock the nuget flow.
marcpopMSFT Dec 19, 2024
9d8b465
[release/9.0.2xx] Workaround for issue 40015: nuget restore uses 'res…
marcpopMSFT Dec 19, 2024
e885ce7
Cherry-pick 44859 into release/9.0.2xx: Fix failing tests because of…
marcpopMSFT Dec 19, 2024
83d20b5
[release/9.0.2xx] Update dependencies from nuget/nuget.client (#45526)
dsplaisted Dec 19, 2024
d3b1684
Update dependencies from https://github.com/dotnet/razor build 202412…
dotnet-maestro[bot] Dec 20, 2024
1ab03a5
Update dependencies from https://github.com/dotnet/razor build 202412…
dotnet-maestro[bot] Dec 20, 2024
a0137c6
Merge branch 'release/9.0.2xx' into mstest
Evangelink Dec 20, 2024
88c3c7b
Bump MSTest templates to 3.6.4 (#45278)
Evangelink Dec 20, 2024
79f2919
[release/9.0.2xx] Update dependencies from dotnet/razor (#45574)
dsplaisted Dec 20, 2024
b810aa4
File watcher improvements (#45131)
tmat Dec 20, 2024
bfa1bbc
[dotnet-watch] Make pipe reads and writes fully async (#45495)
tmat Dec 20, 2024
2f99a87
Use project name in project path map to account for multi-targeting (…
tmat Dec 20, 2024
a952a0c
Merge branch 'main' of https://github.com/dotnet/sdk into merge/relea…
v-wuzhai Dec 23, 2024
8a6fea9
Merge branch 'main' of https://github.com/dotnet/sdk into dev/Jason/9…
v-wuzhai Dec 24, 2024
f12add7
Merge branch 'main' into dev/Jason/9.0.2xx-to-main
ViktorHofer Dec 27, 2024
c7d5802
Merge branch 'main' into dev/Jason/9.0.2xx-to-main
ViktorHofer Jan 2, 2025
afb8b88
Skip timing out test to unblock
jkoritzinsky Jan 6, 2025
e058dd7
Revert "Make dotnet-watch tests TFM agnostic (#44604)"
tmat Jan 6, 2025
91f9c5e
[dotnet-watch] Misc test fixes (#45575)
tmat Jan 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/BuiltInTools/DotNetDeltaApplier/StartupHook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public static void Initialize()
agent.Reporter.Report("Writing capabilities: " + agent.Capabilities, AgentMessageSeverity.Verbose);

var initPayload = new ClientInitializationPayload(agent.Capabilities);
initPayload.Write(pipeClient);
await initPayload.WriteAsync(pipeClient, CancellationToken.None);

while (pipeClient.IsConnected)
{
Expand All @@ -71,8 +71,8 @@ public static void Initialize()
var logEntries = agent.GetAndClearLogEntries(update.ResponseLoggingLevel);

// response:
pipeClient.WriteByte(UpdatePayload.ApplySuccessValue);
UpdatePayload.WriteLog(pipeClient, logEntries);
await pipeClient.WriteAsync((byte)UpdatePayload.ApplySuccessValue, CancellationToken.None);
await UpdatePayload.WriteLogAsync(pipeClient, logEntries, CancellationToken.None);
}
}
catch (Exception ex)
Expand Down
1 change: 1 addition & 0 deletions src/BuiltInTools/HotReloadAgent/AgentMessageSeverity.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace Microsoft.DotNet.HotReload;

internal enum AgentMessageSeverity : byte
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<!-- This source package is used by Visual Studio WebTools -->
<TargetFramework>$(VisualStudioServiceTargetFramework)</TargetFramework>
<!--
Intentionally pinned. This feature is supported in projects targeting 6.0 or newer.
At the same time source build requires us to not target 6.0, so we fall back to netstandard.
-->
<TargetFramework>netstandard2.1</TargetFramework>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<DebugType>none</DebugType>
<GenerateDependencyFile>false</GenerateDependencyFile>
Expand All @@ -19,9 +22,6 @@
<!-- Remove once https://github.com/NuGet/Home/issues/8583 is fixed -->
<NoWarn>$(NoWarn);NU5128</NoWarn>
</PropertyGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

<!-- Make sure the shared source files do not require any global usings -->
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/BuiltInTools/dotnet-watch/Browser/BrowserConnector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public bool TryGetRefreshServer(ProjectGraphNode projectNode, [NotNullWhen(true)
{
lock (_serversGuard)
{
return _servers.TryGetValue(projectNode, out server);
return _servers.TryGetValue(projectNode, out server) && server != null;
}
}

Expand Down
5 changes: 1 addition & 4 deletions src/BuiltInTools/dotnet-watch/FileItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,12 @@ internal readonly record struct FileItem

/// <summary>
/// List of all projects that contain this file (does not contain duplicates).
/// Empty if <see cref="Change"/> is <see cref="ChangeKind.Add"/> and the
/// item has not been assigned to a project yet.
/// Empty if the item is added but not been assigned to a project yet.
/// </summary>
public required List<string> ContainingProjectPaths { get; init; }

public string? StaticWebAssetPath { get; init; }

public ChangeKind Change { get; init; }

public bool IsStaticFile => StaticWebAssetPath != null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,10 @@ await browserRefreshServer.SendAndReceiveAsync(
anyFailure = true;
}

ReportLog(reporter, data.Log.Select(entry => (entry.Message, (AgentMessageSeverity)entry.Severity)));
foreach (var entry in data.Log)
{
ReportLogEntry(reporter, entry.Message, (AgentMessageSeverity)entry.Severity);
}
},
cancellationToken);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ private async ValueTask DisplayResultsAsync(WatchHotReloadService.Updates update
switch (updates.Status)
{
case ModuleUpdateStatus.None:
_reporter.Output("No C# changes to apply.");
_reporter.Report(MessageDescriptor.NoHotReloadChangesToApply);
break;

case ModuleUpdateStatus.Ready:
Expand Down
10 changes: 7 additions & 3 deletions src/BuiltInTools/dotnet-watch/HotReload/DefaultDeltaApplier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ async Task<ImmutableArray<string>> ConnectAsync()

// When the client connects, the first payload it sends is the initialization payload which includes the apply capabilities.

var capabilities = ClientInitializationPayload.Read(_pipe).Capabilities;
var capabilities = (await ClientInitializationPayload.ReadAsync(_pipe, cancellationToken)).Capabilities;
Reporter.Verbose($"Capabilities: '{capabilities}'");
return capabilities.Split(' ').ToImmutableArray();
return [.. capabilities.Split(' ')];
}
catch (EndOfStreamException)
{
Expand Down Expand Up @@ -149,7 +149,11 @@ private async Task<bool> ReceiveApplyUpdateResult(CancellationToken cancellation
return false;
}

ReportLog(Reporter, UpdatePayload.ReadLog(_pipe));
await foreach (var (message, severity) in UpdatePayload.ReadLogAsync(_pipe, cancellationToken))
{
ReportLogEntry(Reporter, message, severity);
}

return true;
}
finally
Expand Down
29 changes: 13 additions & 16 deletions src/BuiltInTools/dotnet-watch/HotReload/DeltaApplier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,21 @@ internal abstract class DeltaApplier(IReporter reporter) : IDisposable

public abstract void Dispose();

public static void ReportLog(IReporter reporter, IEnumerable<(string message, AgentMessageSeverity severity)> log)
public static void ReportLogEntry(IReporter reporter, string message, AgentMessageSeverity severity)
{
foreach (var (message, severity) in log)
switch (severity)
{
switch (severity)
{
case AgentMessageSeverity.Error:
reporter.Error(message);
break;

case AgentMessageSeverity.Warning:
reporter.Warn(message, emoji: "⚠");
break;

default:
reporter.Verbose(message, emoji: "🕵️");
break;
}
case AgentMessageSeverity.Error:
reporter.Error(message);
break;

case AgentMessageSeverity.Warning:
reporter.Warn(message, emoji: "⚠");
break;

default:
reporter.Verbose(message, emoji: "🕵️");
break;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ public async Task UpdateProjectConeAsync(string rootProjectPath, CancellationTok
projectInfos = [];
}

var oldProjectIdsByPath = oldSolution.Projects.ToDictionary(keySelector: static p => p.FilePath!, elementSelector: static p => p.Id);
var oldProjectIdsByPath = oldSolution.Projects.ToDictionary(keySelector: static p => (p.FilePath!, p.Name), elementSelector: static p => p.Id);

// Map new project id to the corresponding old one based on file path, if it exists, and null for added projects.
// Map new project id to the corresponding old one based on file path and project name (includes TFM), if it exists, and null for added projects.
// Deleted projects won't be included in this map.
var projectIdMap = projectInfos.ToDictionary(
keySelector: static info => info.Id,
elementSelector: info => oldProjectIdsByPath.TryGetValue(info.FilePath!, out var oldProjectId) ? oldProjectId : null);
elementSelector: info => oldProjectIdsByPath.TryGetValue((info.FilePath!, info.Name), out var oldProjectId) ? oldProjectId : null);

var newSolution = oldSolution;

Expand Down
Loading
Loading