From 655b7ff2c7f1abc3b272d7c19bc517936092a344 Mon Sep 17 00:00:00 2001 From: Unity Technologies <@unity> Date: Fri, 3 May 2024 00:00:00 +0000 Subject: [PATCH] com.unity.addressables@1.21.21 ## [1.21.21] - 2024-05-03 - Fix "Unable to verify target bucket for Remote Catalog: Not Found. Object could not be found" error - Fixed caching to prevent unnecessary refreshing of bucket data. --- CHANGELOG.md | 4 + Editor/Build/CcdBuildEvents.cs | 42 +++-- Editor/Settings/ProfileDataSourceSettings.cs | 58 +++--- .../OptionalPackages/Ccd/CcdBuildMenuTests.cs | 166 ++++++++++++++---- package.json | 10 +- 5 files changed, 207 insertions(+), 73 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e0636761..9bd0e294 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this package 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.21.21] - 2024-05-03 +- Fix "Unable to verify target bucket for Remote Catalog: Not Found. Object could not be found" error +- Fixed caching to prevent unnecessary refreshing of bucket data. + ## [1.21.20] - 2024-02-08 - Fixed an issue where scene InternalId collisions were very likely when using dynamic internal asset naming - Fixed catalogs to use back slashes rather than forward slashes for android builds. diff --git a/Editor/Build/CcdBuildEvents.cs b/Editor/Build/CcdBuildEvents.cs index a250dcba..4ebf5aea 100644 --- a/Editor/Build/CcdBuildEvents.cs +++ b/Editor/Build/CcdBuildEvents.cs @@ -432,6 +432,12 @@ internal async Task verifyTargetBucket(AddressableAssetSettings settings, return true; } + if (settings.m_CcdManagedData.IsConfigured()) + { + // this has been configured by a previous run + return true; + } + // existing automatic bucket loaded from cache var bucketIdVariable = dataSource @@ -450,11 +456,15 @@ internal async Task verifyTargetBucket(AddressableAssetSettings settings, } // otherwise try to create - CcdManagement.SetEnvironmentId(settings.m_CcdManagedData.EnvironmentId); - await CreateManagedBucket(EditorUserBuildSettings.activeBuildTarget.ToString()); - // we created a bucket so refresh our data sources so we ensure they're up to date - await RefreshDataSources(); - + var environmentId = ProfileDataSourceSettings.GetSettings().GetEnvironmentId(settings.profileSettings, settings.activeProfileId); + CcdManagement.SetEnvironmentId(environmentId); // this should be getting the value from the active profile + var ccdBucket = await CreateManagedBucket(EditorUserBuildSettings.activeBuildTarget.ToString()); + if (ccdBucket == null) { + // the bucket already exists, we shouldn't be here if refresh was called + ccdBucket = await GetExistingManagedBucket(); + } + var environmentName = ProfileDataSourceSettings.GetSettings().GetEnvironmentName(settings.profileSettings, settings.activeProfileId); + ProfileDataSourceSettings.AddGroupTypeForRemoteBucket(CloudProjectSettings.projectId, environmentId, environmentName, ccdBucket, new List()); PopulateCcdManagedData(settings, settings.activeProfileId); // I should put this value into the data source list @@ -747,12 +757,16 @@ internal ProfileGroupType GetDataSource(AddressableAssetSettings settings, strin return groupType; } - var groupTypes = ProfileDataSourceSettings.GetSettings().GetGroupTypesByPrefix(string.Join( + var environmentId = ProfileDataSourceSettings.GetSettings().GetEnvironmentId(settings.profileSettings, settings.activeProfileId); + // if we haven't setup an automatic group since refresh we do it here + IEnumerable groupTypes = ProfileDataSourceSettings.GetSettings().GetGroupTypesByPrefix(string.Join( ProfileGroupType.k_PrefixSeparator.ToString(), "CCD", CloudProjectSettings.projectId, ProfileDataSourceSettings.GetSettings().GetEnvironmentId(settings.profileSettings, settings.activeProfileId))); + // if we have setup an automatic group we load it here + groupTypes = groupTypes.Concat(ProfileDataSourceSettings.GetSettings().GetGroupTypesByPrefix(AddressableAssetSettings.CcdManagerGroupTypePrefix)); var automaticGroupType = groupTypes.FirstOrDefault(gt => - gt.GetVariableBySuffix($"{nameof(CcdBucket)}{nameof(CcdBucket.Name)}").Value == - EditorUserBuildSettings.activeBuildTarget.ToString()); + gt.GetVariableBySuffix($"{nameof(CcdBucket)}{nameof(CcdBucket.Name)}")?.Value == EditorUserBuildSettings.activeBuildTarget.ToString() + && gt.GetVariableBySuffix($"{nameof(ProfileDataSourceSettings.Environment)}{nameof(ProfileDataSourceSettings.Environment.id)}")?.Value == environmentId); if (automaticGroupType == null) { // the bucket does not yet exist @@ -838,9 +852,7 @@ async Task CreateManagedBucket(string bucketName) { if (e.ErrorCode == CcdManagementErrorCodes.AlreadyExists) { - var buckets = await ProfileDataSourceSettings.GetAllBucketsAsync(); - ccdBucket = buckets.First(bucket => - bucket.Value.Name == EditorUserBuildSettings.activeBuildTarget.ToString()).Value; + return null; } else { @@ -850,6 +862,14 @@ async Task CreateManagedBucket(string bucketName) return ccdBucket; } + async Task GetExistingManagedBucket() + { + var buckets = await ProfileDataSourceSettings.GetAllBucketsAsync(); + var ccdBucket = buckets.First(bucket => + bucket.Value.Name == EditorUserBuildSettings.activeBuildTarget.ToString()).Value; + return ccdBucket; + } + async Task GetEntryByPath(ICcdManagementServiceSdk api, Guid bucketId, string path) { CcdEntry ccdEntry = null; diff --git a/Editor/Settings/ProfileDataSourceSettings.cs b/Editor/Settings/ProfileDataSourceSettings.cs index 2fb7b8b7..f384de54 100644 --- a/Editor/Settings/ProfileDataSourceSettings.cs +++ b/Editor/Settings/ProfileDataSourceSettings.cs @@ -255,7 +255,7 @@ public static async Task> UpdateCCDDataSourcesAsync(strin Addressables.Log("Syncing CCD Environments, Buckets, and Badges."); } - var profileGroupTypes = new List(); + settings.profileGroupTypes.Clear(); var environments = await GetEnvironments(); @@ -264,7 +264,7 @@ public static async Task> UpdateCCDDataSourcesAsync(strin EditorUtility.DisplayProgressBar("Syncing Profile Data Sources", "Fetching Environments", 0); Addressables.Log($"Successfully fetched {environments.Count} environments."); } - profileGroupTypes.AddRange(CreateDefaultGroupTypes()); + settings.profileGroupTypes.AddRange(CreateDefaultGroupTypes()); try { @@ -284,35 +284,12 @@ public static async Task> UpdateCCDDataSourcesAsync(strin } var badges = await GetAllBadgesAsync(bucket.Id.ToString()); - if (badges.Count == 0) badges.Add(new CcdBadge(name: "latest")); - foreach (var badge in badges) - { - var groupType = - new ProfileGroupType($"CCD{ProfileGroupType.k_PrefixSeparator}{projectId}{ProfileGroupType.k_PrefixSeparator}{environment.id}{ProfileGroupType.k_PrefixSeparator}{bucket.Id}{ProfileGroupType.k_PrefixSeparator}{badge.Name}"); - groupType.AddVariable(new ProfileGroupType.GroupTypeVariable($"{nameof(CcdBucket)}{nameof(CcdBucket.Name)}", bucket.Name)); - groupType.AddVariable(new ProfileGroupType.GroupTypeVariable($"{nameof(CcdBucket)}{nameof(CcdBucket.Id)}", bucket.Id.ToString())); - groupType.AddVariable(new ProfileGroupType.GroupTypeVariable($"{nameof(CcdBadge)}{nameof(CcdBadge.Name)}", badge.Name)); - groupType.AddVariable(new ProfileGroupType.GroupTypeVariable(nameof(CcdBucket.Attributes.PromoteOnly), bucket.Attributes.PromoteOnly.ToString())); - - //Adding environment stub here - groupType.AddVariable(new ProfileGroupType.GroupTypeVariable($"{nameof(Environment)}{nameof(Environment.name)}", environment.name)); - groupType.AddVariable(new ProfileGroupType.GroupTypeVariable($"{nameof(Environment)}{nameof(Environment.id)}", environment.id)); - - string buildPath = $"{AddressableAssetSettings.kCCDBuildDataPath}/{environment.id}/{bucket.Id}/{badge.Name}"; - groupType.AddVariable(new ProfileGroupType.GroupTypeVariable(AddressableAssetSettings.kBuildPath, buildPath)); - - string loadPath = -$"https://{projectId}{m_CcdClientBasePath}/client_api/v1/environments/{environment.name}/buckets/{bucket.Id}/release_by_badge/{badge.Name}/entry_by_path/content/?path="; - groupType.AddVariable(new ProfileGroupType.GroupTypeVariable(AddressableAssetSettings.kLoadPath, loadPath)); - - profileGroupTypes.Add(groupType); - } + AddGroupTypeForRemoteBucket(projectId, environment.id, environment.name, bucket, badges); bucketProgress++; } envProgress++; } - settings.profileGroupTypes = profileGroupTypes; settings.environments = environments.ToList(); if (showInfoLog) Addressables.Log("Successfully synced CCD Buckets and Badges."); EditorUtility.SetDirty(settings); @@ -330,6 +307,35 @@ public static async Task> UpdateCCDDataSourcesAsync(strin return settings.profileGroupTypes; } + internal static void AddGroupTypeForRemoteBucket(string projectId, string environmentId, string environmentName, CcdBucket bucket, List badges) + { + var settings = GetSettings(); + if (badges.Count == 0) badges.Add(new CcdBadge(name: "latest")); + foreach (var badge in badges) + { + var groupType = + new ProfileGroupType( + $"CCD{ProfileGroupType.k_PrefixSeparator}{projectId}{ProfileGroupType.k_PrefixSeparator}{environmentId}{ProfileGroupType.k_PrefixSeparator}{bucket.Id}{ProfileGroupType.k_PrefixSeparator}{badge.Name}"); + groupType.AddVariable(new ProfileGroupType.GroupTypeVariable($"{nameof(CcdBucket)}{nameof(CcdBucket.Name)}", bucket.Name)); + groupType.AddVariable(new ProfileGroupType.GroupTypeVariable($"{nameof(CcdBucket)}{nameof(CcdBucket.Id)}", bucket.Id.ToString())); + groupType.AddVariable(new ProfileGroupType.GroupTypeVariable($"{nameof(CcdBadge)}{nameof(CcdBadge.Name)}", badge.Name)); + groupType.AddVariable(new ProfileGroupType.GroupTypeVariable(nameof(CcdBucket.Attributes.PromoteOnly), bucket.Attributes.PromoteOnly.ToString())); + + //Adding environment stub here + groupType.AddVariable(new ProfileGroupType.GroupTypeVariable($"{nameof(Environment)}{nameof(Environment.name)}", environmentName)); + groupType.AddVariable(new ProfileGroupType.GroupTypeVariable($"{nameof(Environment)}{nameof(Environment.id)}", environmentId)); + + string buildPath = $"{AddressableAssetSettings.kCCDBuildDataPath}/{environmentId}/{bucket.Id}/{badge.Name}"; + groupType.AddVariable(new ProfileGroupType.GroupTypeVariable(AddressableAssetSettings.kBuildPath, buildPath)); + + string loadPath = + $"https://{projectId}{m_CcdClientBasePath}/client_api/v1/environments/{environmentName}/buckets/{bucket.Id}/release_by_badge/{badge.Name}/entry_by_path/content/?path="; + groupType.AddVariable(new ProfileGroupType.GroupTypeVariable(AddressableAssetSettings.kLoadPath, loadPath)); + + settings.profileGroupTypes.Add(groupType); + } + } + internal static async Task> GetAllBucketsAsync() { int page = 1; diff --git a/Tests/Editor/OptionalPackages/Ccd/CcdBuildMenuTests.cs b/Tests/Editor/OptionalPackages/Ccd/CcdBuildMenuTests.cs index 18628693..fb1ac354 100644 --- a/Tests/Editor/OptionalPackages/Ccd/CcdBuildMenuTests.cs +++ b/Tests/Editor/OptionalPackages/Ccd/CcdBuildMenuTests.cs @@ -1,6 +1,8 @@ #if (ENABLE_CCD && ENABLE_MOQ) using System; +using System.Collections.Generic; using System.IO; +using System.Linq; using System.Reflection; using System.Text.RegularExpressions; using NUnit.Framework; @@ -29,6 +31,14 @@ namespace UnityEditor.AddressableAssets.Tests.OptionalPackages.Ccd { public class CcdBuildMenuTests { + public enum RemoteCatalogType + { + None, + Local, + Remote + }; + static RemoteCatalogType[] remoteCatalogTypes = new RemoteCatalogType[] { RemoteCatalogType.None, RemoteCatalogType.Local, RemoteCatalogType.Remote}; + private const int k_SleepTime = 30000; // this is all cribbed from AddressableAssetTestsBase @@ -58,6 +68,9 @@ public class CcdBuildMenuTests private static string m_ManagedBucketId = "05bb444b-5c7e-40ad-a123-fd7596f60784"; private static string m_StaticBucketId = "ce62fde2-1451-4e0c-adee-1924e95b48e7"; private static string m_SecondBucketId = "98476627-3c9d-49a2-ac79-b84e3e2b6913"; + // this is used to queue up subsequent calls to ListBuckets + private Queue> m_listBucketCalls = new Queue>(); + private AddressablesDataBuilderInput m_Input; @@ -247,6 +260,26 @@ public async Task SetUp() m_CcdManagementMock = new CcdManagementServiceSdkMock(); m_CcdManagementMock.Init(); + #if CCD_3_OR_NEWER + m_CcdManagementMock.Setup(client => client.ListBucketsAsync(It.IsAny(), It.IsAny())).Returns((v, bucketsOptions) => + #else + m_CcdManagementMock.Setup(client => client.ListBucketsAsync(It.IsAny())).Returns((v) => + #endif + { + if (v.Page == 1) + { + if (m_listBucketCalls.Count == 0) + { + throw new Exception("no list bucket data found for call"); + } + + return Task.FromResult(m_listBucketCalls.Dequeue()); + } + if (v.Page == 2) + throw new CcdManagementException(CcdManagementErrorCodes.OutOfRange, "out of range"); + return null; + }); + // Refresh data sources to populate our profiles Assert.True(await refreshDataSources()); @@ -263,6 +296,10 @@ public void Teardown() m_CcdManagementMock.VerifyAll(); AssetDatabase.DeleteAsset(k_ProfileSettingsPath); deleteContentStateBin(); + if (m_listBucketCalls.Count > 0) + { + throw new Exception("not all list bucket calls were made"); + } } [OneTimeTearDown] @@ -298,6 +335,29 @@ private void createFile(string fileName) Assert.True(File.Exists(fileName)); } + private void setupRemoteCatalog(RemoteCatalogType remoteCatalogType) + { + switch(remoteCatalogType) + { + case RemoteCatalogType.None: + m_Settings.BuildRemoteCatalog = false; + m_Settings.RemoteCatalogBuildPath = new ProfileValueReference(); + break; + case RemoteCatalogType.Local: + m_Settings.BuildRemoteCatalog = true; + m_Settings.RemoteCatalogBuildPath = new ProfileValueReference(); + m_Settings.RemoteCatalogBuildPath.SetVariableByName(m_Settings, "Local.BuildPath"); + m_Settings.RemoteCatalogLoadPath.SetVariableByName(m_Settings, "Local.LoadPath"); + break; + case RemoteCatalogType.Remote: + m_Settings.BuildRemoteCatalog = true; + m_Settings.RemoteCatalogBuildPath = new ProfileValueReference(); + m_Settings.RemoteCatalogBuildPath.SetVariableByName(m_Settings, "Remote.BuildPath"); + m_Settings.RemoteCatalogLoadPath.SetVariableByName(m_Settings, "Remote.LoadPath"); + break; + } + } + [Test] public async Task AutomaticAndStaticProfileUploadAndReleaseSuccess() { @@ -688,33 +748,26 @@ public async Task refreshDataSources() var managedBucket = new CcdBucket(id: Guid.Parse(m_ManagedBucketId), name: EditorUserBuildSettings.activeBuildTarget.ToString(), attributes: new CcdBucketAttributes(promoteOnly: false)); var staticBucket = new CcdBucket(id: Guid.Parse(m_StaticBucketId), name: "Static Bucket", attributes: new CcdBucketAttributes(promoteOnly: false)); var secondBucket = new CcdBucket(id: Guid.Parse(m_SecondBucketId), name: "Second Bucket", attributes: new CcdBucketAttributes(promoteOnly: false)); - var buckets = new System.Collections.Generic.List(); + var buckets = new List(); buckets.Add(managedBucket); buckets.Add(staticBucket); buckets.Add(secondBucket); - // this is refresh data -#if CCD_3_OR_NEWER - var listBucketsCalls = m_CcdManagementMock.Setup(client => client.ListBucketsAsync(It.IsAny(), It.IsAny())).Returns((v, bucketsOptions) => -#else - var listBucketsCalls = m_CcdManagementMock.Setup(client => client.ListBucketsAsync(It.IsAny())).Returns((v) => -#endif - { - if (v.Page == 1) - return Task.FromResult(buckets); - if (v.Page == 2) - throw new CcdManagementException(CcdManagementErrorCodes.OutOfRange, "out of range"); - return null; - }); - - // no badges m_CcdManagementMock.Setup(client => client.ListBadgesAsync(managedBucket.Id, It.IsAny())) .Throws(new CcdManagementException(CcdManagementErrorCodes.OutOfRange, "out of range")); m_CcdManagementMock.Setup(client => client.ListBadgesAsync(staticBucket.Id, It.IsAny())) .Throws(new CcdManagementException(CcdManagementErrorCodes.OutOfRange, "out of range")); m_CcdManagementMock.Setup(client => client.ListBadgesAsync(secondBucket.Id, It.IsAny())) .Throws(new CcdManagementException(CcdManagementErrorCodes.OutOfRange, "out of range")); - + return await refreshDataSources(buckets); + } + public async Task refreshDataSources(List buckets) + { + // this is refresh data + // production + m_listBucketCalls.Enqueue(buckets); + // development + m_listBucketCalls.Enqueue(new List()); // I can't add group types directly as it's internal. So adding my test group types by calling var result = await CcdBuildEvents.Instance.RefreshDataSources(m_Input); @@ -734,10 +787,10 @@ public async Task refreshDataSources() [Test] - public async Task VerifyTargetBucketAllLocal() + public async Task VerifyTargetBucketAllLocal([ValueSource(nameof(remoteCatalogTypes))] RemoteCatalogType remoteCatalogType) { m_Settings.activeProfileId = m_Settings.profileSettings.GetProfileId(k_ProfileDefault); - m_Settings.BuildRemoteCatalog = false; + setupRemoteCatalog(remoteCatalogType); var success = await CcdBuildEvents.Instance.VerifyTargetBucket(m_Input); Assert.True(success); #if !ADDRESSABLES_WITHOUT_GROUP_FIXES @@ -764,12 +817,26 @@ private CcdManagementException InternalErrorException() } [Test] - public async Task VerifyTargetBucketAutomaticAndStaticProfile() + public async Task VerifyTargetBucketAutomaticAndStaticProfile([ValueSource(nameof(remoteCatalogTypes))] RemoteCatalogType remoteCatalogType) { - m_CcdManagementMock.Setup(client => client.CreateBucketAsync(It.Is((v) => v.Name == EditorUserBuildSettings.activeBuildTarget.ToString()))) - .Throws(AlreadyExistsException); m_Settings.activeProfileId = m_Settings.profileSettings.GetProfileId(k_ProfileAutomaticAndStatic); - m_Settings.BuildRemoteCatalog = true; + setupRemoteCatalog(remoteCatalogType); + var success = await CcdBuildEvents.Instance.VerifyTargetBucket(m_Input); + Assert.True(success); + + var ccdManagedDataField = m_Input.AddressableSettings.GetType().GetField("m_CcdManagedData", BindingFlags.NonPublic | BindingFlags.Instance); + var ccdManagedDataInstance = ccdManagedDataField.GetValue(m_Input.AddressableSettings); + var bucketIdField = ccdManagedDataInstance.GetType().GetField("BucketId", BindingFlags.Public | BindingFlags.Instance); + var verifiedBucketId = bucketIdField.GetValue(ccdManagedDataInstance); + Assert.AreEqual(m_ManagedBucketId, verifiedBucketId); + } + + [Test] + public async Task VerifyTargetBucketAutomaticProfile([ValueSource(nameof(remoteCatalogTypes))] RemoteCatalogType remoteCatalogType) + { + m_Settings.activeProfileId = m_Settings.profileSettings.GetProfileId(k_ProfileAutomaticAndLocal); + setupRemoteCatalog(remoteCatalogType); + var success = await CcdBuildEvents.Instance.VerifyTargetBucket(m_Input); Assert.True(success); @@ -781,12 +848,19 @@ public async Task VerifyTargetBucketAutomaticAndStaticProfile() } [Test] - public async Task VerifyTargetBucketAutomaticProfile() + public async Task VerifyTargetBucketAutomaticProfileNoManagedData([ValueSource(nameof(remoteCatalogTypes))] RemoteCatalogType remoteCatalogType) { + var managedBucket = new CcdBucket(id: Guid.Parse(m_ManagedBucketId), name: EditorUserBuildSettings.activeBuildTarget.ToString(), attributes: new CcdBucketAttributes(promoteOnly: false)); m_CcdManagementMock.Setup(client => client.CreateBucketAsync(It.Is((v) => v.Name == EditorUserBuildSettings.activeBuildTarget.ToString()))) - .Throws(AlreadyExistsException); + .Returns(Task.FromResult(managedBucket)); m_Settings.activeProfileId = m_Settings.profileSettings.GetProfileId(k_ProfileAutomaticAndLocal); - m_Settings.BuildRemoteCatalog = true; + setupRemoteCatalog(remoteCatalogType); + + resetManagedBucket(); + + // this should be a completely new remote project + await refreshDataSources(new List()); + var success = await CcdBuildEvents.Instance.VerifyTargetBucket(m_Input); Assert.True(success); @@ -798,26 +872,56 @@ public async Task VerifyTargetBucketAutomaticProfile() } [Test] - public async Task VerifyTargetBucketStaticProfile() + public async Task VerifyTargetBucketAutomaticProfileNoManagedDataBucketExists([ValueSource(nameof(remoteCatalogTypes))] RemoteCatalogType remoteCatalogType) + { + var managedBucket = new CcdBucket(id: Guid.Parse(m_ManagedBucketId), name: EditorUserBuildSettings.activeBuildTarget.ToString(), attributes: new CcdBucketAttributes(promoteOnly: false)); + m_CcdManagementMock.Setup(client => client.CreateBucketAsync(It.Is((v) => v.Name == EditorUserBuildSettings.activeBuildTarget.ToString()))) + .Throws(AlreadyExistsException()); + m_Settings.activeProfileId = m_Settings.profileSettings.GetProfileId(k_ProfileAutomaticAndLocal); + setupRemoteCatalog(remoteCatalogType); + + resetManagedBucket(); + + // this should be a completely new remote project + await refreshDataSources(new List()); + // since the bucket already exists we should load the bucket + m_listBucketCalls.Enqueue(new List(){managedBucket}); + + var success = await CcdBuildEvents.Instance.VerifyTargetBucket(m_Input); + Assert.True(success); + + var ccdManagedDataField = m_Input.AddressableSettings.GetType().GetField("m_CcdManagedData", BindingFlags.NonPublic | BindingFlags.Instance); + var ccdManagedDataInstance = ccdManagedDataField.GetValue(m_Input.AddressableSettings); + var bucketIdField = ccdManagedDataInstance.GetType().GetField("BucketId", BindingFlags.Public | BindingFlags.Instance); + var verifiedBucketId = bucketIdField.GetValue(ccdManagedDataInstance); + Assert.AreEqual(m_ManagedBucketId, verifiedBucketId); + } + + + [Test] + public async Task VerifyTargetBucketStaticProfile([ValueSource(nameof(remoteCatalogTypes))] RemoteCatalogType remoteCatalogType) { m_Settings.activeProfileId = m_Settings.profileSettings.GetProfileId(k_ProfileStaticAndLocal); - m_Settings.BuildRemoteCatalog = true; + setupRemoteCatalog(remoteCatalogType); var success = await CcdBuildEvents.Instance.VerifyTargetBucket(m_Input); Assert.True(success); } [Test] - public async Task VerifyTargetBucketOverride() + public async Task VerifyTargetBucketOverride([ValueSource(nameof(remoteCatalogTypes))] RemoteCatalogType remoteCatalogType) { var ccdManagedDataField = m_Input.AddressableSettings.GetType().GetField("m_CcdManagedData", BindingFlags.NonPublic | BindingFlags.Instance); var ccdManagedDataInstance = ccdManagedDataField.GetValue(m_Input.AddressableSettings); var stateField = ccdManagedDataInstance.GetType().GetField("State", BindingFlags.Public | BindingFlags.Instance); var stateEnumValues = stateField.GetValue(ccdManagedDataInstance).GetType().GetEnumValues(); - - m_Settings.BuildRemoteCatalog = true; stateField.SetValue(ccdManagedDataInstance, stateEnumValues.GetValue(2)); + m_Settings.activeProfileId = m_Settings.profileSettings.GetProfileId(k_ProfileAutomaticAndLocal); + setupRemoteCatalog(remoteCatalogType); + m_Settings.RemoteCatalogBuildPath.SetVariableByName(m_Settings, "Remote.BuildPath"); + m_Settings.RemoteCatalogLoadPath.SetVariableByName(m_Settings, "Remote.LoadPath"); + var success = await CcdBuildEvents.Instance.VerifyTargetBucket(m_Input); Assert.True(success); } diff --git a/package.json b/package.json index 2eb2e8ae..21f85863 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "com.unity.addressables", "displayName": "Addressables", - "version": "1.21.20", + "version": "1.21.21", "unity": "2019.4", "description": "The Addressable Asset System allows the developer to ask for an asset via its address. Once an asset (e.g. a prefab) is marked \"addressable\", it generates an address which can be called from anywhere. Wherever the asset resides (local or remote), the system will locate it and its dependencies, then return it.\n\nUse 'Window->Asset Management->Addressables' to begin working with the system.\n\nAddressables use asynchronous loading to support loading from any location with any collection of dependencies. Whether you have been using direct references, traditional asset bundles, or Resource folders, addressables provide a simpler way to make your game more dynamic. Addressables simultaneously opens up the world of asset bundles while managing all the complexity.\n\nFor usage samples, see github.com/Unity-Technologies/Addressables-Sample", "keywords": [ @@ -12,7 +12,7 @@ "assetbundles" ], "dependencies": { - "com.unity.scriptablebuildpipeline": "1.21.22", + "com.unity.scriptablebuildpipeline": "1.21.23", "com.unity.modules.assetbundle": "1.0.0", "com.unity.modules.imageconversion": "1.0.0", "com.unity.modules.jsonserialize": "1.0.0", @@ -20,16 +20,16 @@ "com.unity.modules.unitywebrequestassetbundle": "1.0.0" }, "_upm": { - "changelog": "- Fixed an issue where scene InternalId collisions were very likely when using dynamic internal asset naming\n- Fixed catalogs to use back slashes rather than forward slashes for android builds.\n- Fixed an issue where \"Failed to remove scene from Addressables profiler\" warning occurs when a scene is unloaded.\n- Prevent a KeyNotFoundException from being logged to the console.\n- Fix error message to report not found when loading non-Addressable asset by guid\n- Fixed issue where a NullReferenceException occurs when using WaitForCompletion and the max number of concurrent requests is set to 1.\n- Fixed issue where there is missing asset data in the Addressables Profiler for binary catalogs.\n- Added note about the limitations of the Check for Content Update Restrictions tool.\n- Add migration upgrade prompt for legacy path pairs (ex. RemoteLoadPath)\n- Fixed an issue where a broken script on any Addressable Asset would make it impossible to select Addressable Assets in the AssetReference inspector\n- Add logging of catalog and asset bundle http operations.\n- Add UI to trigger CCD management API http call logging (requires newer CCD package)\n- CCD Automatic Profiles can now be one per-profile, rather than one per AddressableSettings instance\n- CCD Manager is built when using the Build to CCD and the standard Build content menu\n- Add support for CCD Management SDK 3.0" + "changelog": "- Fix \"Unable to verify target bucket for Remote Catalog: Not Found. Object could not be found\" error\n- Fixed caching to prevent unnecessary refreshing of bucket data." }, "upmCi": { - "footprint": "fcda45496771b76d428ee37069e821cb5607433d" + "footprint": "695daa558014469fbd2177e71f16275b07c2d612" }, "documentationUrl": "https://docs.unity3d.com/Packages/com.unity.addressables@1.21/manual/index.html", "repository": { "url": "https://github.cds.internal.unity3d.com/unity/Addressables.git", "type": "git", - "revision": "c34a3696939031a32903c278ecd646f4d845377f" + "revision": "74ca1aaeb603da7437db95664f9bb92252223dab" }, "samples": [ {