mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-31 09:02:41 +01:00
@@ -1975,8 +1975,10 @@ jobs:
|
||||
shell: powershell
|
||||
run: build/package/winget/push_manifest.ps1
|
||||
|
||||
- name: Delay 10m to allow MS bot to update PR
|
||||
shell: powershell
|
||||
run: Sleep 600
|
||||
|
||||
- name: Run ReleaseNotes with --link-winget
|
||||
shell: powershell
|
||||
run: |
|
||||
Sleep 600
|
||||
dotnet run -c Release --no-build --project tools/Tgstation.Server.ReleaseNotes --link-winget ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
||||
run: dotnet run -c Release --no-build --project tools/Tgstation.Server.ReleaseNotes --link-winget ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
||||
|
||||
@@ -3,23 +3,24 @@
|
||||
const CONSIDERED_JOBS = [
|
||||
"Windows Live Tests",
|
||||
"Linux Live Tests",
|
||||
"Build .deb Package"
|
||||
];
|
||||
|
||||
async function getFailedJobsForRun(github, context, workflowRunId, runAttempt) {
|
||||
const {
|
||||
data: { jobs },
|
||||
} = await github.rest.actions.listJobsForWorkflowRunAttempt({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
run_id: workflowRunId,
|
||||
attempt_number: runAttempt,
|
||||
});
|
||||
const jobs = await github.paginate(
|
||||
github.rest.actions.listJobsForWorkflowRunAttempt,
|
||||
{
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
run_id: workflowRunId,
|
||||
attempt_number: runAttempt
|
||||
},
|
||||
response => {
|
||||
return response.data.jobs;
|
||||
});
|
||||
|
||||
return jobs
|
||||
.filter((job) => job.conclusion === "failure")
|
||||
.filter((job) =>
|
||||
CONSIDERED_JOBS.some((title) => job.name.startsWith(title))
|
||||
);
|
||||
.filter((job) => job.conclusion === "failure");
|
||||
}
|
||||
|
||||
export async function rerunFlakyTests({ github, context }) {
|
||||
@@ -35,12 +36,17 @@ export async function rerunFlakyTests({ github, context }) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (failingJobs.length === 0) {
|
||||
throw new Error(
|
||||
"rerunFlakyTests should not have run on a run with no failing jobs"
|
||||
);
|
||||
const filteredFailingJobs = failingJobs.filter((job) => {
|
||||
console.log(`Failing job: ${job.name}`)
|
||||
return CONSIDERED_JOBS.some((title) => job.name.startsWith(title));
|
||||
});
|
||||
if (filteredFailingJobs.length === 0) {
|
||||
console.log("Failing jobs are NOT designated flaky. Not rerunning.");
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(`Rerunning job: ${filteredFailingJobs[0].name}`);
|
||||
|
||||
github.rest.actions.reRunWorkflowFailedJobs({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
[](http://forthebadge.com) [](https://www.reddit.com/r/SS13/comments/5oplxp/what_is_the_main_problem_with_byond_as_an_engine/dclbu1a) [](http://forthebadge.com)
|
||||
|
||||
This is a toolset to manage production BYOND servers. It includes the ability to update the server without having to stop or shutdown the server (the update will take effect on a "reboot" of the server), the ability to start the server and restart it if it crashes, as well as systems for managing code and game files, and locally merging GitHub Pull Requests for test deployments.
|
||||
This is a toolset to manage production DreamMaker servers. It includes the ability to update the server without having to stop or shutdown the server (the update will take effect on a "reboot" of the server), the ability to start the server and restart it if it crashes, as well as systems for managing code and game files, and locally merging GitHub Pull Requests for test deployments.
|
||||
|
||||
## Setup
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<!-- Usage: Code coverage collection -->
|
||||
<PackageReference Include="coverlet.collector" Version="6.0.1">
|
||||
<PackageReference Include="coverlet.collector" Version="6.0.2">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
@@ -18,9 +18,9 @@
|
||||
<!-- Pinned: Be VERY careful about updating https://github.com/moq/moq/issues/1372 -->
|
||||
<PackageReference Include="Moq" Version="4.20.70" />
|
||||
<!-- Usage: MSTest execution -->
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="3.2.2" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="3.3.1" />
|
||||
<!-- Usage: MSTest asserts etc... -->
|
||||
<PackageReference Include="MSTest.TestFramework" Version="3.2.2" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="3.3.1" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
+6
-6
@@ -3,13 +3,13 @@
|
||||
<!-- Integration tests will ensure they match across the board -->
|
||||
<Import Project="WebpanelVersion.props" />
|
||||
<PropertyGroup>
|
||||
<TgsCoreVersion>6.4.1</TgsCoreVersion>
|
||||
<TgsCoreVersion>6.5.0</TgsCoreVersion>
|
||||
<TgsConfigVersion>5.1.0</TgsConfigVersion>
|
||||
<TgsApiVersion>10.2.0</TgsApiVersion>
|
||||
<TgsApiVersion>10.3.0</TgsApiVersion>
|
||||
<TgsCommonLibraryVersion>7.0.0</TgsCommonLibraryVersion>
|
||||
<TgsApiLibraryVersion>13.2.0</TgsApiLibraryVersion>
|
||||
<TgsClientVersion>15.2.0</TgsClientVersion>
|
||||
<TgsDmapiVersion>7.1.1</TgsDmapiVersion>
|
||||
<TgsApiLibraryVersion>13.3.0</TgsApiLibraryVersion>
|
||||
<TgsClientVersion>15.3.0</TgsClientVersion>
|
||||
<TgsDmapiVersion>7.1.2</TgsDmapiVersion>
|
||||
<TgsInteropVersion>5.9.0</TgsInteropVersion>
|
||||
<TgsHostWatchdogVersion>1.4.1</TgsHostWatchdogVersion>
|
||||
<TgsContainerScriptVersion>1.2.1</TgsContainerScriptVersion>
|
||||
@@ -17,7 +17,7 @@
|
||||
<TgsNugetNetFramework>netstandard2.0</TgsNugetNetFramework>
|
||||
<TgsNetMajorVersion>8</TgsNetMajorVersion>
|
||||
<!-- Update this frequently with dotnet runtime patches. MAJOR MUST MATCH ABOVE! -->
|
||||
<TgsDotnetRedistUrl>https://download.visualstudio.microsoft.com/download/pr/98ff0a08-a283-428f-8e54-19841d97154c/8c7d5f9600eadf264f04c82c813b7aab/dotnet-hosting-8.0.2-win.exe</TgsDotnetRedistUrl>
|
||||
<TgsDotnetRedistUrl>https://download.visualstudio.microsoft.com/download/pr/00397fee-1bd9-44ef-899b-4504b26e6e96/ab9c73409659f3238d33faee304a8b7c/dotnet-hosting-8.0.4-win.exe</TgsDotnetRedistUrl>
|
||||
<TgsMariaDBRedistVersion>10.11.6</TgsMariaDBRedistVersion>
|
||||
<TgsYarnVersion>1.22.21</TgsYarnVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<!-- This is in it's own file to help incremental building, changing it causes a complete rebuild of the web panel -->
|
||||
<TgsWebpanelVersion>5.6.0</TgsWebpanelVersion>
|
||||
<TgsWebpanelVersion>5.7.1</TgsWebpanelVersion>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
||||
@@ -19,7 +19,8 @@ apt-get install -y \
|
||||
ca-certificates \
|
||||
curl \
|
||||
gnupg \
|
||||
xmlstarlet
|
||||
xmlstarlet \
|
||||
libgdiplus
|
||||
|
||||
declare repo_version=$(if command -v lsb_release &> /dev/null; then lsb_release -r -s; else grep -oP '(?<=^VERSION_ID=).+' /etc/os-release | tr -d '"'; fi)
|
||||
curl -L https://packages.microsoft.com/config/ubuntu/$repo_version/packages-microsoft-prod.deb -o packages-microsoft-prod.deb
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
.TH TGS-CONFIGURE 1
|
||||
.SH NAME
|
||||
tgs-configure \- tgstation-server interactive configuration file generator
|
||||
.SH SYNOPSIS
|
||||
.B tgs-configure
|
||||
.SH DESCRIPTION
|
||||
.B tgs-configure
|
||||
.SH OPTIONS
|
||||
The
|
||||
.B tgs-configure
|
||||
command does not take any options.
|
||||
modifies the tgstation-server configuration file stored in /etc/tgstation-server/appsettings.Production.yml.
|
||||
.SH SEE ALSO
|
||||
tgstation-server(7)
|
||||
.SH BUGS
|
||||
See issue tracker at https://github.com/tgstation/tgstation-server/issues.
|
||||
.SH AUTHOR
|
||||
Jordan Dominion (Cyberboss@users.noreply.github.com)
|
||||
@@ -0,0 +1,11 @@
|
||||
.TH TGSTATION-SERVER 7
|
||||
.SH NAME
|
||||
tgstation-server \- A production scale tool for DreamMaker server management
|
||||
.SH DESCRIPTION
|
||||
This is a toolset to manage production DreamMaker servers. It includes the ability to update the server without having to stop or shutdown the server (the update will take effect on a "reboot" of the server), the ability to start the server and restart it if it crashes, as well as systems for managing code and game files, and locally merging GitHub Pull Requests for test deployments.
|
||||
.SH SEE ALSO
|
||||
tgs-configure(1)
|
||||
.SH BUGS
|
||||
See issue tracker at https://github.com/tgstation/tgstation-server/issues.
|
||||
.SH AUTHOR
|
||||
Jordan Dominion (Cyberboss@users.noreply.github.com)
|
||||
@@ -0,0 +1,2 @@
|
||||
debian/man/tgs-configure.1
|
||||
debian/man/tgstation-server.7
|
||||
+7
-2
@@ -1,6 +1,6 @@
|
||||
// tgstation-server DMAPI
|
||||
|
||||
#define TGS_DMAPI_VERSION "7.1.1"
|
||||
#define TGS_DMAPI_VERSION "7.1.2"
|
||||
|
||||
// All functions and datums outside this document are subject to change with any version and should not be relied on.
|
||||
|
||||
@@ -312,6 +312,7 @@
|
||||
var/datum/tgs_chat_embed/structure/embed
|
||||
|
||||
/datum/tgs_message_content/New(text)
|
||||
..()
|
||||
if(!istext(text))
|
||||
TGS_ERROR_LOG("[/datum/tgs_message_content] created with no text!")
|
||||
text = null
|
||||
@@ -354,6 +355,7 @@
|
||||
var/proxy_url
|
||||
|
||||
/datum/tgs_chat_embed/media/New(url)
|
||||
..()
|
||||
if(!istext(url))
|
||||
CRASH("[/datum/tgs_chat_embed/media] created with no url!")
|
||||
|
||||
@@ -367,6 +369,7 @@
|
||||
var/proxy_icon_url
|
||||
|
||||
/datum/tgs_chat_embed/footer/New(text)
|
||||
..()
|
||||
if(!istext(text))
|
||||
CRASH("[/datum/tgs_chat_embed/footer] created with no text!")
|
||||
|
||||
@@ -383,6 +386,7 @@
|
||||
var/proxy_icon_url
|
||||
|
||||
/datum/tgs_chat_embed/provider/author/New(name)
|
||||
..()
|
||||
if(!istext(name))
|
||||
CRASH("[/datum/tgs_chat_embed/provider/author] created with no name!")
|
||||
|
||||
@@ -395,6 +399,7 @@
|
||||
var/is_inline
|
||||
|
||||
/datum/tgs_chat_embed/field/New(name, value)
|
||||
..()
|
||||
if(!istext(name))
|
||||
CRASH("[/datum/tgs_chat_embed/field] created with no name!")
|
||||
|
||||
@@ -510,7 +515,7 @@
|
||||
/*
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2017-2023 Jordan Brown
|
||||
Copyright (c) 2017-2024 Jordan Brown
|
||||
|
||||
Permission is hereby granted, free of charge,
|
||||
to any person obtaining a copy of this software and
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2017-2023 Jordan Brown
|
||||
Copyright (c) 2017-2024 Jordan Brown
|
||||
|
||||
Permission is hereby granted, free of charge,
|
||||
to any person obtaining a copy of this software and
|
||||
|
||||
@@ -7,7 +7,7 @@ TGS_DEFINE_AND_SET_GLOBAL(tgs, null)
|
||||
var/list/warned_deprecated_command_runs
|
||||
|
||||
/datum/tgs_api/New(datum/tgs_event_handler/event_handler, datum/tgs_version/version)
|
||||
. = ..()
|
||||
..()
|
||||
src.event_handler = event_handler
|
||||
src.version = version
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/datum/tgs_version/New(raw_parameter)
|
||||
..()
|
||||
src.raw_parameter = raw_parameter
|
||||
deprefixed_parameter = replacetext(raw_parameter, "/tg/station 13 Server v", "")
|
||||
var/list/version_bits = splittext(deprefixed_parameter, ".")
|
||||
|
||||
@@ -39,5 +39,12 @@ namespace Tgstation.Server.Api.Models.Internal
|
||||
/// </summary>
|
||||
[Required]
|
||||
public TimeSpan? Timeout { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Additional arguments added to the compiler command line.
|
||||
/// </summary>
|
||||
[StringLength(Limits.MaximumStringLength)]
|
||||
[ResponseOptions]
|
||||
public string? CompilerAdditionalArguments { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,5 +57,10 @@ namespace Tgstation.Server.Api.Rights
|
||||
/// User may modify <see cref="Models.Internal.DreamMakerSettings.Timeout"/>.
|
||||
/// </summary>
|
||||
SetTimeout = 1 << 8,
|
||||
|
||||
/// <summary>
|
||||
/// User may modify <see cref="Models.Internal.DreamMakerSettings.CompilerAdditionalArguments"/>.
|
||||
/// </summary>
|
||||
SetCompilerArguments = 1 << 9,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<!-- 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="7.4.0" />
|
||||
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="7.5.1" />
|
||||
<!-- Usage: Primary JSON library -->
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<!-- Usage: Data model annotating -->
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
|
||||
<ItemGroup>
|
||||
<!-- Usage: Connecting to SignalR hubs in API -->
|
||||
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="8.0.2" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="8.0.4" />
|
||||
<!-- Usage: Using target JSON serializer for API -->
|
||||
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" Version="8.0.2" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" Version="8.0.4" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<!-- Usage: Installing service programatically -->
|
||||
<PackageReference Include="Core.System.ServiceProcess" Version="2.0.1" />
|
||||
<!-- Usage: Command line argument support -->
|
||||
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="4.1.0" />
|
||||
<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.0" />
|
||||
<!-- Usage: Windows event log logging plugin -->
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"isRoot": true,
|
||||
"tools": {
|
||||
"dotnet-ef": {
|
||||
"version": "8.0.2",
|
||||
"version": "8.0.4",
|
||||
"commands": [
|
||||
"dotnet-ef"
|
||||
]
|
||||
|
||||
@@ -571,6 +571,7 @@ namespace Tgstation.Server.Host.Components.Deployment
|
||||
progressReporter.StageName = "Copying repository";
|
||||
var resolvedOutputDirectory = ioManager.ResolvePath(outputDirectory);
|
||||
var repoOrigin = repository.Origin;
|
||||
var repoReference = repository.Reference;
|
||||
using (repository)
|
||||
await repository.CopyTo(resolvedOutputDirectory, cancellationToken);
|
||||
|
||||
@@ -585,6 +586,7 @@ namespace Tgstation.Server.Host.Components.Deployment
|
||||
resolvedOutputDirectory,
|
||||
repoOrigin.ToString(),
|
||||
engineLock.Version.ToString(),
|
||||
repoReference,
|
||||
},
|
||||
true,
|
||||
cancellationToken);
|
||||
@@ -630,7 +632,7 @@ namespace Tgstation.Server.Host.Components.Deployment
|
||||
|
||||
// run compiler
|
||||
progressReporter.StageName = "Running Compiler";
|
||||
var compileSuceeded = await RunDreamMaker(engineLock, job, cancellationToken);
|
||||
var compileSuceeded = await RunDreamMaker(engineLock, job, dreamMakerSettings.CompilerAdditionalArguments, cancellationToken);
|
||||
|
||||
// Session takes ownership of the lock and Disposes it so save this for later
|
||||
var engineVersion = engineLock.Version;
|
||||
@@ -848,12 +850,17 @@ namespace Tgstation.Server.Host.Components.Deployment
|
||||
/// </summary>
|
||||
/// <param name="engineLock">The <see cref="IEngineExecutableLock"/> to use.</param>
|
||||
/// <param name="job">The <see cref="CompileJob"/> for the operation.</param>
|
||||
/// <param name="additionalCompilerArguments">Additional arguments to be added to the compiler.</param>
|
||||
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the operation.</param>
|
||||
/// <returns>A <see cref="ValueTask{TResult}"/> resulting in <see langword="true"/> if compilation succeeded, <see langword="false"/> otherwise.</returns>
|
||||
async ValueTask<bool> RunDreamMaker(IEngineExecutableLock engineLock, Models.CompileJob job, CancellationToken cancellationToken)
|
||||
async ValueTask<bool> RunDreamMaker(
|
||||
IEngineExecutableLock engineLock,
|
||||
Models.CompileJob job,
|
||||
string? additionalCompilerArguments,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
var environment = await engineLock.LoadEnv(logger, true, cancellationToken);
|
||||
var arguments = engineLock.FormatCompilerArguments($"{job.DmeName}.{DmeExtension}");
|
||||
var arguments = engineLock.FormatCompilerArguments($"{job.DmeName}.{DmeExtension}", additionalCompilerArguments);
|
||||
|
||||
await using var dm = await processExecutor.LaunchProcess(
|
||||
engineLock.CompilerExePath,
|
||||
|
||||
@@ -147,7 +147,14 @@ namespace Tgstation.Server.Host.Components.Engine
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string FormatCompilerArguments(string dmePath)
|
||||
=> $"-clean \"{dmePath ?? throw new ArgumentNullException(nameof(dmePath))}\"";
|
||||
public override string FormatCompilerArguments(string dmePath, string? additionalArguments)
|
||||
{
|
||||
if (String.IsNullOrWhiteSpace(additionalArguments))
|
||||
additionalArguments = String.Empty;
|
||||
else
|
||||
additionalArguments = $"{additionalArguments.Trim()} ";
|
||||
|
||||
return $"-clean {additionalArguments}\"{dmePath ?? throw new ArgumentNullException(nameof(dmePath))}\"";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace Tgstation.Server.Host.Components.Engine
|
||||
logFilePath);
|
||||
|
||||
/// <inheritdoc />
|
||||
public string FormatCompilerArguments(string dmePath) => Instance.FormatCompilerArguments(dmePath);
|
||||
public string FormatCompilerArguments(string dmePath, string? additionalArguments) => Instance.FormatCompilerArguments(dmePath, additionalArguments);
|
||||
|
||||
/// <inheritdoc />
|
||||
public ValueTask StopServerProcess(ILogger logger, IProcess process, string accessIdentifier, ushort port, CancellationToken cancellationToken)
|
||||
|
||||
@@ -78,7 +78,7 @@ namespace Tgstation.Server.Host.Components.Engine
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public abstract string FormatCompilerArguments(string dmePath);
|
||||
public abstract string FormatCompilerArguments(string dmePath, string? additionalArguments);
|
||||
|
||||
/// <inheritdoc />
|
||||
public abstract string FormatServerArguments(
|
||||
|
||||
@@ -74,8 +74,9 @@ namespace Tgstation.Server.Host.Components.Engine
|
||||
/// Return the command line arguments for compiling a given <paramref name="dmePath"/> if compilation is necessary.
|
||||
/// </summary>
|
||||
/// <param name="dmePath">The full path to the .dme to compile.</param>
|
||||
/// <param name="additionalArguments">Optional additional arguments provided to the compiler.</param>
|
||||
/// <returns>The formatted arguments <see cref="string"/>.</returns>
|
||||
string FormatCompilerArguments(string dmePath);
|
||||
string FormatCompilerArguments(string dmePath, string? additionalArguments);
|
||||
|
||||
/// <summary>
|
||||
/// Kills a given engine server <paramref name="process"/>.
|
||||
|
||||
@@ -112,8 +112,15 @@ namespace Tgstation.Server.Host.Components.Engine
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string FormatCompilerArguments(string dmePath)
|
||||
=> $"--suppress-unimplemented --notices-enabled \"{dmePath ?? throw new ArgumentNullException(nameof(dmePath))}\"";
|
||||
public override string FormatCompilerArguments(string dmePath, string? additionalArguments)
|
||||
{
|
||||
if (String.IsNullOrWhiteSpace(additionalArguments))
|
||||
additionalArguments = String.Empty;
|
||||
else
|
||||
additionalArguments = $"{additionalArguments.Trim()} ";
|
||||
|
||||
return $"--suppress-unimplemented --notices-enabled {additionalArguments}\"{dmePath ?? throw new ArgumentNullException(nameof(dmePath))}\"";
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override async ValueTask StopServerProcess(
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
EngineActiveVersionChange,
|
||||
|
||||
/// <summary>
|
||||
/// After the repo is copied, before CodeModifications are applied. Parameters: Game directory path, origin commit sha, engine version string.
|
||||
/// After the repo is copied, before CodeModifications are applied. Parameters: Game directory path, origin commit sha, engine version string, repository reference (or "(no branch)" if there is no reference).
|
||||
/// </summary>
|
||||
[EventScript("PreCompile")]
|
||||
CompileStart,
|
||||
|
||||
@@ -46,6 +46,11 @@ namespace Tgstation.Server.Host.Components.Repository
|
||||
/// </summary>
|
||||
public const string RemoteTemporaryBranchName = "___TGSTempBranch";
|
||||
|
||||
/// <summary>
|
||||
/// The value of <see cref="Reference"/> when not on a reference.
|
||||
/// </summary>
|
||||
public const string NoReference = "(no branch)";
|
||||
|
||||
/// <summary>
|
||||
/// Used when a reference cannot be determined.
|
||||
/// </summary>
|
||||
|
||||
@@ -357,7 +357,7 @@ namespace Tgstation.Server.Host.Controllers
|
||||
var identExpiry = token.ParseJwt().ValidTo;
|
||||
identExpiry += tokenFactory.ValidationParameters.ClockSkew;
|
||||
identExpiry += TimeSpan.FromSeconds(15);
|
||||
identityCache.CacheSystemIdentity(user, systemIdentity!, identExpiry);
|
||||
await identityCache.CacheSystemIdentity(user, systemIdentity!, identExpiry);
|
||||
}
|
||||
|
||||
Logger.LogDebug("Successfully logged in user {userId}!", user.Id);
|
||||
|
||||
@@ -171,7 +171,8 @@ namespace Tgstation.Server.Host.Controllers
|
||||
| DreamMakerRights.SetApiValidationPort
|
||||
| DreamMakerRights.SetSecurityLevel
|
||||
| DreamMakerRights.SetApiValidationRequirement
|
||||
| DreamMakerRights.SetTimeout)]
|
||||
| DreamMakerRights.SetTimeout
|
||||
| DreamMakerRights.SetCompilerArguments)]
|
||||
[ProducesResponseType(typeof(DreamMakerResponse), 200)]
|
||||
[ProducesResponseType(204)]
|
||||
[ProducesResponseType(typeof(ErrorMessageResponse), 410)]
|
||||
@@ -196,7 +197,8 @@ namespace Tgstation.Server.Host.Controllers
|
||||
{
|
||||
if (!dreamMakerRights.HasFlag(DreamMakerRights.SetDme))
|
||||
return Forbid();
|
||||
if (model.ProjectName.Length == 0)
|
||||
|
||||
if (model.ProjectName.Length == 0) // can't use isnullorwhitespace because linux memes
|
||||
hostModel.ProjectName = null;
|
||||
else
|
||||
hostModel.ProjectName = model.ProjectName;
|
||||
@@ -230,6 +232,7 @@ namespace Tgstation.Server.Host.Controllers
|
||||
{
|
||||
if (!dreamMakerRights.HasFlag(DreamMakerRights.SetSecurityLevel))
|
||||
return Forbid();
|
||||
|
||||
hostModel.ApiValidationSecurityLevel = model.ApiValidationSecurityLevel;
|
||||
}
|
||||
|
||||
@@ -237,6 +240,7 @@ namespace Tgstation.Server.Host.Controllers
|
||||
{
|
||||
if (!dreamMakerRights.HasFlag(DreamMakerRights.SetApiValidationRequirement))
|
||||
return Forbid();
|
||||
|
||||
hostModel.RequireDMApiValidation = model.RequireDMApiValidation;
|
||||
}
|
||||
|
||||
@@ -244,9 +248,22 @@ namespace Tgstation.Server.Host.Controllers
|
||||
{
|
||||
if (!dreamMakerRights.HasFlag(DreamMakerRights.SetTimeout))
|
||||
return Forbid();
|
||||
|
||||
hostModel.Timeout = model.Timeout;
|
||||
}
|
||||
|
||||
if (model.CompilerAdditionalArguments != null)
|
||||
{
|
||||
if (!dreamMakerRights.HasFlag(DreamMakerRights.SetCompilerArguments))
|
||||
return Forbid();
|
||||
|
||||
var sanitizedArguments = model.CompilerAdditionalArguments.Trim();
|
||||
if (sanitizedArguments.Length == 0)
|
||||
hostModel.CompilerAdditionalArguments = null;
|
||||
else
|
||||
hostModel.CompilerAdditionalArguments = sanitizedArguments;
|
||||
}
|
||||
|
||||
await DatabaseContext.Save(cancellationToken);
|
||||
|
||||
if (!dreamMakerRights.HasFlag(DreamMakerRights.Read))
|
||||
|
||||
@@ -740,6 +740,7 @@ namespace Tgstation.Server.Host.Controllers
|
||||
ApiValidationSecurityLevel = DreamDaemonSecurity.Safe,
|
||||
RequireDMApiValidation = true,
|
||||
Timeout = TimeSpan.FromHours(1),
|
||||
CompilerAdditionalArguments = null,
|
||||
},
|
||||
Name = initialSettings.Name,
|
||||
Online = false,
|
||||
|
||||
@@ -375,22 +375,22 @@ namespace Tgstation.Server.Host.Database
|
||||
/// <summary>
|
||||
/// Used by unit tests to remind us to setup the correct MSSQL migration downgrades.
|
||||
/// </summary>
|
||||
internal static readonly Type MSLatestMigration = typeof(MSAddMinidumpsOption);
|
||||
internal static readonly Type MSLatestMigration = typeof(MSAddCompilerAdditionalArguments);
|
||||
|
||||
/// <summary>
|
||||
/// Used by unit tests to remind us to setup the correct MYSQL migration downgrades.
|
||||
/// </summary>
|
||||
internal static readonly Type MYLatestMigration = typeof(MYAddMinidumpsOption);
|
||||
internal static readonly Type MYLatestMigration = typeof(MYAddCompilerAdditionalArguments);
|
||||
|
||||
/// <summary>
|
||||
/// Used by unit tests to remind us to setup the correct PostgresSQL migration downgrades.
|
||||
/// </summary>
|
||||
internal static readonly Type PGLatestMigration = typeof(PGAddMinidumpsOption);
|
||||
internal static readonly Type PGLatestMigration = typeof(PGAddCompilerAdditionalArguments);
|
||||
|
||||
/// <summary>
|
||||
/// Used by unit tests to remind us to setup the correct SQLite migration downgrades.
|
||||
/// </summary>
|
||||
internal static readonly Type SLLatestMigration = typeof(SLAddMinidumpsOption);
|
||||
internal static readonly Type SLLatestMigration = typeof(SLAddCompilerAdditionalArguments);
|
||||
|
||||
/// <inheritdoc />
|
||||
#pragma warning disable CA1502 // Cyclomatic complexity
|
||||
@@ -419,6 +419,16 @@ namespace Tgstation.Server.Host.Database
|
||||
|
||||
string BadDatabaseType() => throw new ArgumentException($"Invalid DatabaseType: {currentDatabaseType}", nameof(currentDatabaseType));
|
||||
|
||||
if (targetVersion < new Version(6, 5, 0))
|
||||
targetMigration = currentDatabaseType switch
|
||||
{
|
||||
DatabaseType.MySql => nameof(MYAddMinidumpsOption),
|
||||
DatabaseType.PostgresSql => nameof(PGAddMinidumpsOption),
|
||||
DatabaseType.SqlServer => nameof(MSAddMinidumpsOption),
|
||||
DatabaseType.Sqlite => nameof(SLAddMinidumpsOption),
|
||||
_ => BadDatabaseType(),
|
||||
};
|
||||
|
||||
if (targetVersion < new Version(6, 2, 0))
|
||||
targetMigration = currentDatabaseType switch
|
||||
{
|
||||
|
||||
Generated
+1150
File diff suppressed because it is too large
Load Diff
+175
@@ -0,0 +1,175 @@
|
||||
using System;
|
||||
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace Tgstation.Server.Host.Database.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class MYNormalizeVersionUpdates : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(migrationBuilder);
|
||||
|
||||
migrationBuilder.AlterColumn<long>(
|
||||
name: "Id",
|
||||
table: "Users",
|
||||
type: "bigint",
|
||||
nullable: false,
|
||||
oldClrType: typeof(long),
|
||||
oldType: "bigint")
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
migrationBuilder.AlterColumn<long>(
|
||||
name: "Id",
|
||||
table: "TestMerges",
|
||||
type: "bigint",
|
||||
nullable: false,
|
||||
oldClrType: typeof(long),
|
||||
oldType: "bigint")
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
migrationBuilder.AlterColumn<long>(
|
||||
name: "Id",
|
||||
table: "RevisionInformations",
|
||||
type: "bigint",
|
||||
nullable: false,
|
||||
oldClrType: typeof(long),
|
||||
oldType: "bigint")
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
migrationBuilder.AlterColumn<long>(
|
||||
name: "Id",
|
||||
table: "RevInfoTestMerges",
|
||||
type: "bigint",
|
||||
nullable: false,
|
||||
oldClrType: typeof(long),
|
||||
oldType: "bigint")
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
migrationBuilder.AlterColumn<long>(
|
||||
name: "Id",
|
||||
table: "RepositorySettings",
|
||||
type: "bigint",
|
||||
nullable: false,
|
||||
oldClrType: typeof(long),
|
||||
oldType: "bigint")
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
migrationBuilder.AlterColumn<long>(
|
||||
name: "Id",
|
||||
table: "ReattachInformations",
|
||||
type: "bigint",
|
||||
nullable: false,
|
||||
oldClrType: typeof(long),
|
||||
oldType: "bigint")
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
migrationBuilder.AlterColumn<long>(
|
||||
name: "Id",
|
||||
table: "PermissionSets",
|
||||
type: "bigint",
|
||||
nullable: false,
|
||||
oldClrType: typeof(long),
|
||||
oldType: "bigint")
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
migrationBuilder.AlterColumn<long>(
|
||||
name: "Id",
|
||||
table: "OAuthConnections",
|
||||
type: "bigint",
|
||||
nullable: false,
|
||||
oldClrType: typeof(long),
|
||||
oldType: "bigint")
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
migrationBuilder.AlterColumn<long>(
|
||||
name: "Id",
|
||||
table: "Jobs",
|
||||
type: "bigint",
|
||||
nullable: false,
|
||||
oldClrType: typeof(long),
|
||||
oldType: "bigint")
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
migrationBuilder.AlterColumn<long>(
|
||||
name: "Id",
|
||||
table: "Instances",
|
||||
type: "bigint",
|
||||
nullable: false,
|
||||
oldClrType: typeof(long),
|
||||
oldType: "bigint")
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
migrationBuilder.AlterColumn<long>(
|
||||
name: "Id",
|
||||
table: "InstancePermissionSets",
|
||||
type: "bigint",
|
||||
nullable: false,
|
||||
oldClrType: typeof(long),
|
||||
oldType: "bigint")
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
migrationBuilder.AlterColumn<long>(
|
||||
name: "Id",
|
||||
table: "Groups",
|
||||
type: "bigint",
|
||||
nullable: false,
|
||||
oldClrType: typeof(long),
|
||||
oldType: "bigint")
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
migrationBuilder.AlterColumn<long>(
|
||||
name: "Id",
|
||||
table: "DreamMakerSettings",
|
||||
type: "bigint",
|
||||
nullable: false,
|
||||
oldClrType: typeof(long),
|
||||
oldType: "bigint")
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
migrationBuilder.AlterColumn<long>(
|
||||
name: "Id",
|
||||
table: "DreamDaemonSettings",
|
||||
type: "bigint",
|
||||
nullable: false,
|
||||
oldClrType: typeof(long),
|
||||
oldType: "bigint")
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
migrationBuilder.AlterColumn<long>(
|
||||
name: "Id",
|
||||
table: "CompileJobs",
|
||||
type: "bigint",
|
||||
nullable: false,
|
||||
oldClrType: typeof(long),
|
||||
oldType: "bigint")
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
migrationBuilder.AlterColumn<long>(
|
||||
name: "Id",
|
||||
table: "ChatChannels",
|
||||
type: "bigint",
|
||||
nullable: false,
|
||||
oldClrType: typeof(long),
|
||||
oldType: "bigint")
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
migrationBuilder.AlterColumn<long>(
|
||||
name: "Id",
|
||||
table: "ChatBots",
|
||||
type: "bigint",
|
||||
nullable: false,
|
||||
oldClrType: typeof(long),
|
||||
oldType: "bigint")
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
+1084
File diff suppressed because it is too large
Load Diff
+33
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace Tgstation.Server.Host.Database.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class MSAddCompilerAdditionalArguments : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(migrationBuilder);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "CompilerAdditionalArguments",
|
||||
table: "DreamMakerSettings",
|
||||
type: "nvarchar(max)",
|
||||
maxLength: 10000,
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(migrationBuilder);
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CompilerAdditionalArguments",
|
||||
table: "DreamMakerSettings");
|
||||
}
|
||||
}
|
||||
}
|
||||
+1154
File diff suppressed because it is too large
Load Diff
+34
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace Tgstation.Server.Host.Database.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class MYAddCompilerAdditionalArguments : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(migrationBuilder);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "CompilerAdditionalArguments",
|
||||
table: "DreamMakerSettings",
|
||||
type: "varchar(10000)",
|
||||
maxLength: 10000,
|
||||
nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(migrationBuilder);
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CompilerAdditionalArguments",
|
||||
table: "DreamMakerSettings");
|
||||
}
|
||||
}
|
||||
}
|
||||
+1078
File diff suppressed because it is too large
Load Diff
+33
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace Tgstation.Server.Host.Database.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class PGAddCompilerAdditionalArguments : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(migrationBuilder);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "CompilerAdditionalArguments",
|
||||
table: "DreamMakerSettings",
|
||||
type: "character varying(10000)",
|
||||
maxLength: 10000,
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(migrationBuilder);
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CompilerAdditionalArguments",
|
||||
table: "DreamMakerSettings");
|
||||
}
|
||||
}
|
||||
}
|
||||
+1050
File diff suppressed because it is too large
Load Diff
+33
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace Tgstation.Server.Host.Database.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class SLAddCompilerAdditionalArguments : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(migrationBuilder);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "CompilerAdditionalArguments",
|
||||
table: "DreamMakerSettings",
|
||||
type: "TEXT",
|
||||
maxLength: 10000,
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(migrationBuilder);
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CompilerAdditionalArguments",
|
||||
table: "DreamMakerSettings");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,15 +13,19 @@ namespace Tgstation.Server.Host.Database.Migrations
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "8.0.1")
|
||||
.HasAnnotation("ProductVersion", "8.0.4")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||
|
||||
MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
|
||||
{
|
||||
b.Property<long?>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long?>("Id"));
|
||||
|
||||
b.Property<ushort?>("ChannelLimit")
|
||||
.IsRequired()
|
||||
.HasColumnType("smallint unsigned");
|
||||
@@ -65,6 +69,8 @@ namespace Tgstation.Server.Host.Database.Migrations
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long>("Id"));
|
||||
|
||||
b.Property<long>("ChatSettingsId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
@@ -116,6 +122,8 @@ namespace Tgstation.Server.Host.Database.Migrations
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long?>("Id"));
|
||||
|
||||
b.Property<int?>("DMApiMajorVersion")
|
||||
.HasColumnType("int");
|
||||
|
||||
@@ -185,6 +193,8 @@ namespace Tgstation.Server.Host.Database.Migrations
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long>("Id"));
|
||||
|
||||
b.Property<string>("AdditionalParameters")
|
||||
.IsRequired()
|
||||
.HasMaxLength(10000)
|
||||
@@ -259,6 +269,8 @@ namespace Tgstation.Server.Host.Database.Migrations
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long>("Id"));
|
||||
|
||||
b.Property<ushort?>("ApiValidationPort")
|
||||
.IsRequired()
|
||||
.HasColumnType("smallint unsigned");
|
||||
@@ -266,6 +278,10 @@ namespace Tgstation.Server.Host.Database.Migrations
|
||||
b.Property<int>("ApiValidationSecurityLevel")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("CompilerAdditionalArguments")
|
||||
.HasMaxLength(10000)
|
||||
.HasColumnType("varchar(10000)");
|
||||
|
||||
b.Property<long>("InstanceId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
@@ -297,6 +313,8 @@ namespace Tgstation.Server.Host.Database.Migrations
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long?>("Id"));
|
||||
|
||||
b.Property<uint?>("AutoUpdateInterval")
|
||||
.IsRequired()
|
||||
.HasColumnType("int unsigned");
|
||||
@@ -344,6 +362,8 @@ namespace Tgstation.Server.Host.Database.Migrations
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long>("Id"));
|
||||
|
||||
b.Property<ulong>("ChatBotRights")
|
||||
.HasColumnType("bigint unsigned");
|
||||
|
||||
@@ -387,6 +407,8 @@ namespace Tgstation.Server.Host.Database.Migrations
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long?>("Id"));
|
||||
|
||||
b.Property<ulong?>("CancelRight")
|
||||
.HasColumnType("bigint unsigned");
|
||||
|
||||
@@ -447,6 +469,8 @@ namespace Tgstation.Server.Host.Database.Migrations
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long>("Id"));
|
||||
|
||||
b.Property<string>("ExternalUserId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
@@ -476,6 +500,8 @@ namespace Tgstation.Server.Host.Database.Migrations
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long?>("Id"));
|
||||
|
||||
b.Property<ulong>("AdministrationRights")
|
||||
.HasColumnType("bigint unsigned");
|
||||
|
||||
@@ -505,6 +531,8 @@ namespace Tgstation.Server.Host.Database.Migrations
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long?>("Id"));
|
||||
|
||||
b.Property<string>("AccessIdentifier")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
@@ -550,6 +578,8 @@ namespace Tgstation.Server.Host.Database.Migrations
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long>("Id"));
|
||||
|
||||
b.Property<string>("AccessToken")
|
||||
.HasMaxLength(10000)
|
||||
.HasColumnType("longtext");
|
||||
@@ -621,6 +651,8 @@ namespace Tgstation.Server.Host.Database.Migrations
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long>("Id"));
|
||||
|
||||
b.Property<long>("RevisionInformationId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
@@ -642,6 +674,8 @@ namespace Tgstation.Server.Host.Database.Migrations
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long>("Id"));
|
||||
|
||||
b.Property<string>("CommitSha")
|
||||
.IsRequired()
|
||||
.HasMaxLength(40)
|
||||
@@ -676,6 +710,8 @@ namespace Tgstation.Server.Host.Database.Migrations
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long>("Id"));
|
||||
|
||||
b.Property<string>("Author")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
@@ -742,6 +778,8 @@ namespace Tgstation.Server.Host.Database.Migrations
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long?>("Id"));
|
||||
|
||||
b.Property<string>("CanonicalName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
@@ -805,6 +843,8 @@ namespace Tgstation.Server.Host.Database.Migrations
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long?>("Id"));
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
|
||||
+5
-1
@@ -13,7 +13,7 @@ namespace Tgstation.Server.Host.Database.Migrations
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "8.0.1")
|
||||
.HasAnnotation("ProductVersion", "8.0.4")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||
|
||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||
@@ -254,6 +254,10 @@ namespace Tgstation.Server.Host.Database.Migrations
|
||||
b.Property<int>("ApiValidationSecurityLevel")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("CompilerAdditionalArguments")
|
||||
.HasMaxLength(10000)
|
||||
.HasColumnType("character varying(10000)");
|
||||
|
||||
b.Property<long>("InstanceId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
|
||||
+5
-1
@@ -13,7 +13,7 @@ namespace Tgstation.Server.Host.Database.Migrations
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "8.0.1")
|
||||
.HasAnnotation("ProductVersion", "8.0.4")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
@@ -256,6 +256,10 @@ namespace Tgstation.Server.Host.Database.Migrations
|
||||
b.Property<int>("ApiValidationSecurityLevel")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("CompilerAdditionalArguments")
|
||||
.HasMaxLength(10000)
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<long>("InstanceId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Tgstation.Server.Host.Database.Migrations
|
||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "8.0.1");
|
||||
modelBuilder.HasAnnotation("ProductVersion", "8.0.4");
|
||||
|
||||
modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b =>
|
||||
{
|
||||
@@ -248,6 +248,10 @@ namespace Tgstation.Server.Host.Database.Migrations
|
||||
b.Property<int>("ApiValidationSecurityLevel")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("CompilerAdditionalArguments")
|
||||
.HasMaxLength(10000)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<long>("InstanceId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace Tgstation.Server.Host.Extensions
|
||||
/// Configures a given <paramref name="applicationBuilder"/>.
|
||||
/// </summary>
|
||||
/// <param name="applicationBuilder">The <see cref="IApplicationBuilder"/> to configure.</param>
|
||||
private static void ConfigureApplication(IApplicationBuilder applicationBuilder)
|
||||
static void ConfigureApplication(IApplicationBuilder applicationBuilder)
|
||||
=> applicationBuilder
|
||||
.ApplicationServices
|
||||
.GetRequiredService<Application>()
|
||||
|
||||
@@ -31,6 +31,7 @@ namespace Tgstation.Server.Host.Models
|
||||
ApiValidationSecurityLevel = ApiValidationSecurityLevel,
|
||||
RequireDMApiValidation = RequireDMApiValidation,
|
||||
Timeout = Timeout,
|
||||
CompilerAdditionalArguments = CompilerAdditionalArguments,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Tgstation.Server.Host.Models;
|
||||
|
||||
@@ -15,7 +16,8 @@ namespace Tgstation.Server.Host.Security
|
||||
/// <param name="user">The <see cref="User"/> the <paramref name="systemIdentity"/> belongs to.</param>
|
||||
/// <param name="systemIdentity">The <see cref="ISystemIdentity"/> to cache.</param>
|
||||
/// <param name="expiry">When the <paramref name="systemIdentity"/> should expire.</param>
|
||||
void CacheSystemIdentity(User user, ISystemIdentity systemIdentity, DateTimeOffset expiry);
|
||||
/// <returns>A <see cref="ValueTask"/> representing the running operation.</returns>
|
||||
ValueTask CacheSystemIdentity(User user, ISystemIdentity systemIdentity, DateTimeOffset expiry);
|
||||
|
||||
/// <summary>
|
||||
/// Attempt to load a cached <see cref="ISystemIdentity"/>.
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
using Tgstation.Server.Common.Extensions;
|
||||
using Tgstation.Server.Host.Models;
|
||||
using Tgstation.Server.Host.Utils;
|
||||
|
||||
namespace Tgstation.Server.Host.Security
|
||||
{
|
||||
/// <inheritdoc cref="IIdentityCache" />
|
||||
sealed class IdentityCache : IIdentityCache, IDisposable
|
||||
sealed class IdentityCache : IIdentityCache, IAsyncDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// The <see cref="IAsyncDelayer"/> for the <see cref="IdentityCache"/>.
|
||||
@@ -41,15 +43,14 @@ namespace Tgstation.Server.Host.Security
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Dispose()
|
||||
public ValueTask DisposeAsync()
|
||||
{
|
||||
logger.LogTrace("Disposing...");
|
||||
foreach (var cachedIdentity in cachedIdentities.Select(x => x.Value).ToList())
|
||||
cachedIdentity.Dispose();
|
||||
return ValueTaskExtensions.WhenAll(cachedIdentities.Select(x => x.Value.DisposeAsync()));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void CacheSystemIdentity(User user, ISystemIdentity systemIdentity, DateTimeOffset expiry)
|
||||
public async ValueTask CacheSystemIdentity(User user, ISystemIdentity systemIdentity, DateTimeOffset expiry)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(user);
|
||||
ArgumentNullException.ThrowIfNull(systemIdentity);
|
||||
@@ -57,27 +58,35 @@ namespace Tgstation.Server.Host.Security
|
||||
var uid = user.Require(x => x.Id);
|
||||
var sysId = systemIdentity.Uid;
|
||||
|
||||
lock (cachedIdentities)
|
||||
ValueTask oldIdentityDisposal = ValueTask.CompletedTask;
|
||||
try
|
||||
{
|
||||
logger.LogDebug("Caching system identity {sysId} of user {uid}", sysId, uid);
|
||||
|
||||
if (cachedIdentities.TryGetValue(uid, out var identCache))
|
||||
lock (cachedIdentities)
|
||||
{
|
||||
logger.LogTrace("Expiring previously cached identity...");
|
||||
identCache.Dispose(); // also clears it out
|
||||
}
|
||||
logger.LogDebug("Caching system identity {sysId} of user {uid}", sysId, uid);
|
||||
|
||||
identCache = new IdentityCacheObject(
|
||||
systemIdentity.Clone(),
|
||||
asyncDelayer,
|
||||
() =>
|
||||
if (cachedIdentities.TryGetValue(uid, out var identCache))
|
||||
{
|
||||
logger.LogDebug("Expiring system identity cache for user {uid}", uid);
|
||||
lock (cachedIdentities)
|
||||
cachedIdentities.Remove(uid);
|
||||
},
|
||||
expiry);
|
||||
cachedIdentities.Add(uid, identCache);
|
||||
logger.LogTrace("Expiring previously cached identity...");
|
||||
oldIdentityDisposal = identCache.DisposeAsync(); // also clears it out
|
||||
}
|
||||
|
||||
identCache = new IdentityCacheObject(
|
||||
systemIdentity.Clone(),
|
||||
asyncDelayer,
|
||||
() =>
|
||||
{
|
||||
logger.LogDebug("Expiring system identity cache for user {uid}", uid);
|
||||
lock (cachedIdentities)
|
||||
cachedIdentities.Remove(uid);
|
||||
},
|
||||
expiry);
|
||||
cachedIdentities.Add(uid, identCache);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
await oldIdentityDisposal;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace Tgstation.Server.Host.Security
|
||||
/// <summary>
|
||||
/// For keeping a specific <see cref="ISystemIdentity"/> alive for a period of time.
|
||||
/// </summary>
|
||||
sealed class IdentityCacheObject : IDisposable
|
||||
sealed class IdentityCacheObject : IAsyncDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// The <see cref="ISystemIdentity"/> the <see cref="IdentityCache"/> manages.
|
||||
@@ -53,6 +53,9 @@ namespace Tgstation.Server.Host.Security
|
||||
{
|
||||
await asyncDelayer.Delay(expiry - now, cancellationToken);
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
}
|
||||
finally
|
||||
{
|
||||
onExpiry();
|
||||
@@ -63,18 +66,11 @@ namespace Tgstation.Server.Host.Security
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Dispose()
|
||||
public async ValueTask DisposeAsync()
|
||||
{
|
||||
cancellationTokenSource.Cancel();
|
||||
try
|
||||
{
|
||||
task.GetAwaiter().GetResult();
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
}
|
||||
|
||||
cancellationTokenSource.Dispose();
|
||||
await task;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,29 +72,29 @@
|
||||
<!-- Usage: .env file parsing -->
|
||||
<PackageReference Include="DotEnv.Core" Version="3.0.0" />
|
||||
<!-- Usage: Text formatter for Elasticsearch logging plugin -->
|
||||
<PackageReference Include="Elastic.CommonSchema.Serilog" Version="8.6.1" />
|
||||
<PackageReference Include="Elastic.CommonSchema.Serilog" Version="8.11.0" />
|
||||
<!-- Usage: GitLab interop -->
|
||||
<PackageReference Include="GitLabApiClient" Version="1.8.0" />
|
||||
<!-- Usage: git interop -->
|
||||
<PackageReference Include="LibGit2Sharp" Version="0.29.0" />
|
||||
<PackageReference Include="LibGit2Sharp" Version="0.30.0" />
|
||||
<!-- Usage: JWT injection into HTTP pipeline -->
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.2" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.4" />
|
||||
<!-- Usage: Support ""legacy"" Newotonsoft.Json in HTTP pipeline. The rest of our codebase uses Newtonsoft. -->
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.2" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.4" />
|
||||
<!-- Usage: Using target JSON serializer for API -->
|
||||
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" Version="8.0.2" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" Version="8.0.4" />
|
||||
<!-- Usage: Generating dumps of dotnet engine processes -->
|
||||
<PackageReference Include="Microsoft.Diagnostics.NETCore.Client" Version="0.2.510501" />
|
||||
<!-- Usage: Database ORM -->
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.2" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.4" />
|
||||
<!-- Usage: Automatic migration generation using command line -->
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.2">
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.4">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<!-- Usage: Sqlite ORM plugin -->
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.2" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.4" />
|
||||
<!-- Usage: MSSQL ORM plugin -->
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.2" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.4" />
|
||||
<!-- Usage: POSIX support for syscalls, signals, and symlinks -->
|
||||
<PackageReference Include="Mono.Posix.NETStandard" Version="1.0.0" />
|
||||
<!-- Usage: YAML config plugin -->
|
||||
@@ -102,9 +102,9 @@
|
||||
<!-- Usage: PostgresSQL ORM plugin -->
|
||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.2" />
|
||||
<!-- Usage: GitHub.com interop -->
|
||||
<PackageReference Include="Octokit" Version="10.0.0" />
|
||||
<PackageReference Include="Octokit" Version="11.0.1" />
|
||||
<!-- Usage: MYSQL/MariaDB ORM plugin -->
|
||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="8.0.1" />
|
||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="8.0.2" />
|
||||
<!-- Usage: Discord interop -->
|
||||
<PackageReference Include="Remora.Discord" Version="2024.1.0" />
|
||||
<!-- Usage: Rich logger builder -->
|
||||
@@ -114,7 +114,7 @@
|
||||
<!-- Usage: Console logging plugin -->
|
||||
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.1" />
|
||||
<!-- Usage: Elasticsearch logging plugin -->
|
||||
<PackageReference Include="Serilog.Sinks.Elasticsearch" Version="9.0.3" />
|
||||
<PackageReference Include="Serilog.Sinks.Elasticsearch" Version="10.0.0" />
|
||||
<!-- Usage: File logging plugin -->
|
||||
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
|
||||
<!-- Usage: OpenAPI spec generator -->
|
||||
@@ -128,7 +128,7 @@
|
||||
<!-- Usage: Temporary resolution to compatibility issues with EFCore 7 and .NET 8 -->
|
||||
<PackageReference Include="System.Security.Permissions" Version="8.0.0" />
|
||||
<!-- Usage: .DeleteAsync() support for IQueryable<T>s -->
|
||||
<PackageReference Include="Z.EntityFramework.Plus.EFCore" Version="8.102.1.1" />
|
||||
<PackageReference Include="Z.EntityFramework.Plus.EFCore" Version="8.102.2.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Tgstation.Server.Host.Utils
|
||||
/// <summary>
|
||||
/// <see langword="class"/> to represent a ticket in the <see cref="ticketQueue"/> and whether or not it is <see cref="Abandoned"/>.
|
||||
/// </summary>
|
||||
class FifoSemaphoreTicket
|
||||
sealed class FifoSemaphoreTicket
|
||||
{
|
||||
/// <summary>
|
||||
/// Set if the wait operation on a <see cref="FifoSemaphore"/> was cancelled to avoid clogging the queue.
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Tgstation.Server.Host.Components.Repository.Tests
|
||||
[TestClass]
|
||||
public sealed class TestRepositoryFactory
|
||||
{
|
||||
static ILibGit2RepositoryFactory CreateFactory() => new LibGit2RepositoryFactory(Mock.Of<ILogger<LibGit2RepositoryFactory>>());
|
||||
static LibGit2RepositoryFactory CreateFactory() => new (Mock.Of<ILogger<LibGit2RepositoryFactory>>());
|
||||
|
||||
static async Task<LibGit2Sharp.IRepository> TestRepoLoading(
|
||||
string path,
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.2" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.4" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -125,17 +125,24 @@ namespace Tgstation.Server.Tests.Live.Instance
|
||||
{
|
||||
ProjectName = "tests/DMAPI/ApiFree/api_free",
|
||||
ApiValidationPort = dmPort,
|
||||
CompilerAdditionalArguments = " ",
|
||||
}, cancellationToken);
|
||||
Assert.AreEqual(dmPort, updatedDM.ApiValidationPort);
|
||||
Assert.AreEqual("tests/DMAPI/ApiFree/api_free", updatedDM.ProjectName);
|
||||
Assert.IsNull(updatedDM.CompilerAdditionalArguments);
|
||||
}
|
||||
else
|
||||
{
|
||||
var updatedDM = await dreamMakerClient.Update(new DreamMakerRequest
|
||||
{
|
||||
ApiValidationPort = dmPort
|
||||
ApiValidationPort = dmPort,
|
||||
CompilerAdditionalArguments = testEngine == EngineType.Byond ? " -DBABABOOEY" : " ",
|
||||
}, cancellationToken);
|
||||
Assert.AreEqual(dmPort, updatedDM.ApiValidationPort);
|
||||
if (testEngine == EngineType.Byond)
|
||||
Assert.AreEqual("-DBABABOOEY", updatedDM.CompilerAdditionalArguments);
|
||||
else
|
||||
Assert.IsNull(updatedDM.CompilerAdditionalArguments);
|
||||
}
|
||||
|
||||
Console.WriteLine($"PORT REUSE BUG 1: Setting I-{instanceClient.Metadata.Id} DD to {ddPort}");
|
||||
|
||||
@@ -46,6 +46,9 @@ namespace Tgstation.Server.Tests
|
||||
|
||||
const string StartSha = "af4da8beb9f9b374b04a3cc4d65acca662e8cc1a";
|
||||
await repo.CheckoutObject(StartSha, null, null, true, new JobProgressReporter(Mock.Of<ILogger<JobProgressReporter>>(), null, (stage, progress) => { }), CancellationToken.None);
|
||||
|
||||
Assert.AreEqual(Host.Components.Repository.Repository.NoReference, repo.Reference);
|
||||
|
||||
var result = await repo.CommittishIsParent("2f8588a3ca0f6b027704a2a04381215619de3412", CancellationToken.None);
|
||||
Assert.IsTrue(result);
|
||||
Assert.AreEqual(StartSha, repo.Head);
|
||||
|
||||
Reference in New Issue
Block a user