Skip to content

Commit

Permalink
Release v1.0.0-beta.5
Browse files Browse the repository at this point in the history
  • Loading branch information
operate-services-sdk-bot committed Jun 28, 2023
1 parent 71db5ff commit bf5bcdc
Show file tree
Hide file tree
Showing 328 changed files with 11,951 additions and 2,436 deletions.
31 changes: 31 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,34 @@ resharper_place_attribute_on_same_line = false
# dotnet options
#dotnet_sort_system_directives_first = true
#dotnet_separate_import_directive_groups = false

# dotnet field naming rules
dotnet_naming_rule.private_constants_rule.severity = error
dotnet_naming_rule.private_constants_rule.style = k_upper_camel_case_style
dotnet_naming_rule.private_constants_rule.symbols = private_constants_symbols
dotnet_naming_rule.private_instance_fields_rule.severity = error
dotnet_naming_rule.private_instance_fields_rule.style = m_upper_camel_case_style
dotnet_naming_rule.private_instance_fields_rule.symbols = private_instance_fields_symbols
dotnet_naming_rule.private_static_fields_rule.severity = error
dotnet_naming_rule.private_static_fields_rule.style = s_upper_camel_case_style
dotnet_naming_rule.private_static_fields_rule.symbols = private_static_fields_symbols
dotnet_naming_rule.private_static_readonly_rule.severity = error
dotnet_naming_rule.private_static_readonly_rule.style = k_upper_camel_case_style
dotnet_naming_rule.private_static_readonly_rule.symbols = private_static_readonly_symbols
dotnet_naming_style.k_upper_camel_case_style.capitalization = pascal_case
dotnet_naming_style.k_upper_camel_case_style.required_prefix = k_
dotnet_naming_style.m_upper_camel_case_style.capitalization = pascal_case
dotnet_naming_style.m_upper_camel_case_style.required_prefix = m_
dotnet_naming_style.s_upper_camel_case_style.capitalization = pascal_case
dotnet_naming_style.s_upper_camel_case_style.required_prefix = s_
dotnet_naming_symbols.private_constants_symbols.applicable_accessibilities = private
dotnet_naming_symbols.private_constants_symbols.applicable_kinds = field
dotnet_naming_symbols.private_constants_symbols.required_modifiers = const
dotnet_naming_symbols.private_instance_fields_symbols.applicable_accessibilities = private
dotnet_naming_symbols.private_instance_fields_symbols.applicable_kinds = field
dotnet_naming_symbols.private_static_fields_symbols.applicable_accessibilities = private
dotnet_naming_symbols.private_static_fields_symbols.applicable_kinds = field
dotnet_naming_symbols.private_static_fields_symbols.required_modifiers = static
dotnet_naming_symbols.private_static_readonly_symbols.applicable_accessibilities = private
dotnet_naming_symbols.private_static_readonly_symbols.applicable_kinds = field
dotnet_naming_symbols.private_static_readonly_symbols.required_modifiers = static, readonly
37 changes: 36 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,46 @@ 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.0.0-beta.5] - 2023-06-28

### Added
- Added Batching to import and deploy to help prevent "Too Many Requests" error.
- Cloud Code Modules now supports `import` and `export` commands.
- Cloud Code Scripts now supports `import` and `export` commands.
- Lobby now supports `import` and `export` commands.
- Leaderboard now supports `import` and `export` commands.
- Remote Config now supports `import` and `export` commands.
- Alpine build now added to the release.
- New option `--services` to deploy and fetch commands. This option perform commands only to specified services.
* **[Breaking Change]** This option is mandatory when using the `--reconcile` flag.

### Changed
- **[Breaking Change]** CloudCode `list` command for Modules and Scripts is more descriptive.
- Using standardized output for all Import/Export implementations.
- Plain text Deploy/Fetch Output now prints full path.
* This is to disambiguate output regarding files with same name, but different path.
- **[Breaking Change]** Messages are directed to StdErr and Output into Stdout.
* This allows to pipe individual parts such as `ugs cmd 1>output 2>logs.txt`.
* In both json and regular formats.
- **[Breaking Change]** Cloud Code create, delete, get, list, new-file, publish and update commands are now under a parent command `scripts` and can be called with `cloud-code scripts <command>`.

