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

.NET 9 uber package update PR #2028

Merged
merged 16 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from 7 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
2 changes: 1 addition & 1 deletion .github/workflows/ci-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1276,7 +1276,7 @@ jobs:
path: ./code_coverage/integration_tests/windows_integration_tests_release_system_sqlite

- name: Upload Coverage to CodeCov
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
directory: ./code_coverage
fail_ci_if_error: true
Expand Down
4 changes: 2 additions & 2 deletions build/TestCommon.props
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
<!-- Pinned: Be VERY careful about updating https://github.com/moq/moq/issues/1372 -->
<PackageReference Include="Moq" Version="4.20.72" />
<!-- Usage: MSTest execution -->
<PackageReference Include="MSTest.TestAdapter" Version="3.6.1" />
<PackageReference Include="MSTest.TestAdapter" Version="3.6.3" />
<!-- Usage: MSTest asserts etc... -->
<PackageReference Include="MSTest.TestFramework" Version="3.6.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.3" />
</ItemGroup>

</Project>
5 changes: 2 additions & 3 deletions build/Version.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@
<TgsRestVersion>10.12.0</TgsRestVersion>
<TgsGraphQLVersion>0.5.0</TgsGraphQLVersion>
<TgsCommonLibraryVersion>7.0.0</TgsCommonLibraryVersion>
<TgsApiLibraryVersion>16.3.0</TgsApiLibraryVersion>
<TgsClientVersion>19.3.0</TgsClientVersion>
<TgsApiLibraryVersion>17.0.0</TgsApiLibraryVersion>
<TgsClientVersion>20.0.0</TgsClientVersion>
<TgsDmapiVersion>7.3.0</TgsDmapiVersion>
<TgsInteropVersion>5.10.0</TgsInteropVersion>
<TgsHostWatchdogVersion>1.6.0</TgsHostWatchdogVersion>
<TgsSwarmProtocolVersion>8.0.0</TgsSwarmProtocolVersion>
<TgsContainerScriptVersion>1.2.1</TgsContainerScriptVersion>
<TgsMigratorVersion>2.0.0</TgsMigratorVersion>
<TgsNugetNetFramework>netstandard2.0</TgsNugetNetFramework>
<TgsNetMajorVersion>8</TgsNetMajorVersion>
<!-- Update this frequently with dotnet runtime patches. MAJOR MUST MATCH ABOVE! -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.IO;
using System.ServiceProcess;

using Tgstation.Server.Common;
using Tgstation.Server.Host.Common;

