Merge branch 'dev' into TheGreatAuthenticationRework

This commit is contained in:
Jordan Dominion
2025-04-26 14:01:28 -04:00
16 changed files with 48 additions and 37 deletions
+10 -22
View File
@@ -519,8 +519,8 @@ jobs:
- name: Run Unit Tests
run: sudo dotnet test --no-build --logger "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true" --filter TestCategory!=RequiresDatabase -c ${{ matrix.configuration }}NoWindows --collect:"XPlat Code Coverage" --settings build/ci.runsettings --results-directory ./TestResults tgstation-server.sln
env:
TGS_TEST_DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
TGS_TEST_IRC_CONNECTION_STRING: ${{ secrets.IRC_CONNECTION_STRING }}
TGS_TEST_DISCORD_TOKEN: ${{ matrix.configuration == 'Release' && secrets.DISCORD_TOKEN || '' }}
TGS_TEST_IRC_CONNECTION_STRING: ${{ matrix.configuration == 'Release' && secrets.IRC_CONNECTION_STRING || '' }}
TGS_TEST_APP_ID: ${{ secrets.APP_ID }}
TGS_TEST_APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
TGS_TEST_REPO_SLUG: ${{ github.repository }}
@@ -540,7 +540,7 @@ jobs:
configuration: ["Debug", "Release"]
env:
TGS_TELEMETRY_KEY_FILE: C:/tgs_telemetry_key.txt
runs-on: windows-latest
runs-on: windows-2025
steps:
- name: Setup dotnet
uses: actions/setup-dotnet@v4
@@ -588,8 +588,6 @@ jobs:
- name: Run Unit Tests
run: dotnet test --no-build --logger "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true" --filter TestCategory!=RequiresDatabase -c ${{ matrix.configuration }}NoWix --collect:"XPlat Code Coverage" --settings build/ci.runsettings --results-directory ./TestResults tgstation-server.sln
env:
TGS_TEST_DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
TGS_TEST_IRC_CONNECTION_STRING: ${{ secrets.IRC_CONNECTION_STRING }}
TGS_TEST_APP_ID: ${{ secrets.APP_ID }}
TGS_TEST_APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
TGS_TEST_REPO_SLUG: ${{ github.repository }}
@@ -612,7 +610,7 @@ jobs:
configuration: ["Debug", "Release"]
env:
TGS_TELEMETRY_KEY_FILE: C:/tgs_telemetry_key.txt
runs-on: windows-latest
runs-on: windows-2025
steps:
- name: Setup dotnet
uses: actions/setup-dotnet@v4
@@ -1451,16 +1449,11 @@ jobs:
build-msi:
name: Build Windows Installer .exe
runs-on: windows-latest
runs-on: windows-2025
needs: start-gate
env:
TGS_TELEMETRY_KEY_FILE: C:/tgs_telemetry_key.txt
steps:
- name: Install winget
uses: Cyberboss/install-winget@v1
with:
GITHUB_TOKEN: ${{ secrets.DEV_PUSH_TOKEN }}
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
@@ -1684,7 +1677,7 @@ jobs:
deploy-rest:
name: Deploy REST API
needs: deployment-gate
runs-on: windows-latest
runs-on: windows-2025
permissions:
id-token: write
attestations: write
@@ -1765,7 +1758,7 @@ jobs:
deploy-gql:
name: Deploy GraphQL API
needs: deployment-gate
runs-on: windows-latest
runs-on: windows-2025
permissions:
id-token: write
attestations: write
@@ -1853,7 +1846,7 @@ jobs:
deploy-dm:
name: Deploy DreamMaker API
needs: deployment-gate
runs-on: windows-latest
runs-on: windows-2025
permissions:
id-token: write
attestations: write
@@ -2023,7 +2016,7 @@ jobs:
deploy-tgs:
name: Deploy TGS
needs: [deploy-dm, deploy-rest, deploy-gql, deployment-gate]
runs-on: windows-latest
runs-on: windows-2025
if: (!(cancelled() || failure())) && github.event.ref == 'refs/heads/master' && contains(github.event.head_commit.message, '[TGSDeploy]') && needs.deployment-gate.result == 'success'
env:
TGS_TELEMETRY_KEY_FILE: C:/tgs_telemetry_key.txt
@@ -2440,7 +2433,7 @@ jobs:
name: Deploy TGS (winget)
needs: deploy-tgs
if: (!(cancelled() || failure())) && needs.deploy-tgs.result == 'success'
runs-on: windows-latest
runs-on: windows-2025
steps:
- name: Setup dotnet
uses: actions/setup-dotnet@v4
@@ -2448,11 +2441,6 @@ jobs:
dotnet-version: ${{ env.TGS_DOTNET_VERSION }}.0.x
dotnet-quality: ${{ env.TGS_DOTNET_QUALITY }}
- name: Install winget
uses: Cyberboss/install-winget@v1
with:
GITHUB_TOKEN: ${{ secrets.DEV_PUSH_TOKEN }}
- name: Install wingetcreate
run: winget install wingetcreate --version 1.2.8.0 --disable-interactivity --accept-source-agreements # Pinned due to breaking every other version
+3 -3
View File
@@ -3,15 +3,15 @@
<!-- Integration tests will ensure they match across the board -->
<Import Project="WebpanelVersion.props" />
<PropertyGroup>
<TgsCoreVersion>6.16.0</TgsCoreVersion>
<TgsCoreVersion>6.17.0</TgsCoreVersion>
<TgsConfigVersion>5.7.0</TgsConfigVersion>
<TgsRestVersion>10.13.0</TgsRestVersion>
<TgsGraphQLVersion>0.6.0</TgsGraphQLVersion>
<TgsCommonLibraryVersion>7.0.0</TgsCommonLibraryVersion>
<TgsApiLibraryVersion>18.0.0</TgsApiLibraryVersion>
<TgsClientVersion>21.0.0</TgsClientVersion>
<TgsDmapiVersion>7.3.1</TgsDmapiVersion>
<TgsInteropVersion>5.10.0</TgsInteropVersion>
<TgsDmapiVersion>7.3.3</TgsDmapiVersion>
<TgsInteropVersion>5.10.1</TgsInteropVersion>
<TgsHostWatchdogVersion>1.6.0</TgsHostWatchdogVersion>
<TgsSwarmProtocolVersion>9.0.0</TgsSwarmProtocolVersion>
<TgsContainerScriptVersion>1.2.1</TgsContainerScriptVersion>
+1 -1
View File
@@ -1 +1 @@
sha256-1gQOL2JThWYsTPcCzKRXBPOVVZRJgmxvKa+Lo82CWC4=
sha256-Zo6srVhcY2cgitTOJykaoNH4Wxw1m2WQ7CAb3n6QgsI=
+3 -2
View File
@@ -23,12 +23,13 @@ let
byond-patcher = pkgs-i686.writeShellScriptBin "EngineInstallComplete-050-TgsPatchELFByond.sh" ''
# If the file doesn't exist, assume OD
if [[ ! -f ../../Byond/$1/byond/bin/DreamDaemon ]] ; then
BYOND_BIN_PATH="''${TGS_INSTANCE_ROOT}/Byond/$1/byond/bin/"
if [[ ! -f "''${BYOND_BIN_PATH}DreamDaemon" ]] ; then
echo "DreamDaemon doesn't appear to exist. Assuming OD install"
exit
fi
BYOND_PATH=$(realpath ../../Byond/$1/byond/bin/)
BYOND_PATH=$(realpath $BYOND_BIN_PATH)
${pkgs.patchelf}/bin/patchelf --set-interpreter "$(cat ${stdenv.cc}/nix-support/dynamic-linker)" \
--set-rpath "$BYOND_PATH:${rpath}" \
+1 -1
View File
@@ -1,7 +1,7 @@
// tgstation-server DMAPI
// The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in IETF RFC 2119.
#define TGS_DMAPI_VERSION "7.3.1"
#define TGS_DMAPI_VERSION "7.3.3"
// All functions and datums outside this document are subject to change with any version and should not be relied on.
+1 -1
View File
@@ -1 +1 @@
"5.10.0"
"5.10.1"
+1 -1
View File
@@ -97,7 +97,7 @@
if(revInfo)
tm.commit = revisionData[DMAPI5_REVISION_INFORMATION_COMMIT_SHA]
tm.origin_commit = revisionData[DMAPI5_REVISION_INFORMATION_ORIGIN_COMMIT_SHA]
tm.timestamp = entry[DMAPI5_REVISION_INFORMATION_TIMESTAMP]
tm.timestamp = revisionData[DMAPI5_REVISION_INFORMATION_TIMESTAMP]
else
TGS_WARNING_LOG("Failed to decode [DMAPI5_TEST_MERGE_REVISION] from test merge #[tm.number]!")
@@ -28,7 +28,7 @@
<!-- Usage: HTTP constants reference -->
<PackageReference Include="Microsoft.AspNetCore.Http.Extensions" Version="2.3.0" />
<!-- Usage: Decoding the 'nbf' property of JWTs -->
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.8.0" />
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.9.0" />
<!-- Usage: Data model annotating -->
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
</ItemGroup>
@@ -292,6 +292,7 @@ namespace Tgstation.Server.Host.Components
platformIdentifier,
fileTransferService,
loggerFactory.CreateLogger<StaticFiles.Configuration>(),
metadata,
generalConfiguration,
sessionConfiguration);
var eventConsumer = new EventConsumer(configuration);
@@ -1,5 +1,4 @@
using System;
using System.Globalization;
using Tgstation.Server.Api.Models.Internal;
@@ -40,7 +39,7 @@ namespace Tgstation.Server.Host.Components.Interop.Bridge
public TestMergeInformation(Models.TestMerge testMerge, RevisionInformation revision)
: base(testMerge)
{
TimeMerged = testMerge?.MergedAt.Ticks.ToString(CultureInfo.InvariantCulture) ?? throw new ArgumentNullException(nameof(testMerge));
TimeMerged = testMerge?.MergedAt.ToString("O") ?? throw new ArgumentNullException(nameof(testMerge));
Revision = revision ?? throw new ArgumentNullException(nameof(revision));
}
}
@@ -124,6 +124,11 @@ namespace Tgstation.Server.Host.Components.StaticFiles
/// </summary>
readonly ILogger<Configuration> logger;
/// <summary>
/// The <see cref="Api.Models.Instance"/> the <see cref="Configuration"/> belongs to.
/// </summary>
readonly Models.Instance metadata;
/// <summary>
/// The <see cref="GeneralConfiguration"/> for <see cref="Configuration"/>.
/// </summary>
@@ -159,6 +164,7 @@ namespace Tgstation.Server.Host.Components.StaticFiles
/// <param name="postWriteHandler">The value of <see cref="postWriteHandler"/>.</param>
/// <param name="platformIdentifier">The value of <see cref="platformIdentifier"/>.</param>
/// <param name="fileTransferService">The value of <see cref="fileTransferService"/>.</param>
/// <param name="metadata">The value of <see cref="metadata"/>.</param>
/// <param name="logger">The value of <see cref="logger"/>.</param>
/// <param name="generalConfiguration">The value of <see cref="generalConfiguration"/>.</param>
/// <param name="sessionConfiguration">The value of <see cref="sessionConfiguration"/>.</param>
@@ -171,6 +177,7 @@ namespace Tgstation.Server.Host.Components.StaticFiles
IPlatformIdentifier platformIdentifier,
IFileTransferTicketProvider fileTransferService,
ILogger<Configuration> logger,
Models.Instance metadata,
GeneralConfiguration generalConfiguration,
SessionConfiguration sessionConfiguration)
{
@@ -182,6 +189,7 @@ namespace Tgstation.Server.Host.Components.StaticFiles
this.platformIdentifier = platformIdentifier ?? throw new ArgumentNullException(nameof(platformIdentifier));
this.fileTransferService = fileTransferService ?? throw new ArgumentNullException(nameof(fileTransferService));
this.logger = logger ?? throw new ArgumentNullException(nameof(logger));
this.metadata = metadata ?? throw new ArgumentNullException(nameof(metadata));
this.generalConfiguration = generalConfiguration ?? throw new ArgumentNullException(nameof(generalConfiguration));
this.sessionConfiguration = sessionConfiguration ?? throw new ArgumentNullException(nameof(sessionConfiguration));
@@ -844,6 +852,10 @@ namespace Tgstation.Server.Host.Components.StaticFiles
return $"\"{arg}\"";
})),
cancellationToken,
new Dictionary<string, string>
{
{ "TGS_INSTANCE_ROOT", metadata.Path! },
},
readStandardHandles: true,
noShellExecute: true))
using (cancellationToken.Register(() => script.Terminate()))
@@ -356,7 +356,6 @@ namespace Tgstation.Server.Host.Jobs
{
ArgumentNullException.ThrowIfNull(instanceCoreProvider);
logger.LogTrace("Activating job manager...");
activationTcs.SetResult(instanceCoreProvider);
}
@@ -130,7 +130,7 @@
<!-- Usage: Database connectivity health check -->
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" Version="8.0.15" />
<!-- Usage: OIDC support prerequisite. See https://stackoverflow.com/a/78650835/3976486 -->
<PackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="8.8.0" />
<PackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="8.9.0" />
<!-- Usage: POSIX support for syscalls, signals, and symlinks -->
<PackageReference Include="Mono.Posix.NETStandard" Version="1.0.0" />
<!-- Usage: Cron string parsing -->
@@ -4,6 +4,13 @@ set -e
echo "Running test_event script - $1 - $2"
if [[ -z "${TGS_INSTANCE_ROOT}" ]]; then
echo "TEST ERROR: TGS_INSTANCE_ROOT env var not defined"
exit 1
fi
echo "TGS_INSTANCE_ROOT: ${TGS_INSTANCE_ROOT}"
sleep 5
cd $1
@@ -61,7 +61,7 @@ namespace Tgstation.Server.Host.Components.Chat.Providers.Tests
public async Task TestConnectAndDisconnect()
{
var actualToken = Environment.GetEnvironmentVariable("TGS_TEST_IRC_CONNECTION_STRING");
if (actualToken == null)
if (String.IsNullOrWhiteSpace(actualToken))
Assert.Inconclusive("Required environment variable TGS_TEST_IRC_CONNECTION_STRING isn't set!");
if (!new IrcConnectionStringBuilder(actualToken).Valid)
@@ -53,6 +53,10 @@ namespace Tgstation.Server.Host.Components.StaticFiles.Tests
Mock.Of<IPlatformIdentifier>(),
Mock.Of<IFileTransferTicketProvider>(),
loggerFactory.CreateLogger<Configuration>(),
new Models.Instance
{
Path = "Some path",
},
new GeneralConfiguration(),
new SessionConfiguration());