Skip to content

Commit

Permalink
Release v1.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
operate-services-sdk-bot committed Dec 9, 2024
1 parent ef644ac commit 9d208b2
Show file tree
Hide file tree
Showing 62 changed files with 1,267 additions and 929 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ All notable changes to UGS CLI will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [1.7.0] - 2024-11-25

### Fixed
- [Multiplay Hosting] Fixed issue with fleet usage settings being deleted if not provided in the update command.
- [CCD] Fixed issue with inconsistencies in paths when a customer uses more than one OS.

### Changed
- [Multiplay Hosting] Updated all docs, commands and prompts to use the term "Multiplay Hosting" instead of "Game Server Hosting" as per the new branding. Directories and file names have not been changed as they are not user-facing.
- [Lobby] Supports new `lobbyv2` configuration schema on all config related commands.

### Added
- [Triggers] Added filter support to service configs

## [1.6.0] - 2024-07-18

### Changed
Expand Down
37 changes: 6 additions & 31 deletions Samples/Deploy/Matchmaker/queue.mmq
Original file line number Diff line number Diff line change
Expand Up @@ -26,41 +26,16 @@
"teamRules": []
}
],
"matchRules": [
{
"source": "Players.ExternalData.CloudSave.Skill",
"name": "skill-diff",
"type": "Difference",
"reference": 500,
"overlap": 0.0,
"enableRule": false,
"not": false,
"relaxations": []
},
{
"source": "Players.QosResults.Latency",
"name": "QoS",
"type": "LessThanEqual",
"reference": 100,
"overlap": 0.0,
"enableRule": false,
"not": false,
"relaxations": [
{
"type": "ReferenceControl.Replace",
"ageType": "Oldest",
"atSeconds": 30.0,
"value": 200
}
]
}
]
"matchRules": []
},
"name": "Default Pool Rules",
"name": "Rules",
"backfillEnabled": false
},
"matchHosting": {
"type": "MatchId",
"type": "Multiplay",
"fleetName" : "my fleet",
"buildConfigurationName" : "my build configuration",
"defaultQoSRegionName" : "North America"
}
},
"filteredPools": []
Expand Down
7 changes: 7 additions & 0 deletions Samples/Deploy/Triggers/my-triggers.tr
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@
"EventType": "EventType2",
"ActionType": "cloud-code",
"ActionUrn": "urn:ugs:cloud-code:MyModule/MyFunction"
},
{
"Name": "Trigger 3",
"EventType": "EventType3",
"ActionType": "cloud-code",
"ActionUrn": "urn:ugs:cloud-code:MyModule/MyFunction",
"Filter": "data['leaderboardId] == 'some-leaderboard-id'"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@ public static class GameServerHostingUnitTestsConstants
// Fleet specific constants
public const string ValidFleetId = "00000000-0000-0000-1000-000000000000";
public const string ValidFleetId2 = "00000000-0000-0000-1100-000000000000";
public const string ValidFleetId3 = "00000000-0000-0000-3300-000000000000";

public const string InvalidFleetId = "00000000-0000-0000-2222-000000000000";

public const string ValidFleetName = "Fleet One";
public const string ValidFleetName2 = "Fleet Two";
public const string ValidFleetName3 = "Fleet Three";

public const string OsNameLinux = "Linux";
public const string OsNameFullNameLinux = "Ubuntu (Server) 22.04 LTS";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Newtonsoft.Json;
using Spectre.Console;
using Unity.Services.Cli.Common.Console;
using Unity.Services.Cli.Common.Exceptions;
using Unity.Services.Cli.Common.Logging;
using Unity.Services.Cli.GameServerHosting.Exceptions;
using Unity.Services.Cli.GameServerHosting.Handlers;
Expand Down Expand Up @@ -86,6 +87,44 @@ string fleetId
TestsHelper.VerifyLoggerWasCalled(MockLogger!, LogLevel.Critical, LoggerExtension.ResultEventId, Times.Never);
}

[TestCase(ValidProjectId, ValidEnvironmentName, ValidFleetId3)]
public void FleetUpdateAsync_NullFleetUsageSettingsThrowsException(
string projectId,
string environmentName,
string fleetId
)
{
FleetUpdateInput input = new()
{
CloudProjectId = projectId,
TargetEnvironmentName = environmentName,
FleetId = fleetId,
Name = ValidFleetName,
AllocTtl = 0,
DeleteTtl = 0,
BuildConfigs = new List<long>() { 1 },
DisabledDeleteTtl = 0,
ShutdownTtl = 0,
};

Assert.ThrowsAsync<CliException>(() =>
FleetUpdateHandler.FleetUpdateAsync(
input,
MockUnityEnvironment.Object,
GameServerHostingService!,
MockLogger!.Object,
CancellationToken.None
)
);

FleetsApi!.DefaultFleetsClient.Verify(api => api.UpdateFleetAsync(
It.IsAny<Guid>(), It.IsAny<Guid>(),
It.IsAny<Guid>(), null, 0, CancellationToken.None
), Times.Never);

TestsHelper.VerifyLoggerWasCalled(MockLogger!, LogLevel.Critical, LoggerExtension.ResultEventId, Times.Never);
}