using WixToolset.Dtf.WindowsInstaller;
Expand All @@ -13,12 +14,6 @@
/// </summary>
public static class InstallationExtensions
{
/// <summary>
/// Package name
/// </summary>
/// <remarks>As much as I'd like to use Tgstation.Server.Common.Constants.CanonicalPackageName here, attempting to reference it makes Tgstation.Server.Migrator.Comms fail due to referencing the net2.0 version of that library. EVEN THOUGH IT'S A TRANSITIVE DEPENDENCY OF Tgstation.Server.Client!!!!! If that dead-ass tool has been removed, feel free to do this.</remarks>
const string CanonicalPackageName = "tgstation-server";

/// <summary>
/// Attempts to detach stop the existing tgstation-server service if it exists.
/// </summary>
Expand All @@ -35,35 +30,35 @@ public static ActionResult DetachStopTgsServiceIfRunning(Session session)
session.Log("Begin DetachStopTgsServiceIfRunning");
ServiceController serviceController = null;

session.Log($"Searching for {CanonicalPackageName} service...");
session.Log($"Searching for {Constants.CanonicalPackageName} service...");
try
{
foreach (var controller in ServiceController.GetServices())
if (controller.ServiceName == CanonicalPackageName)
if (controller.ServiceName == Constants.CanonicalPackageName)
serviceController = controller;
else
controller.Dispose();

if (serviceController == null || serviceController.Status != ServiceControllerStatus.Running)
{
session.Log($"{CanonicalPackageName} service not found. Continuing.");
session.Log($"{Constants.CanonicalPackageName} service not found. Continuing.");
return ActionResult.Success;
}

var commandId = PipeCommands.GetServiceCommandId(
PipeCommands.CommandDetachingShutdown)
.Value;

session.Log($"{CanonicalPackageName} service found. Sending command \"{PipeCommands.CommandDetachingShutdown}\" ({commandId})...");
session.Log($"{Constants.CanonicalPackageName} service found. Sending command \"{PipeCommands.CommandDetachingShutdown}\" ({commandId})...");

serviceController.ExecuteCommand(commandId);

session.Log($"Command sent. Waiting for {CanonicalPackageName} service to stop...");
session.Log($"Command sent. Waiting for {Constants.CanonicalPackageName} service to stop...");

serviceController.WaitForStatus(ServiceControllerStatus.Stopped, TimeSpan.FromMinutes(1));

var stopped = serviceController.Status == ServiceControllerStatus.Stopped;
session.Log($"{CanonicalPackageName} stopped {(stopped ? String.Empty : "un")}successfully.");
session.Log($"{Constants.CanonicalPackageName} stopped {(stopped ? String.Empty : "un")}successfully.");

return stopped
? ActionResult.Success
Expand Down Expand Up @@ -97,7 +92,7 @@ public static ActionResult ApplyProductionAppsettingsIfNonExistant(Session sessi
session.Log("Begin ApplyProductionAppsettingsIfNonExistant");
var programDataDirectory = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData),
CanonicalPackageName);
Constants.CanonicalPackageName);
var initialAppSettingsPath = Path.Combine(programDataDirectory, "appsettings.Initial.yml");
var productionAppSettingsPath = Path.Combine(programDataDirectory, "appsettings.Production.yml");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\..\src\Tgstation.Server.Common\Tgstation.Server.Common.csproj" />
<ProjectReference Include="..\..\..\..\src\Tgstation.Server.Host.Common\Tgstation.Server.Host.Common.csproj">
<Private>True</Private>
</ProjectReference>
Expand Down
3 changes: 2 additions & 1 deletion src/Tgstation.Server.Api/Tgstation.Server.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@
<!-- Usage: HTTP constants reference -->
<PackageReference Include="Microsoft.AspNetCore.Http.Extensions" Version="2.2.0" />
<!-- Usage: Decoding the 'nbf' property of JWTs -->
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.1.2" />
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.2.1" />
<!-- Usage: Data model annotating -->
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="System.Text.Encodings.Web" Version="9.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

<ItemGroup>
<!-- GraphQL connector and code generator -->
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
<PackageReference Include="StrawberryShake.Server" Version="13.9.14" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="9.0.0" />
<PackageReference Include="StrawberryShake.Server" Version="14.1.0" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/Tgstation.Server.Client/Tgstation.Server.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

<ItemGroup>
<!-- Usage: Connecting to SignalR hubs in API -->
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="8.0.10" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="9.0.0" />
<!-- Usage: Using target JSON serializer for API -->
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" Version="8.0.10" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" Version="9.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
#if NETSTANDARD2_0_OR_GREATER
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading.Tasks;
Expand Down Expand Up @@ -155,3 +156,4 @@ public static async ValueTask WhenAll(IReadOnlyList<ValueTask> tasks)
public static ValueTask WhenAll(params ValueTask[] tasks) => WhenAll((IReadOnlyList<ValueTask>)tasks);
}
}
#endif
4 changes: 3 additions & 1 deletion src/Tgstation.Server.Common/Extensions/VersionExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
#if NETSTANDARD2_0_OR_GREATER
using System;

namespace Tgstation.Server.Common.Extensions
{
Expand All @@ -24,3 +25,4 @@ public static Version Semver(this Version version)
}
}
}
#endif
4 changes: 3 additions & 1 deletion src/Tgstation.Server.Common/Http/CachedResponseStream.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
#if NETSTANDARD2_0_OR_GREATER
using System;
using System.IO;
using System.Net.Http;
using System.Threading.Tasks;
Expand Down Expand Up @@ -105,3 +106,4 @@ protected override void Dispose(bool disposing)
}
}
}
#endif
4 changes: 3 additions & 1 deletion src/Tgstation.Server.Common/Http/HttpClient.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
#if NETSTANDARD2_0_OR_GREATER
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading;
Expand Down Expand Up @@ -49,3 +50,4 @@ public Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, HttpCompl
=> httpClient.SendAsync(request, completionOption, cancellationToken);
}
}
#endif
4 changes: 3 additions & 1 deletion src/Tgstation.Server.Common/Http/HttpClientFactory.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
#if NETSTANDARD2_0_OR_GREATER
using System;
using System.Net.Http.Headers;

