Skip to content

Commit

Permalink
Merge pull request #1813 from tgstation/v650 [TGSDeploy]
Browse files Browse the repository at this point in the history
v6.5.0
  • Loading branch information
Cyberboss authored Apr 21, 2024
2 parents aba366d + 281b506 commit 323a273
Show file tree
Hide file tree
Showing 57 changed files with 6,120 additions and 113 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/ci-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
38 changes: 22 additions & 16 deletions .github/workflows/scripts/rerunFlakyTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) {
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

[![forthebadge](http://forthebadge.com/images/badges/made-with-c-sharp.svg)](http://forthebadge.com) [![forinfinityandbyond](https://user-images.githubusercontent.com/5211576/29499758-4efff304-85e6-11e7-8267-62919c3688a9.gif)](https://www.reddit.com/r/SS13/comments/5oplxp/what_is_the_main_problem_with_byond_as_an_engine/dclbu1a) [![forthebadge](http://forthebadge.com/images/badges/built-with-love.svg)](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

Expand Down
6 changes: 3 additions & 3 deletions build/TestCommon.props
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>
12 changes: 6 additions & 6 deletions build/Version.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
<!-- 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>
<TgsMigratorVersion>2.0.0</TgsMigratorVersion>
<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>
Expand Down
2 changes: 1 addition & 1 deletion build/WebpanelVersion.props
Original file line number Diff line number Diff line change
@@ -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>
3 changes: 2 additions & 1 deletion build/package/deb/build_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 18 additions & 0 deletions build/package/deb/debian/man/tgs-configure.1
Original file line number Diff line number Diff line change
@@ -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 ([email protected])
11 changes: 11 additions & 0 deletions build/package/deb/debian/man/tgstation-server.7
Original file line number Diff line number Diff line change
@@ -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 ([email protected])
2 changes: 2 additions & 0 deletions build/package/deb/debian/manpages
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
debian/man/tgs-configure.1
debian/man/tgstation-server.7
9 changes: 7 additions & 2 deletions src/DMAPI/tgs.dm
Original file line number Diff line number Diff line change
@@ -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.

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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!")

Expand All @@ -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!")

Expand All @@ -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!")

Expand All @@ -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!")

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/DMAPI/tgs/LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/DMAPI/tgs/core/datum.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions src/DMAPI/tgs/core/tgs_version.dm
Original file line number Diff line number Diff line change
@@ -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, ".")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,12 @@ public abstract class DreamMakerSettings
/// </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; }
}
}
5 changes: 5 additions & 0 deletions src/Tgstation.Server.Api/Rights/DreamMakerRights.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,10 @@ public enum DreamMakerRights : ulong
/// 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,
}
}
2 changes: 1 addition & 1 deletion src/Tgstation.Server.Api/Tgstation.Server.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 -->
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.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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 -->
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.2",
"version": "8.0.4",
"commands": [
"dotnet-ef"
]
Expand Down
13 changes: 10 additions & 3 deletions src/Tgstation.Server.Host/Components/Deployment/DreamMaker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,7 @@ async ValueTask RunCompileJob(
progressReporter.StageName = "Copying repository";
var resolvedOutputDirectory = ioManager.ResolvePath(outputDirectory);
var repoOrigin = repository.Origin;
var repoReference = repository.Reference;
using (repository)
await repository.CopyTo(resolvedOutputDirectory, cancellationToken);

Expand All @@ -585,6 +586,7 @@ await eventConsumer.HandleEvent(
resolvedOutputDirectory,
repoOrigin.ToString(),
engineLock.Version.ToString(),
repoReference,
},
true,
cancellationToken);
Expand Down Expand Up @@ -630,7 +632,7 @@ await eventConsumer.HandleEvent(

// 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;
Expand Down Expand Up @@ -848,12 +850,17 @@ async ValueTask VerifyApi(
/// </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,
Expand Down
11 changes: 9 additions & 2 deletions src/Tgstation.Server.Host/Components/Engine/ByondInstallation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,14 @@ public override string FormatServerArguments(
}

/// <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))}\"";
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public string FormatServerArguments(
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)
Expand Down
Loading

0 comments on commit 323a273

Please sign in to comment.