diff --git a/src/Tgstation.Server.Api/ApiHeaders.cs b/src/Tgstation.Server.Api/ApiHeaders.cs
index 01e61cb373..fad13a0330 100644
--- a/src/Tgstation.Server.Api/ApiHeaders.cs
+++ b/src/Tgstation.Server.Api/ApiHeaders.cs
@@ -287,9 +287,7 @@ namespace Tgstation.Server.Api
try
{
-#pragma warning disable CS0618 // Type or member is obsolete
- Token.ExpiresAt = Token.ParseJwt().ValidTo;
-#pragma warning restore CS0618 // Type or member is obsolete
+ Token.ParseJwt();
}
catch (ArgumentException ex) when (ex is not ArgumentNullException)
{
diff --git a/src/Tgstation.Server.Api/Models/ChatChannel.cs b/src/Tgstation.Server.Api/Models/ChatChannel.cs
index 07b643fcab..3192603e2b 100644
--- a/src/Tgstation.Server.Api/Models/ChatChannel.cs
+++ b/src/Tgstation.Server.Api/Models/ChatChannel.cs
@@ -1,5 +1,4 @@
-using System;
-using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations;
using Tgstation.Server.Api.Models.Internal;
@@ -11,28 +10,12 @@ namespace Tgstation.Server.Api.Models
public class ChatChannel : ChatChannelBase
{
///
- /// The channel identifier. Supercedes and .
+ /// The channel identifier.
/// For , it's the IRC channel name and optional password colon separated.
/// For , it's the stringified Discord channel snowflake.
///
[Required]
[StringLength(Limits.MaximumIndexableStringLength, MinimumLength = 1)]
public string? ChannelData { get; set; }
-
- ///
- /// The IRC channel name. Also potentially contains the channel passsword (if separated by a colon).
- /// If multiple copies of the same channel with different keys are added to the server, the one that will be used is undefined.
- ///
- [ResponseOptions]
- [StringLength(Limits.MaximumIndexableStringLength, MinimumLength = 1)]
- [Obsolete($"Use {nameof(ChannelData)}")]
- public string? IrcChannel { get; set; }
-
- ///
- /// The Discord channel ID.
- ///
- [Obsolete($"Use {nameof(ChannelData)}")]
- [ResponseOptions]
- public ulong? DiscordChannelId { get; set; }
}
}
diff --git a/src/Tgstation.Server.Api/Models/Internal/ChatBotApiBase.cs b/src/Tgstation.Server.Api/Models/Internal/ChatBotApiBase.cs
index 231a94ffbe..e490c8e5fb 100644
--- a/src/Tgstation.Server.Api/Models/Internal/ChatBotApiBase.cs
+++ b/src/Tgstation.Server.Api/Models/Internal/ChatBotApiBase.cs
@@ -22,10 +22,8 @@ namespace Tgstation.Server.Api.Models.Internal
return true;
return Provider.Value switch
{
-#pragma warning disable CS0618
- ChatProvider.Discord => Channels?.Select(x => (x.DiscordChannelId.HasValue || ulong.TryParse(x.ChannelData, out _)) && x.IrcChannel == null).All(x => x) ?? true,
- ChatProvider.Irc => Channels?.Select(x => !x.DiscordChannelId.HasValue && (x.IrcChannel != null || x.ChannelData != null)).All(x => x) ?? true,
-#pragma warning restore CS0618
+ ChatProvider.Discord => Channels?.All(x => UInt64.TryParse(x.ChannelData, out _)) ?? true,
+ ChatProvider.Irc => Channels?.All(x => x.ChannelData != null && x.ChannelData[0] == '#') ?? true,
_ => throw new InvalidOperationException("Invalid provider type!"),
};
}
diff --git a/src/Tgstation.Server.Api/Models/Internal/DreamDaemonApiBase.cs b/src/Tgstation.Server.Api/Models/Internal/DreamDaemonApiBase.cs
index 50de44e64b..6afac0db9a 100644
--- a/src/Tgstation.Server.Api/Models/Internal/DreamDaemonApiBase.cs
+++ b/src/Tgstation.Server.Api/Models/Internal/DreamDaemonApiBase.cs
@@ -1,7 +1,4 @@
-using System;
-using System.ComponentModel.DataAnnotations;
-
-namespace Tgstation.Server.Api.Models.Internal
+namespace Tgstation.Server.Api.Models.Internal
{
///
/// Base class for DreamDaemon API models.
@@ -19,21 +16,5 @@ namespace Tgstation.Server.Api.Models.Internal
///
[ResponseOptions]
public bool? SoftShutdown { get; set; }
-
- ///
- /// Deprecated, use .
- ///
- [Required]
- [ResponseOptions]
- [Obsolete("Use HealthCheckSeconds")]
- public uint? HeartbeatSeconds { get; set; }
-
- ///
- /// Deprecated, use .
- ///
- [Required]
- [ResponseOptions]
- [Obsolete("Use DumpOnHealthCheckRestart")]
- public bool? DumpOnHeartbeatRestart { get; set; }
}
}
diff --git a/src/Tgstation.Server.Api/Models/Request/RepositoryCreateRequest.cs b/src/Tgstation.Server.Api/Models/Request/RepositoryCreateRequest.cs
index dded782d64..a29ba1b674 100644
--- a/src/Tgstation.Server.Api/Models/Request/RepositoryCreateRequest.cs
+++ b/src/Tgstation.Server.Api/Models/Request/RepositoryCreateRequest.cs
@@ -14,11 +14,5 @@ namespace Tgstation.Server.Api.Models.Request
///
[RequestOptions(FieldPresence.Required)]
public Uri? Origin { get; set; }
-
- ///
- /// If submodules should be recursively cloned. Note that further updates are not recursive.
- ///
- [Obsolete("Use updateSubmodules instead.")]
- public bool? RecurseSubmodules { get; set; }
}
}
diff --git a/src/Tgstation.Server.Api/Models/Response/TokenResponse.cs b/src/Tgstation.Server.Api/Models/Response/TokenResponse.cs
index 8f7b01762b..c3908e9518 100644
--- a/src/Tgstation.Server.Api/Models/Response/TokenResponse.cs
+++ b/src/Tgstation.Server.Api/Models/Response/TokenResponse.cs
@@ -1,6 +1,4 @@
-using System;
-
-using Microsoft.IdentityModel.JsonWebTokens;
+using Microsoft.IdentityModel.JsonWebTokens;
namespace Tgstation.Server.Api.Models.Response
{
@@ -14,12 +12,6 @@ namespace Tgstation.Server.Api.Models.Response
///
public string? Bearer { get; set; }
- ///
- /// When the expires.
- ///
- [Obsolete("Will be removed in a future API version")]
- public DateTimeOffset? ExpiresAt { get; set; }
-
///
/// Parses the as a .
///
diff --git a/src/Tgstation.Server.Host/Controllers/ChatController.cs b/src/Tgstation.Server.Host/Controllers/ChatController.cs
index 7f9682c43a..967971eb24 100644
--- a/src/Tgstation.Server.Host/Controllers/ChatController.cs
+++ b/src/Tgstation.Server.Host/Controllers/ChatController.cs
@@ -69,10 +69,6 @@ namespace Tgstation.Server.Host.Controllers
{
var result = new Models.ChatChannel
{
-#pragma warning disable CS0618
- DiscordChannelId = api.DiscordChannelId,
- IrcChannel = api.IrcChannel,
-#pragma warning restore CS0618
IsAdminChannel = api.IsAdminChannel ?? false,
IsWatchdogChannel = api.IsWatchdogChannel ?? false,
IsUpdatesChannel = api.IsUpdatesChannel ?? false,
diff --git a/src/Tgstation.Server.Host/Controllers/DreamDaemonController.cs b/src/Tgstation.Server.Host/Controllers/DreamDaemonController.cs
index 8e57d022c5..24747e2fee 100644
--- a/src/Tgstation.Server.Host/Controllers/DreamDaemonController.cs
+++ b/src/Tgstation.Server.Host/Controllers/DreamDaemonController.cs
@@ -184,14 +184,6 @@ namespace Tgstation.Server.Host.Controllers
return Conflict(new ErrorMessageResponse(ErrorCode.PortNotAvailable));
}
-#pragma warning disable CS0618 // Type or member is obsolete
- if (model.HeartbeatSeconds.HasValue && !model.HealthCheckSeconds.HasValue)
- model.HealthCheckSeconds = model.HeartbeatSeconds;
-
- if (model.DumpOnHeartbeatRestart.HasValue && !model.DumpOnHealthCheckRestart.HasValue)
- model.DumpOnHealthCheckRestart = model.DumpOnHeartbeatRestart;
-#pragma warning restore CS0618 // Type or member is obsolete
-
var userRights = (DreamDaemonRights)AuthenticationContext.GetRight(RightsType.DreamDaemon);
bool CheckModified(Expression> expression, DreamDaemonRights requiredRight)
@@ -356,10 +348,6 @@ namespace Tgstation.Server.Host.Controllers
result.StartupTimeout = settings.StartupTimeout.Value;
result.HealthCheckSeconds = settings.HealthCheckSeconds.Value;
result.DumpOnHealthCheckRestart = settings.DumpOnHealthCheckRestart.Value;
-#pragma warning disable CS0618 // Type or member is obsolete
- result.HeartbeatSeconds = settings.HealthCheckSeconds.Value;
- result.DumpOnHeartbeatRestart = settings.DumpOnHealthCheckRestart.Value;
-#pragma warning restore CS0618 // Type or member is obsolete
result.TopicRequestTimeout = settings.TopicRequestTimeout.Value;
result.AdditionalParameters = settings.AdditionalParameters;
result.StartProfiler = settings.StartProfiler;
diff --git a/src/Tgstation.Server.Host/Controllers/RepositoryController.cs b/src/Tgstation.Server.Host/Controllers/RepositoryController.cs
index 37766ce0fd..6bc447a044 100644
--- a/src/Tgstation.Server.Host/Controllers/RepositoryController.cs
+++ b/src/Tgstation.Server.Host/Controllers/RepositoryController.cs
@@ -99,10 +99,6 @@ namespace Tgstation.Server.Host.Controllers
|| ((model.CommitterEmail ?? model.CommitterName) != null && !userRights.HasFlag(RepositoryRights.ChangeCommitter)))
return Forbid();
- #pragma warning disable CS0618 // Support for obsolete API field
- model.UpdateSubmodules ??= model.RecurseSubmodules;
- #pragma warning restore CS0618
-
var currentModel = await DatabaseContext
.RepositorySettings
.AsQueryable()
diff --git a/src/Tgstation.Server.Host/Models/ChatChannel.cs b/src/Tgstation.Server.Host/Models/ChatChannel.cs
index 8519ffffdb..a4cbea0952 100644
--- a/src/Tgstation.Server.Host/Models/ChatChannel.cs
+++ b/src/Tgstation.Server.Host/Models/ChatChannel.cs
@@ -20,13 +20,13 @@ namespace Tgstation.Server.Host.Models
public long ChatSettingsId { get; set; }
///
- /// See .
+ /// The IRC channel name.
///
[StringLength(Limits.MaximumIndexableStringLength, MinimumLength = 1)]
public string IrcChannel { get; set; }
///
- /// See .
+ /// The Discord channel snowflake.
///
public ulong? DiscordChannelId { get; set; }
@@ -43,10 +43,6 @@ namespace Tgstation.Server.Host.Models
public Api.Models.ChatChannel ToApi(ChatProvider chatProvider) => new Api.Models.ChatChannel
{
ChannelData = chatProvider == ChatProvider.Discord ? DiscordChannelId.Value.ToString(CultureInfo.InvariantCulture) : IrcChannel,
-#pragma warning disable CS0618
- IrcChannel = IrcChannel,
- DiscordChannelId = DiscordChannelId,
-#pragma warning restore CS0618
IsAdminChannel = IsAdminChannel,
IsWatchdogChannel = IsWatchdogChannel,
IsUpdatesChannel = IsUpdatesChannel,
diff --git a/src/Tgstation.Server.Host/Security/TokenFactory.cs b/src/Tgstation.Server.Host/Security/TokenFactory.cs
index c45a282e2a..cc18c3298a 100644
--- a/src/Tgstation.Server.Host/Security/TokenFactory.cs
+++ b/src/Tgstation.Server.Host/Security/TokenFactory.cs
@@ -119,13 +119,10 @@ namespace Tgstation.Server.Host.Security
expiry.UtcDateTime,
now.UtcDateTime));
-#pragma warning disable CS0618 // Type or member is obsolete
var tokenResponse = new TokenResponse
{
Bearer = tokenHandler.WriteToken(securityToken),
- ExpiresAt = expiry,
};
-#pragma warning restore CS0618 // Type or member is obsolete
return tokenResponse;
}
diff --git a/tests/Tgstation.Server.Tests/Live/Instance/ChatTest.cs b/tests/Tgstation.Server.Tests/Live/Instance/ChatTest.cs
index 3162ceb588..0963b72b4f 100644
--- a/tests/Tgstation.Server.Tests/Live/Instance/ChatTest.cs
+++ b/tests/Tgstation.Server.Tests/Live/Instance/ChatTest.cs
@@ -122,9 +122,6 @@ namespace Tgstation.Server.Tests.Live.Instance
IsSystemChannel = true,
Tag = "butt2",
ChannelData = channelId,
-#pragma warning disable CS0618
- IrcChannel = "should_not_be_this!!!JHF*WW(#*(*$&(#*@))("
-#pragma warning restore CS0618
}
}
}, cancellationToken);
@@ -137,10 +134,6 @@ namespace Tgstation.Server.Tests.Live.Instance
Assert.AreEqual(true, updatedBot.Channels.First().IsUpdatesChannel);
Assert.AreEqual(true, updatedBot.Channels.First().IsWatchdogChannel);
Assert.AreEqual("butt2", updatedBot.Channels.First().Tag);
-#pragma warning disable CS0618
- Assert.AreEqual(channelId, updatedBot.Channels.First().IrcChannel);
- Assert.IsNull(updatedBot.Channels.First().DiscordChannelId);
-#pragma warning restore CS0618
Assert.AreEqual(channelId, updatedBot.Channels.First().ChannelData);
}
@@ -224,9 +217,6 @@ namespace Tgstation.Server.Tests.Live.Instance
IsSystemChannel = true,
Tag = "butt",
ChannelData = channelId.ToString(),
-#pragma warning disable CS0618
- DiscordChannelId = 1234,
-#pragma warning restore CS0618
}
}
}, cancellationToken);
@@ -239,10 +229,6 @@ namespace Tgstation.Server.Tests.Live.Instance
Assert.AreEqual(true, updatedBot.Channels.First().IsUpdatesChannel);
Assert.AreEqual(true, updatedBot.Channels.First().IsWatchdogChannel);
Assert.AreEqual("butt", updatedBot.Channels.First().Tag);
-#pragma warning disable CS0618
- Assert.AreEqual(channelId, updatedBot.Channels.First().DiscordChannelId);
- Assert.IsNull(updatedBot.Channels.First().IrcChannel);
-#pragma warning restore CS0618
Assert.AreEqual(channelId.ToString(), updatedBot.Channels.First().ChannelData);
}
diff --git a/tests/Tgstation.Server.Tests/Live/Instance/WatchdogTest.cs b/tests/Tgstation.Server.Tests/Live/Instance/WatchdogTest.cs
index 4eaca9ab59..97c629b0bc 100644
--- a/tests/Tgstation.Server.Tests/Live/Instance/WatchdogTest.cs
+++ b/tests/Tgstation.Server.Tests/Live/Instance/WatchdogTest.cs
@@ -617,24 +617,20 @@ namespace Tgstation.Server.Tests.Live.Instance
async Task RunHealthCheckTest(bool checkDump, CancellationToken cancellationToken)
{
System.Console.WriteLine("TEST: WATCHDOG HEALTH CHECK TEST");
-#pragma warning disable CS0618 // Type or member is obsolete
+
// Check reverse mapping
var status = await instanceClient.DreamDaemon.Update(new DreamDaemonRequest
{
DumpOnHealthCheckRestart = !checkDump,
}, cancellationToken);
- Assert.AreEqual(!checkDump, status.DumpOnHeartbeatRestart);
-
// enable health checks
status = await instanceClient.DreamDaemon.Update(new DreamDaemonRequest
{
HealthCheckSeconds = 1,
- DumpOnHeartbeatRestart = checkDump,
+ DumpOnHealthCheckRestart = checkDump,
}, cancellationToken);
- Assert.AreEqual(checkDump, status.DumpOnHeartbeatRestart);
-#pragma warning restore CS0618 // Type or member is obsolete
Assert.AreEqual(checkDump, status.DumpOnHealthCheckRestart);
var startJob = await StartDD(cancellationToken);
@@ -692,8 +688,6 @@ namespace Tgstation.Server.Tests.Live.Instance
await Task.Delay(TimeSpan.FromSeconds(1), cancellationToken);
ddStatus = await instanceClient.DreamDaemon.Read(cancellationToken);
Assert.AreEqual(1U, ddStatus.HealthCheckSeconds.Value);
-#pragma warning disable CS0618 // Type or member is obsolete
- Assert.AreEqual(1U, ddStatus.HeartbeatSeconds.Value);
if (ddStatus.Status.Value == WatchdogStatus.Offline)
{
await CheckDMApiFail(ddStatus.ActiveCompileJob, cancellationToken);
@@ -708,11 +702,9 @@ namespace Tgstation.Server.Tests.Live.Instance
// disable health checks
ddStatus = await instanceClient.DreamDaemon.Update(new DreamDaemonRequest
{
- HeartbeatSeconds = 0,
+ HealthCheckSeconds = 0,
}, cancellationToken);
Assert.AreEqual(0U, ddStatus.HealthCheckSeconds.Value);
- Assert.AreEqual(0U, ddStatus.HeartbeatSeconds.Value);
-#pragma warning restore CS0618 // Type or member is obsolete
if (checkDump)
{
diff --git a/tests/Tgstation.Server.Tests/Live/RawRequestTests.cs b/tests/Tgstation.Server.Tests/Live/RawRequestTests.cs
index 50e9b21169..3e20609e60 100644
--- a/tests/Tgstation.Server.Tests/Live/RawRequestTests.cs
+++ b/tests/Tgstation.Server.Tests/Live/RawRequestTests.cs
@@ -210,13 +210,10 @@ namespace Tgstation.Server.Tests.Live
Assert.AreEqual(RuntimeInformation.IsOSPlatform(OSPlatform.Windows), serverInfo.WindowsHost);
//check that modifying the token even slightly fucks up the auth
-#pragma warning disable CS0618 // Type or member is obsolete
var newToken = new TokenResponse
{
- ExpiresAt = serverClient.Token.ExpiresAt,
Bearer = serverClient.Token.Bearer + '0'
};
-#pragma warning restore CS0618 // Type or member is obsolete
var badClient = clientFactory.CreateFromToken(serverClient.Url, newToken);
await ApiAssert.ThrowsException(() => badClient.Administration.Read(cancellationToken));