namespace Tgstation.Server.Common.Http
Expand Down Expand Up @@ -39,3 +40,4 @@ public HttpClientFactory(ProductInfoHeaderValue userAgent)
}
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
namespace Tgstation.Server.Common.Http
#if NETSTANDARD2_0_OR_GREATER
namespace Tgstation.Server.Common.Http
{
/// <summary>
/// Creates <see cref="IHttpClient"/>s.
Expand All @@ -12,3 +13,4 @@ public interface IAbstractHttpClientFactory
IHttpClient CreateClient();
}
}
#endif
4 changes: 3 additions & 1 deletion src/Tgstation.Server.Common/Http/IHttpClient.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
#if NETSTANDARD2_0_OR_GREATER
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading;
Expand Down Expand Up @@ -31,3 +32,4 @@ public interface IHttpClient : IDisposable
Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken);
}
}
#endif
13 changes: 10 additions & 3 deletions src/Tgstation.Server.Common/Tgstation.Server.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
<Import Project="../../build/NugetCommon.props" />

<PropertyGroup>
<TargetFrameworks>$(TgsNugetNetFramework)</TargetFrameworks>
<TargetFrameworks>$(TgsNugetNetFramework);net2.0</TargetFrameworks>
<Version>$(TgsCommonLibraryVersion)</Version>
<Nullable>enable</Nullable>
<Description>Common functions for tgstation-server.</Description>
<PackageTags>web tgstation-server tgstation ss13 byond client http</PackageTags>
<PackageReleaseNotes>$(TGS_NUGET_RELEASE_NOTES_COMMON)</PackageReleaseNotes>
</PropertyGroup>

<ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' != 'net2.0'">
<!-- Usage: ValueTask netstandard backport -->
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.6.0" />
</ItemGroup>

<Target Name="IconGeneration" BeforeTargets="ResolveAssemblyReferences" Inputs="../../build/logo.svg" Outputs="../../artifacts/tgs.ico;../../artifacts/tgs.png;../../tools/Tgstation.Server.LogoGenerator/Program.cs">
Expand All @@ -24,4 +24,11 @@
<Message Text="Cleaning icons..." Importance="high" />
<Delete Files="../../artifacts/tgs.ico;../../artifacts/tgs.png" />
</Target>

<ItemGroup Condition="'$(TargetFramework)' == 'net2.022'">
<Compile Remove="Extensions\*.cs" />
<Compile Remove="Http\*.cs" />
<None Include="Extensions\*.cs" />
<None Include="Http\*.cs" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

<ItemGroup>
<!-- Usage: Identifying if we're running under SystemD -->
<PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="9.0.0" />
<!-- Usage: Console logging plugin -->
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="9.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,19 @@
<!-- Usage: Command line argument support -->
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="4.1.1" />
<!-- Usage: Identifies when we are running in the context of the Windows SCM -->
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="9.0.0" />
<!-- Usage: Windows event log logging plugin -->
<PackageReference Include="Microsoft.Extensions.Logging.EventLog" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.EventLog" Version="9.0.0" />
<!-- Usage: Console logging plugin -->
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="9.0.0" />
<!-- Usage: Updated transitive dependency of Core.System.ServiceProcess -->
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<!-- Usage: Updated transitive dependency of Core.System.ServiceProcess -->
<PackageReference Include="System.Drawing.Common" Version="9.0.0" />
<!-- Usage: OS identification -->
<PackageReference Include="System.Runtime.InteropServices" Version="4.3.0" />
<!-- Usage: Windows Service Manager intergration -->
<PackageReference Include="System.ServiceProcess.ServiceController" Version="8.0.1" />
<PackageReference Include="System.ServiceProcess.ServiceController" Version="9.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<ItemGroup>
<!-- Usage: Logging abstractions -->
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.0" />
<!-- Usage: POSIX support for signals -->
<PackageReference Include="Mono.Posix.NETStandard" Version="1.0.0" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Tgstation.Server.Host/.config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"dotnet-ef": {
"version": "8.0.10",
"version": "8.0.11",
"commands": [
"dotnet-ef"
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;

using BetterWin32Errors;

using Microsoft.Extensions.Logging;

using Serilog.Context;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
using System;
using System.ComponentModel;
using System.IO;
using System.Threading;
using System.Threading.Tasks;

using BetterWin32Errors;

using Tgstation.Server.Host.System;

namespace Tgstation.Server.Host.IO
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

using BetterWin32Errors;

using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
Expand All @@ -8,7 +9,6 @@
using System.Threading;
using System.Threading.Tasks;

using BetterWin32Errors;
using Microsoft.Extensions.Logging;

using Tgstation.Server.Api.Models;
Expand Down
Loading
Loading