Skip to content

Commit

Permalink
Merge branch 'dev' into WeCouldaHadVisThisWholeTime
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyberboss authored Oct 21, 2023
2 parents 740ce0b + c66890d commit 9807063
Show file tree
Hide file tree
Showing 246 changed files with 1,892 additions and 1,690 deletions.
13 changes: 9 additions & 4 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,16 @@ DO:
- Use CancellationTokens where possible
- Throw appropriate ArgumentExceptions for public functions
- Use nullable references approprately
- Prefer `ValueTask`s to `Task`s where possible.
- Return `Task` instead of `ValueTask` if all the callers would need to `.AsTask()` it.

DON'T:

- Use the private keyword
- Use the internal keyword
- Use the static keyword on fields where avoidable
- Use the public keyword where avoidable
- Handle Tasks in a synchronous fashion
- Handle `ValueTask`s/`Task`s in a synchronous fashion
- Use static methods from built-in keywords i.e. Use `Boolean.TryParse` instead of `bool.TryParse`

### Formatting
Expand Down Expand Up @@ -244,13 +246,15 @@ We use this attribute to ensure EFCore generated tables are not nullable for spe

## Versioning

The version format we use is 4.\<minor\>.\<patch\>. The first number never changes and TGS 1/2/3/4 are to be considered seperate products. The numbers that follow are the semver. The criteria for changing a version number is as follows
We follow [semantic versioning](https://semver.org) (Although TGS 1/2/3 are to be considered seperate products). The numbers that follow are the semver. The criteria for changing a version number is as follows

- Major: A change that requires direct host access to apply properly. Generally, these are updates to the dotnet runtime.
- Minor: A feature addition to the core server functionality.
- Patch: Patch changes.

Patch changes should be committed to the `master` branch if possible. These will be automatically merged into the `dev` branch.
All other changes should be made directly to the `dev` branch. These will be merged to `master` on the next minor release cycle.
All minor changes should be made directly to the `dev` branch. These will be merged to `master` on the next minor release cycle.
Major changes should be committed to the `VX` branch created when the time for a major release comes around.

We have several subcomponent APIs we ship with the core server that have their own versions.

Expand All @@ -261,7 +265,7 @@ We have several subcomponent APIs we ship with the core server that have their o
- Host Watchdog
- Web Control Panel

These are represent as standard [semver](https://semver.org/)s and don't affect the core version. The only stipulation is major changes to the HTTP and DreamMaker APIs or the configuration must coincide with a minor core version bump.
These don't affect the core version. The only stipulation is major changes to the HTTP and DreamMaker APIs or the configuration must coincide with a minor core version bump.

All versions are stored in the master file [build/Version.props](../build/Version.props). They are repeatedly defined in a few other places, but integration tests will make sure they are consistent.

Expand All @@ -271,6 +275,7 @@ The NuGet package Tgstation.Server.Client is another part of the suite which sho

- Consider Tgstation.Server.Client it's own product, perform major and minor bumps according to semver semantics including the Tgstation.Server.Api code (but not the version).
- Tgstation.Server.Api is a bit tricky as breaking code changes may occur without affecting the actual HTTP contract. For this reason, the library itself is versioned separately from the API contract.
- Tgstation.Server.Common is also versioned independently.

## Triage, Deployment, and Releasing

Expand Down
2 changes: 1 addition & 1 deletion build/ControlPanelVersion.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 -->
<TgsControlPanelVersion>4.25.2</TgsControlPanelVersion>
<TgsControlPanelVersion>4.25.5</TgsControlPanelVersion>
</PropertyGroup>
</Project>
4 changes: 2 additions & 2 deletions build/TestCommon.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<!-- Usage: Logging specific for GitHub actions -->
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.2">
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<!-- Usage: Hard to say what exactly this is for, but not including it removes the test icon and breaks vstest.console.exe for some reason -->
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<!-- Usage: Dependency mocking for tests -->
<!-- Pinned: Moq is OVER https://github.com/moq/moq/issues/1372 -->
<PackageReference Include="Moq" Version="4.20.2" />
Expand Down
6 changes: 3 additions & 3 deletions build/Version.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<TgsCoreVersion>5.16.2</TgsCoreVersion>
<TgsConfigVersion>4.7.1</TgsConfigVersion>
<TgsApiVersion>9.12.0</TgsApiVersion>
<TgsCommonLibraryVersion>6.0.1</TgsCommonLibraryVersion>
<TgsCommonLibraryVersion>7.0.0</TgsCommonLibraryVersion>
<TgsApiLibraryVersion>11.1.2</TgsApiLibraryVersion>
<TgsClientVersion>12.1.2</TgsClientVersion>
<TgsClientVersion>13.0.0</TgsClientVersion>
<TgsDmapiVersion>6.6.0</TgsDmapiVersion>
<TgsInteropVersion>5.6.2</TgsInteropVersion>
<TgsHostWatchdogVersion>1.4.0</TgsHostWatchdogVersion>
Expand All @@ -17,7 +17,7 @@
<TgsNugetNetFramework>netstandard2.0</TgsNugetNetFramework>
<TgsNetMajorVersion>6</TgsNetMajorVersion>
<!-- Update this frequently with dotnet runtime patches. MAJOR MUST MATCH ABOVE! -->
<TgsDotnetRedistUrl>https://dotnetcli.azureedge.net/dotnet/aspnetcore/Runtime/6.0.21/dotnet-hosting-6.0.21-win.exe</TgsDotnetRedistUrl>
<TgsDotnetRedistUrl>https://dotnetcli.azureedge.net/dotnet/aspnetcore/Runtime/6.0.23/dotnet-hosting-6.0.23-win.exe</TgsDotnetRedistUrl>
<TgsMariaDBRedistVersion>10.11.5</TgsMariaDBRedistVersion>
<!-- The two versions must match above, this is referenced by XML readers in scripts so we can't use an MSBuild property reference -->
<TgsMariaDBRedistUrl>https://ftp.osuosl.org/pub/mariadb//mariadb-10.11.5/winx64-packages/mariadb-10.11.5-winx64.msi</TgsMariaDBRedistUrl>
Expand Down
2 changes: 1 addition & 1 deletion build/package/winget/.config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"wix": {
"version": "4.0.1",
"version": "4.0.2",
"commands": [
"wix"
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="WixToolset.Sdk/4.0.1" xmlns:bal="http://schemas.microsoft.com/wix/BalExtension">
<Project Sdk="WixToolset.Sdk/4.0.2" xmlns:bal="http://schemas.microsoft.com/wix/BalExtension">
<Import Project="../../../Common.props" />
<PropertyGroup>
<DefineConstants>ProductVersion=$(TgsCoreVersion);NetMajorVersion=$(TgsNetMajorVersion);DotnetRedistUrl=$(TgsDotnetRedistUrl);MariaDBRedistUrl=$(TgsMariaDBRedistUrl)</DefineConstants>
Expand All @@ -24,10 +24,10 @@
<Content Include="Theme.xml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="WixToolset.Bal.wixext" Version="4.0.1" />
<PackageReference Include="WixToolset.Netfx.wixext" Version="4.0.1" />
<PackageReference Include="WixToolset.Bal.wixext" Version="4.0.2" />
<PackageReference Include="WixToolset.Netfx.wixext" Version="4.0.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Tgstation.Server.Host.Service.Wix\Tgstation.Server.Host.Service.Wix.wixproj" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="WixToolset.Dtf.CustomAction" Version="4.0.1" />
<PackageReference Include="WixToolset.Dtf.CustomAction" Version="4.0.2" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\..\src\Tgstation.Server.Host.Common\Tgstation.Server.Host.Common.csproj">
<Private>True</Private>
</ProjectReference>
</ItemGroup>

<ItemGroup>
<Content Include="CustomAction.config" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="WixToolset.Sdk/4.0.1">
<Project Sdk="WixToolset.Sdk/4.0.2">
<Import Project="../../../Common.props" />
<PropertyGroup>
<DefineConstants>ProductVersion=$(TgsCoreVersion)</DefineConstants>
Expand All @@ -25,8 +25,8 @@
</HarvestDirectory>
</ItemGroup>
<ItemGroup>
<PackageReference Include="WixToolset.Heat" Version="4.0.1" />
<PackageReference Include="WixToolset.Util.wixext" Version="4.0.1" />
<PackageReference Include="WixToolset.Heat" Version="4.0.2" />
<PackageReference Include="WixToolset.Util.wixext" Version="4.0.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Tgstation.Server.Host.Service.Wix.Extensions\Tgstation.Server.Host.Service.Wix.Extensions.csproj" />
Expand Down
10 changes: 5 additions & 5 deletions src/Tgstation.Server.Client/AdministrationClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ public AdministrationClient(IApiClient apiClient)
}

/// <inheritdoc />
public Task<AdministrationResponse> Read(CancellationToken cancellationToken) => ApiClient.Read<AdministrationResponse>(Routes.Administration, cancellationToken);
public ValueTask<AdministrationResponse> Read(CancellationToken cancellationToken) => ApiClient.Read<AdministrationResponse>(Routes.Administration, cancellationToken);

/// <inheritdoc />
public async Task<ServerUpdateResponse> Update(
public async ValueTask<ServerUpdateResponse> Update(
ServerUpdateRequest updateRequest,
Stream? zipFileStream,
CancellationToken cancellationToken)
Expand All @@ -50,14 +50,14 @@ public async Task<ServerUpdateResponse> Update(
}

/// <inheritdoc />
public Task Restart(CancellationToken cancellationToken) => ApiClient.Delete(Routes.Administration, cancellationToken);
public ValueTask Restart(CancellationToken cancellationToken) => ApiClient.Delete(Routes.Administration, cancellationToken);

/// <inheritdoc />
public Task<IReadOnlyList<LogFileResponse>> ListLogs(PaginationSettings? paginationSettings, CancellationToken cancellationToken)
public ValueTask<List<LogFileResponse>> ListLogs(PaginationSettings? paginationSettings, CancellationToken cancellationToken)
=> ReadPaged<LogFileResponse>(paginationSettings, Routes.Logs, null, cancellationToken);

/// <inheritdoc />
public async Task<Tuple<LogFileResponse, Stream>> GetLog(LogFileResponse logFile, CancellationToken cancellationToken)
public async ValueTask<Tuple<LogFileResponse, Stream>> GetLog(LogFileResponse logFile, CancellationToken cancellationToken)
{
var resultFile = await ApiClient.Read<LogFileResponse>(
Routes.Logs + Routes.SanitizeGetPath(
Expand Down
Loading

0 comments on commit 9807063

Please sign in to comment.