### Fixed
- CloudCode files that failed to read now reported properly in the output.
- CloudCode deleted files properly reported in the Deploy output.
- RemoteConfig Entries properly reported in the Deploy output.
- RemoteConfig Fetch properly bubbles issues in loading files.
- **[Breaking Change]** Deploy and Fetch output have been modified to match each other.
* Status have been updated to reflect what is happening in the editor.
- An issue where fetching a file from Cloud Code that had no parameters would keep appending `module.exports.parameters = {}`.
- Using Cloud Code fetch and deploy multiple times does not keep appending new lines anymore.
- Improved error handling to provide more detail on certain unhandled exceptions.
- Cloud Code script with invalid parameters will fail to fetch and show in the "failed" result section.

## [1.0.0-beta.4] - 2023-04-24

### Added

- npm distribution. Install the CLI by running `npm install -g ugs`.
- new-file command for economy
- `ugs fetch` now supports cloud code scripts.
- Get player command in Player Module. Run `ugs player get -h` to show usage.
- List player command in Player Module. Run `ugs player list -h` to show usage.
Expand All @@ -21,6 +55,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- **[Breaking Change]** Replace Jint with Node.js for cloud code javascript parameter parsing. User will need to install Node.js with
version > 14.0.0 to parse cloud code javascript.
- Updated Diagnostics to use UnityAnalyticSender instead of TelemetrySender
- Add support for `import` and `export` commands to the Lobby module.

### Fixed

Expand Down
8 changes: 8 additions & 0 deletions Samples/Deploy/Economy/resource.ec
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "GOLD",
"name": "Gold",
"type": "CURRENCY",
"initial": 10,
"max": 1000,
"customData": null
}
26 changes: 26 additions & 0 deletions Samples/Deploy/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,30 @@ To create a deployable remote config file, you need a `.rc` file with the follow
```
Please take [configuration.rc] as an example. For more details, please check [Remote Config files].

## Deploy Economy

Run command from [Samples/Deploy] directory:
```
ugs deploy ./Economy
```
You will find the resource from [resource.ec] published in your dashboard for the configured project and environment.

### Create Economy Files:

To create a deployable economy file, you need a `.ec` file with the following pattern:
```Json
{
"id": "GOLD",
"name": "Gold",
"type": "CURRENCY",
"initial": 10,
"max": 1000,
"customData": null
}
```
Please take [resource.ec] as an example. There are other patterns for Inventory item, virtual and real money purchase, for more details, please check [Economy resource schemas].


## Deploy all Samples
Run command from [Samples/Deploy] directory:
```
Expand All @@ -67,9 +91,11 @@ You will find all the contents deployed in your dashboard for the configured pro
---
[`deploy`]: https://services.docs.unity.com/guides/ugs-cli/latest/general/base-commands/deploy
[Remote Config files]: https://docs.unity3d.com/Packages/[email protected]/manual/Authoring/remote_config_files.html
[Economy resource schemas]: https://services.docs.unity.com/economy-admin/v2#tag/Economy-Admin/operation/addConfigResource
[Declare parameters in the script]: https://docs.unity.com/cloud-code/authoring-scripts-editor.html#Declare_parameters_in_the_script
[Script.js]: /Samples/Deploy/CloudCode/Script.js
[configuration.rc]: /Samples/Deploy/RemoteConfig/configuration.rc
[resource.ec]: /Samples/Deploy/Economy/resource.ec
[Samples/Deploy]: /Samples/Deploy
[Deploy Command]: https://services.docs.unity.com/guides/ugs-cli/latest/general/troubleshooting/project-roles#deploy-command
[Service Account]: https://services.docs.unity.com/docs/service-account-auth/index.html
Expand Down
68 changes: 68 additions & 0 deletions Third Party Notices.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,73 @@
# This package contains third-party software components governed by the license(s) indicated below:

Component Name: Polly

License Type: BSD 3-Clause License

Copyright (c) 2015-2023, App vNext

https://github.com/App-vNext/Polly/blob/main/LICENSE

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

<hr>

Component Name: Polly.Extensions.Http

License Type: New BSD License

Copyright (c) 2015-2018, App vNext
All rights reserved.

https://github.com/App-vNext/Polly.Extensions.Http/blob/master/LICENSE.txt

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of App vNext nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

<hr>

Component Name: Coverlet