[TestCase(ValidProjectId, ValidEnvironmentName, ValidFleetId)]
public async Task FleetUpdateAsync_CallsUpdateService(
string projectId,
Expand Down Expand Up @@ -153,7 +192,9 @@ await FleetUpdateHandler.FleetUpdateAsync(
CancellationToken.None
);

FleetUpdateRequest expected = new FleetUpdateRequest(name: input.Name, buildConfigurations: input.BuildConfigs);
var usageSetting = JsonConvert.DeserializeObject<FleetUsageSetting>(ValidUsageSettingsJson);

FleetUpdateRequest expected = new FleetUpdateRequest(name: input.Name, buildConfigurations: input.BuildConfigs, usageSettings: new List<FleetUsageSetting> { usageSetting! });

FleetsApi!.DefaultFleetsClient.Verify(api => api.UpdateFleetAsync(
new Guid(input.CloudProjectId), new Guid(ValidEnvironmentId),
Expand Down Expand Up @@ -224,8 +265,10 @@ await FleetUpdateHandler.FleetUpdateAsync(
CancellationToken.None
);

var usageSetting = JsonConvert.DeserializeObject<FleetUsageSetting>(ValidUsageSettingsJson);

FleetUpdateRequest expected =
new FleetUpdateRequest(name: ValidFleetName, buildConfigurations: new List<long>() { 1 });
new FleetUpdateRequest(name: ValidFleetName, buildConfigurations: new List<long>() { 1 }, usageSettings: new List<FleetUsageSetting> { usageSetting! });

FleetsApi!.DefaultFleetsClient.Verify(api => api.UpdateFleetAsync(
new Guid(input.CloudProjectId), new Guid(ValidEnvironmentId),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,17 @@ class GameServerHostingFleetsApiV1Mock
)
};

static readonly List<FleetUsageSetting> k_TestFleetUsageSettings = new()
{
new FleetUsageSetting(
fleetUsageID: 0L,
hardwareType: FleetUsageSetting.HardwareTypeEnum.CLOUD,
machineType: "GCP-N2",
maxServersPerMachine: 5L,
memory: 0L,
speed: 0L)
};

static readonly List<Fleet> k_TestFleets = new()
{
new Fleet(
Expand All @@ -80,7 +91,8 @@ class GameServerHostingFleetsApiV1Mock
allocationTTL: 10,
deleteTTL: 20,
disabledDeleteTTL: 25,
shutdownTTL: 30
shutdownTTL: 30,
usageSettings: k_TestFleetUsageSettings
),
new Fleet(
buildConfigurations: new List<BuildConfiguration2>(),
Expand All @@ -96,6 +108,23 @@ class GameServerHostingFleetsApiV1Mock
allocationTTL: 1,
deleteTTL: 2,
disabledDeleteTTL: 3,
shutdownTTL: 4,
usageSettings: k_TestFleetUsageSettings
),
new Fleet(
buildConfigurations: new List<BuildConfiguration2>(),
graceful: false,
fleetRegions: new List<FleetRegion1>(),
id: new Guid(ValidFleetId3),
name: ValidFleetName3,
osFamily: Fleet.OsFamilyEnum.LINUX,
osName: OsNameLinux,
servers: new Servers(new FleetServerBreakdown(new ServerStatus()),
new FleetServerBreakdown(new ServerStatus()), new FleetServerBreakdown(new ServerStatus())),
status: Fleet.StatusEnum.ONLINE,
allocationTTL: 1,
deleteTTL: 2,
disabledDeleteTTL: 3,
shutdownTTL: 4
)
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ namespace Unity.Services.Cli.GameServerHosting.Exceptions;
public class InvalidConfigException : CliException
{
public InvalidConfigException(string path)
: base($"Game Server Hosting Config file is invalid. See output for details: {path}", Common.Exceptions.ExitCode.HandledError) { }
: base($"Multiplay Hosting Config file is invalid. See output for details: {path}", Common.Exceptions.ExitCode.HandledError) { }
}
Loading

0 comments on commit 9d208b2

Please sign in to comment.