Skip to content

Commit e91bc9f

Browse files
dalkiaclaude
andcommitted
feat: abgen-registry feature flag to switch AB registry + CDN
Adds the `abgen-registry` flag and a ResolveAssetBundleUrl seam in DecentralandUrlsSource that, when enabled, routes AssetBundleRegistry and AssetBundlesCDN (and all registry-derived endpoints) to their `-abgen` sibling hosts, taking precedence over OPTIMIZED_ASSETS. FeatureFlagsDependent caching; CLI --optimized-assets-url override still wins; LODs are not routed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 1c93440 commit e91bc9f

2 files changed

Lines changed: 38 additions & 2 deletions

File tree

Explorer/Assets/DCL/FeatureFlags/FeatureFlagsStrings.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ public static class FeatureFlagsStrings
9090
public const string HARDWARE_FINGERPRINT = "alfa-hardware-fingerprint";
9191
public const string OPTIMIZED_ASSETS = "optimized-assets";
9292
public const string OPTIMIZED_ASSETS_BASE_URL_VARIANT = "assets-base-url";
93+
94+
// Routes the asset-bundle registry + CDN to their `-abgen` parallel-pipeline
95+
// siblings (own registry, ab-cdn-abgen CDN). Takes precedence over
96+
// OPTIMIZED_ASSETS so the whole AB surface moves together. See
97+
// DecentralandUrlsSource.ResolveAssetBundleUrl.
98+
public const string ABGEN_REGISTRY = "abgen-registry";
9399
public const string USE_CUSTOM_MEDIA_PLAYER_WINDOWS = "use-custom-media-player-windows";
94100
public const string USE_CUSTOM_MEDIA_PLAYER_MAC_SILICON = "use-custom-media-player-mac-silicon";
95101
public const string USE_CUSTOM_MEDIA_PLAYER_MAC_INTEL = "use-custom-media-player-mac-intel";

Explorer/Assets/DCL/NetworkDefinitions/Browser/DecentralandUrlsSource.cs

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,36 @@ private UrlData ResolveOptimizedAssetsUrl(string dedicatedHostUrl)
216216
return new UrlData(CacheBehaviour.FeatureFlagsDependent, $"https://abcdn.decentraland.{ENV}");
217217
}
218218

219+
/// <summary>
220+
/// Asset-bundle registry / CDN base resolution. When the abgen parallel-pipeline flag is on,
221+
/// routes to the `-abgen` sibling host (own registry + ab-cdn-abgen CDN), taking precedence over
222+
/// OPTIMIZED_ASSETS so the whole AB surface (registry + CDN) moves together. The CLI
223+
/// "--optimized-assets-url" override still wins. LODs are intentionally NOT routed here (abgen's
224+
/// LOD lane is unimplemented) — LodGeneratorCDN keeps calling ResolveOptimizedAssetsUrl directly.
225+
/// </summary>
226+
private UrlData ResolveAssetBundleUrl(string dedicatedHostUrl)
227+
{
228+
if (optimizedAssetsBaseOverride is { Length: > 0 })
229+
return new UrlData(CacheBehaviour.FeatureFlagsDependent, optimizedAssetsBaseOverride);
230+
231+
FeatureFlagsConfiguration featureFlags = FeatureFlagsConfiguration.Instance;
232+
233+
// FeatureFlagsDependent so the abgen host is re-resolved (not cached) until flags load — the
234+
// {ENV} token is substituted in Url() once the environment domain is applied.
235+
if (!featureFlags.IsEmpty && featureFlags.IsEnabled(FeatureFlagsStrings.ABGEN_REGISTRY))
236+
return new UrlData(CacheBehaviour.FeatureFlagsDependent, InsertAbgenSubdomain(dedicatedHostUrl));
237+
238+
return ResolveOptimizedAssetsUrl(dedicatedHostUrl);
239+
}
240+
241+
/// <summary>
242+
/// Inserts the `-abgen` label into the leading subdomain of an AB host, leaving the {ENV} token
243+
/// intact: `https://ab-cdn.decentraland.{ENV}` → `https://ab-cdn-abgen.decentraland.{ENV}`,
244+
/// `https://asset-bundle-registry.decentraland.{ENV}` → `https://asset-bundle-registry-abgen.decentraland.{ENV}`.
245+
/// </summary>
246+
private static string InsertAbgenSubdomain(string hostUrl) =>
247+
hostUrl.Replace(".decentraland.", "-abgen.decentraland.");
248+
219249
/// <summary>Registry-composed endpoints inherit the registry base's caching so a flag-driven base is not cached early.</summary>
220250
private UrlData ComposeRegistryUrl(string path) =>
221251
new (RawUrl(DecentralandUrl.AssetBundleRegistry).Caching, $"{Url(DecentralandUrl.AssetBundleRegistry)}{path}");
@@ -273,7 +303,7 @@ protected virtual UrlData RawUrl(DecentralandUrl decentralandUrl) =>
273303
DecentralandUrl.Account => $"https://decentraland.{ENV}/account/",
274304
DecentralandUrl.MinimumSpecs => $"https://docs.decentraland.{ENV}/player/FAQs/decentraland-101/#what-hardware-do-i-need-to-run-decentraland",
275305
DecentralandUrl.Market => $"https://market.decentraland.{ENV}",
276-
DecentralandUrl.AssetBundlesCDN => ResolveOptimizedAssetsUrl($"https://ab-cdn.decentraland.{ENV}"),
306+
DecentralandUrl.AssetBundlesCDN => ResolveAssetBundleUrl($"https://ab-cdn.decentraland.{ENV}"),
277307
DecentralandUrl.LodGeneratorCDN => ResolveOptimizedAssetsUrl($"https://lod-generator-unity-cdn.decentraland.{ENV}"),
278308
DecentralandUrl.ArchipelagoStatus => $"https://archipelago-ea-stats.decentraland.{ENV}/status",
279309
DecentralandUrl.ArchipelagoHotScenes => $"https://archipelago-ea-stats.decentraland.{ENV}/hot-scenes",
@@ -286,7 +316,7 @@ protected virtual UrlData RawUrl(DecentralandUrl decentralandUrl) =>
286316
DecentralandUrl.CameraReelLink => $"https://reels.decentraland.{ENV}",
287317
DecentralandUrl.Blocklist => $"https://config.decentraland.{ENV}/denylist.json",
288318
DecentralandUrl.ApiFriends => $"wss://rpc-social-service-ea.decentraland.{ENV}",
289-
DecentralandUrl.AssetBundleRegistry => ResolveOptimizedAssetsUrl($"https://asset-bundle-registry.decentraland.{ENV}"),
319+
DecentralandUrl.AssetBundleRegistry => ResolveAssetBundleUrl($"https://asset-bundle-registry.decentraland.{ENV}"),
290320

291321
DecentralandUrl.AssetBundleRegistryVersion => ComposeRegistryUrl("/entities/versions"),
292322
DecentralandUrl.MarketplaceClaimName => $"https://decentraland.{ENV}/marketplace/names/claim",

0 commit comments

Comments
 (0)