Merge branch 'master' into dev

This commit is contained in:
tgstation-server
2024-07-14 00:52:57 +00:00
4 changed files with 12 additions and 3 deletions
+1 -1
View File
@@ -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.7.1</TgsWebpanelVersion>
<TgsWebpanelVersion>5.8.0</TgsWebpanelVersion>
</PropertyGroup>
</Project>
@@ -860,6 +860,8 @@ namespace Tgstation.Server.Host.Controllers
IncludingSeconds = true,
}) == null))
return BadRequest(new ErrorMessageResponse(ErrorCode.ModelValidationFailure));
instance.AutoUpdateInterval = 0;
}
else
instance.AutoUpdateCron = String.Empty;
@@ -69,6 +69,7 @@ namespace Tgstation.Server.Host.Models
public InstanceResponse ToApi() => new()
{
AutoUpdateInterval = AutoUpdateInterval,
AutoUpdateCron = AutoUpdateCron,
ConfigurationType = ConfigurationType,
Id = Id,
Name = Name,
@@ -179,19 +179,25 @@ namespace Tgstation.Server.Tests.Live
}, cancellationToken), ErrorCode.ModelValidationFailure);
// regression check
await instanceManagerClient.Update(new InstanceUpdateRequest
var updated = await instanceManagerClient.Update(new InstanceUpdateRequest
{
Id = firstTest.Id,
AutoUpdateInterval = 9999,
}, cancellationToken);
Assert.AreEqual(String.Empty, updated.AutoUpdateCron);
Assert.AreEqual(9999U, updated.AutoUpdateInterval);
// check regular 6-part crons succeed
await instanceManagerClient.Update(new InstanceUpdateRequest
updated = await instanceManagerClient.Update(new InstanceUpdateRequest
{
Id = firstTest.Id,
AutoUpdateCron = "0 0 0 1 1 *"
}, cancellationToken);
Assert.AreEqual("0 0 0 1 1 *", updated.AutoUpdateCron);
Assert.AreEqual(0U, updated.AutoUpdateInterval);
//can't move online instance
await ApiAssert.ThrowsException<ConflictException, InstanceResponse>(() => instanceManagerClient.Update(new InstanceUpdateRequest
{