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

Rev deps Microsoft.Extensions and System deps to 6.x #1143

Merged
merged 7 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
<PackageReference Include="Azure.Storage.Queues" Version="12.18.0" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="6.0.0" />
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="2.2.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/DurableTask.Core/DurableTask.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="6.0.1" />
<PackageReference Include="System.Reactive.Core" Version="4.4.1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,21 @@
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'net462'">
<PackageReference Include="Azure.Monitor.OpenTelemetry.Exporter" Version="1.0.0-beta.3" />
<!-- Increasing Azure.Monitor.OpenTelemetry.Exporter to 1.0.0-beta.5 or beyond brings Systems.DiagnosticSource 7.x, which is uncompatible with netcoreapp3.1.
Copy link
Collaborator

@jviau jviau Jul 18, 2024

Choose a reason for hiding this comment

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

I recommend updating test projects to net6.0 anyways (separate PR?). netcoreapp3.1 is out of support

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah that would be good. I would like to wait until bundles V4 is on net6.0, then perform the change. Currently this matches the bundles v4 TFM, which seems reasonable to me.

Copy link
Collaborator

@jviau jviau Jul 18, 2024

Choose a reason for hiding this comment

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

@davidmrdavid bundles TFM only impacts nuget resolution. It has no impact on runtime. Runtime will be net6.0 not netcoreapp3.1 - so waiting for bundles to update to net6.0 is not relevant to this testing scenario.

The warning reads:
"System.Diagnostics.DiagnosticSource 7.0.0-rc.1.22426.10 doesn't support netcoreapp3.1 and has not been tested with it
Consider upgrading your TargetFramework to net6.0 or later. You may also set <SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
in the project file to ignore this warning and attempt to run in this unsupported configuration at your own risk."-->
<PackageReference Include="Azure.Monitor.OpenTelemetry.Exporter" Version="1.0.0-beta.4" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.5.0" />
<PackageReference Include="WindowsAzure.Storage" version="9.3.3" />
</ItemGroup>

<!-- Common package dependencies -->
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.2.0" />
<PackageReference Include="Microsoft.ApplicationInsights.DependencyCollector" Version="2.12.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="6.0.0" />
<PackageReference Include="Microsoft.ApplicationInsights.DependencyCollector" Version="2.22.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.5.0" />
<PackageReference Include="MSTest.TestFramework" Version="3.5.0" />
Expand Down
10 changes: 6 additions & 4 deletions test/DurableTask.AzureStorage.Tests/TestHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@ public static TestOrchestrationHost GetTestOrchestrationHost(
{
string storageConnectionString = GetTestStorageAccountConnectionString();

// TODO: update Microsoft.Extensions.Logging to avoid the following warning suppression
#pragma warning disable CS0618 // Type or member is obsolete
var loggerFactory = LoggerFactory.Create(builder =>
{
builder.AddConsole().SetMinimumLevel(LogLevel.Trace);
});

var settings = new AzureStorageOrchestrationServiceSettings
{
ExtendedSessionIdleTimeout = TimeSpan.FromSeconds(extendedSessionTimeoutInSeconds),
Expand All @@ -42,9 +45,8 @@ public static TestOrchestrationHost GetTestOrchestrationHost(
TaskHubName = GetTestTaskHubName(),

// Setting up a logger factory to enable the new DurableTask.Core logs
LoggerFactory = new LoggerFactory().AddConsole(LogLevel.Trace),
LoggerFactory = loggerFactory,
};
#pragma warning restore CS0618 // Type or member is obsolete

// Give the caller a chance to make test-specific changes to the settings
modifySettingsAction?.Invoke(settings);
Expand Down
9 changes: 4 additions & 5 deletions test/DurableTask.Core.Tests/DispatcherMiddlewareTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,10 @@ public void InitializeTests()
{
// configure logging so traces are emitted during tests.
// This facilitates debugging when tests fail.

// TODO: update Microsoft.Extensions.Logging to avoid the following warning suppression
#pragma warning disable CS0618 // Type or member is obsolete
var loggerFactory = new LoggerFactory().AddConsole(LogLevel.Trace);
#pragma warning restore CS0618 // Type or member is obsolete
var loggerFactory = LoggerFactory.Create(builder =>
{
builder.AddConsole().SetMinimumLevel(LogLevel.Trace);
});
var service = new LocalOrchestrationService();
this.worker = new TaskHubWorker(service, loggerFactory);

Expand Down
4 changes: 2 additions & 2 deletions test/DurableTask.Core.Tests/DurableTask.Core.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.5.0" />
<PackageReference Include="MSTest.TestFramework" Version="3.5.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="6.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ public ExceptionHandlingIntegrationTests()
// configure logging so traces are emitted during tests.
// This facilitates debugging when tests fail.

// TODO: update Microsoft.Extensions.Logging to avoid the following warning suppression
#pragma warning disable CS0618 // Type or member is obsolete
var loggerFactory = new LoggerFactory().AddConsole(LogLevel.Trace);
#pragma warning restore CS0618 // Type or member is obsolete
var loggerFactory = LoggerFactory.Create(builder =>
{
builder.AddConsole().SetMinimumLevel(LogLevel.Trace);
});

var service = new LocalOrchestrationService();
this.worker = new TaskHubWorker(service, loggerFactory);
Expand Down