License Type: MIT
Expand Down
2 changes: 1 addition & 1 deletion Unity.Services.Cli/.run/Cli.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
<option name="Build" />
</method>
</configuration>
</component>
</component>
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace Unity.Services.Cli.Access.UnitTest;
[TestFixture]
public class AccessModuleTests
{
private readonly AccessModule k_AccessModule = new();
readonly AccessModule k_AccessModule = new();

[Test]
public void BuildCommands_CreateCommands()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ namespace Unity.Services.Cli.Access.UnitTest.Handlers;
[TestFixture]
public class GetAllPlayerPoliciesHandlerTests
{
private readonly Mock<IAccessService> m_MockAccessService = new();
private readonly Mock<ILogger> m_MockLogger = new();
private readonly Mock<IUnityEnvironment> m_MockUnityEnvironment = new();
readonly Mock<IAccessService> m_MockAccessService = new();
readonly Mock<ILogger> m_MockLogger = new();
readonly Mock<IUnityEnvironment> m_MockUnityEnvironment = new();

[SetUp]
public void SetUp()
Expand All @@ -35,7 +35,7 @@ public async Task GetAllPlayerPoliciesAsync_CallsLoadingIndicator()
await GetAllPlayerPoliciesHandler.GetAllPlayerPoliciesAsync(null!, null!, null!, null!,
mockLoadingIndicator.Object, CancellationToken.None);
mockLoadingIndicator.Verify(ex => ex
.StartLoadingAsync(It.IsAny<string>(), It.IsAny<Func<StatusContext?,Task>>()), Times.Once);
.StartLoadingAsync(It.IsAny<string>(), It.IsAny<Func<StatusContext?, Task>>()), Times.Once);
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ namespace Unity.Services.Cli.Access.UnitTest.Handlers;
[TestFixture]
public class GetPlayerPolicyHandlerTests
{
private readonly Mock<IAccessService> m_MockAccessService = new();
private readonly Mock<ILogger> m_MockLogger = new();
private readonly Mock<IUnityEnvironment> m_MockUnityEnvironment = new();
readonly Mock<IAccessService> m_MockAccessService = new();
readonly Mock<ILogger> m_MockLogger = new();
readonly Mock<IUnityEnvironment> m_MockUnityEnvironment = new();

[SetUp]
public void SetUp()
Expand All @@ -36,7 +36,7 @@ public async Task GetPlayerPolicyAsync_CallsLoadingIndicator()
await GetPlayerPolicyHandler.GetPlayerPolicyAsync(null!, null!, null!, null!,
mockLoadingIndicator.Object, CancellationToken.None);
mockLoadingIndicator.Verify(ex => ex
.StartLoadingAsync(It.IsAny<string>(), It.IsAny<Func<StatusContext?,Task>>()), Times.Once);
.StartLoadingAsync(It.IsAny<string>(), It.IsAny<Func<StatusContext?, Task>>()), Times.Once);
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ namespace Unity.Services.Cli.Access.UnitTest.Handlers;
[TestFixture]
public class GetProjectPolicyHandlerTests
{
private readonly Mock<IAccessService> m_MockAccessService = new();
private readonly Mock<ILogger> m_MockLogger = new();
private readonly Mock<IUnityEnvironment> m_MockUnityEnvironment = new();
readonly Mock<IAccessService> m_MockAccessService = new();
readonly Mock<ILogger> m_MockLogger = new();
readonly Mock<IUnityEnvironment> m_MockUnityEnvironment = new();

[SetUp]
public void SetUp()
Expand All @@ -36,7 +36,7 @@ public async Task GetProjectPolicyAsync_CallsLoadingIndicator()
await GetProjectPolicyHandler.GetProjectPolicyAsync(null!, null!, null!, null!,
mockLoadingIndicator.Object, CancellationToken.None);
mockLoadingIndicator.Verify(ex => ex
.StartLoadingAsync(It.IsAny<string>(), It.IsAny<Func<StatusContext?,Task>>()), Times.Once);
.StartLoadingAsync(It.IsAny<string>(), It.IsAny<Func<StatusContext?, Task>>()), Times.Once);
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ namespace Unity.Services.Cli.Access.UnitTest.Service;
public class AccessServiceTests
{
readonly Mock<IServiceAccountAuthenticationService> m_AuthenticationServiceObject = new();
private readonly Mock<IPlayerPolicyApi> m_PlayerPolicyApi = new();
private readonly Mock<IProjectPolicyApi> m_ProjectPolicyApi = new();
readonly Mock<IPlayerPolicyApi> m_PlayerPolicyApi = new();
readonly Mock<IProjectPolicyApi> m_ProjectPolicyApi = new();

AccessService m_AccessService;
FileInfo m_PolicyFile;
FileInfo m_DeleteOptionsFile;
FileInfo m_WrongFormattedFile;
AccessService? m_AccessService;
FileInfo? m_PolicyFile;
FileInfo? m_DeleteOptionsFile;
FileInfo? m_WrongFormattedFile;

private static async Task<FileInfo> GetFileInfoObjectAsync(string fileName, string jsonString)
static async Task<FileInfo> GetFileInfoObjectAsync(string fileName, string jsonString)
{
var filePath = Path.Combine(Path.GetTempPath(), fileName);

Expand Down Expand Up @@ -209,7 +209,7 @@ public void DeletePolicyStatementsAsync_InvalidInput()
[Test]
public async Task DeletePlayerPolicyStatementsAsync_Valid()
{
m_PlayerPolicyApi.Setup(a => a.DeletePlayerPolicyStatementsAsync(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(),It.IsAny<DeleteOptions>(), It.IsAny<int>(), CancellationToken.None));
m_PlayerPolicyApi.Setup(a => a.DeletePlayerPolicyStatementsAsync(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<DeleteOptions>(), It.IsAny<int>(), CancellationToken.None));

await m_AccessService!.DeletePlayerPolicyStatementsAsync(TestValues.ValidProjectId, TestValues.ValidEnvironmentId, TestValues.ValidPlayerId, m_DeleteOptionsFile,
CancellationToken.None);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Unity.Services.Cli.Access.Handlers;

internal static class DeletePlayerPolicyStatementsHandler
static class DeletePlayerPolicyStatementsHandler
{
public static async Task DeletePlayerPolicyStatementsAsync(AccessInput input, IUnityEnvironment environment, IAccessService accessService,
ILogger logger, ILoadingIndicator loadingIndicator, CancellationToken cancellationToken)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Unity.Services.Cli.Access.Handlers;

internal static class DeleteProjectPolicyStatementsHandler
static class DeleteProjectPolicyStatementsHandler
{
public static async Task DeleteProjectPolicyStatementsAsync(AccessInput input, IUnityEnvironment environment, IAccessService accessService,
ILogger logger, ILoadingIndicator loadingIndicator, CancellationToken cancellationToken)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Unity.Services.Cli.Access.Handlers;

internal static class GetAllPlayerPoliciesHandler
static class GetAllPlayerPoliciesHandler
{
public static async Task GetAllPlayerPoliciesAsync(CommonInput input, IUnityEnvironment environment, IAccessService accessService,
ILogger logger, ILoadingIndicator loadingIndicator, CancellationToken cancellationToken)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Unity.Services.Cli.Access.Handlers;

internal static class GetPlayerPolicyHandler
static class GetPlayerPolicyHandler
{
public static async Task GetPlayerPolicyAsync(AccessInput input, IUnityEnvironment environment, IAccessService accessService,
ILogger logger, ILoadingIndicator loadingIndicator, CancellationToken cancellationToken)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Unity.Services.Cli.Access.Handlers;

internal static class GetProjectPolicyHandler
static class GetProjectPolicyHandler
{
public static async Task GetProjectPolicyAsync(CommonInput input, IUnityEnvironment environment, IAccessService accessService,
ILogger logger, ILoadingIndicator loadingIndicator, CancellationToken cancellationToken)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Unity.Services.Cli.Access.Handlers;

internal static class UpsertPlayerPolicyHandler
static class UpsertPlayerPolicyHandler
{
public static async Task UpsertPlayerPolicyAsync(AccessInput input, IUnityEnvironment environment, IAccessService accessService,
ILogger logger, ILoadingIndicator loadingIndicator, CancellationToken cancellationToken)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Unity.Services.Cli.Access.Handlers;

internal static class UpsertProjectPolicyHandler
static class UpsertProjectPolicyHandler
{
public static async Task UpsertProjectPolicyAsync(AccessInput input, IUnityEnvironment environment, IAccessService accessService,
ILogger logger, ILoadingIndicator loadingIndicator, CancellationToken cancellationToken)
Expand Down
Loading

0 comments on commit bf5bcdc

Please sign in to comment.