Skip to content

Commit

Permalink
Fix for conflict between #13078 and #13487
Browse files Browse the repository at this point in the history
  • Loading branch information
anthony-c-martin committed Feb 29, 2024
1 parent dbc82a2 commit 2577352
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ namespace Bicep.Core.IntegrationTests.Extensibility;
[TestClass]
public class RadiusCompatibilityTests
{
private static ServiceBuilder GetServiceBuilder(IFileSystem fileSystem, string registryHost, string repositoryPath, bool extensibilityEnabledBool, bool providerRegistryBool)
private static ServiceBuilder GetServiceBuilder(IFileSystem fileSystem, string registryHost, string repositoryPath)
{
var clientFactory = RegistryHelper.CreateMockRegistryClient(registryHost, repositoryPath);

return new ServiceBuilder()
.WithFeatureOverrides(new(ExtensibilityEnabled: extensibilityEnabledBool, ProviderRegistry: providerRegistryBool))
.WithFeatureOverrides(new(ExtensibilityEnabled: true, ProviderRegistry: true))
.WithFileSystem(fileSystem)
.WithContainerRegistryClientFactory(clientFactory);
}
Expand All @@ -30,7 +30,7 @@ public async Task Radius_identifier_passing_works_as_defined()
var registry = "example.azurecr.io";
var repository = $"test/radius";

var services = GetServiceBuilder(new MockFileSystem(), registry, repository, true, true);
var services = GetServiceBuilder(new MockFileSystem(), registry, repository);

var tgzData = ThirdPartyTypeHelper.GetMockRadiusTypesTgz();
await RegistryHelper.PublishProviderToRegistryAsync(services.Build(), $"br:{registry}/{repository}:1.0.0", tgzData);
Expand Down
6 changes: 3 additions & 3 deletions src/Bicep.Core/Workspaces/SourceFileGroupingBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ private void PopulateProviderDeclarations(BicepSourceFile file, IFeatureProvider
this.providerDescriptorBundleBuilderBySourceFile[file] = providerBundleBuilder = new ProviderDescriptorBundleBuilder();

}
if (featureProvider.DynamicTypeLoadingEnabled)
if (featureProvider.DynamicTypeLoadingEnabled || featureProvider.ProviderRegistryEnabled)
{
ProcessImplicitProviderDeclarations(file, providerBundleBuilder, config);
var descriptor = ResourceTypesProviderDescriptor.CreateBuiltInProviderDescriptor(
Expand Down Expand Up @@ -391,7 +391,7 @@ private ResultWithDiagnostic<ResourceTypesProviderDescriptor> TryGetDescriptorFo

if (providerDeclarationSyntax.Specification is LegacyProviderSpecification { } legacySpecification)
{
if (!featureProvider.DynamicTypeLoadingEnabled)
if (!featureProvider.DynamicTypeLoadingEnabled && !featureProvider.ProviderRegistryEnabled)
{
return new(ResourceTypesProviderDescriptor.CreateBuiltInProviderDescriptor(
legacySpecification.NamespaceIdentifier,
Expand All @@ -402,7 +402,7 @@ private ResultWithDiagnostic<ResourceTypesProviderDescriptor> TryGetDescriptorFo
return new(x => x.ExpectedProviderSpecification());
}

if (!featureProvider.DynamicTypeLoadingEnabled)
if (!featureProvider.DynamicTypeLoadingEnabled && !featureProvider.ProviderRegistryEnabled)
{
return new(x => x.UnrecognizedProvider(providerDeclarationSyntax.Specification.NamespaceIdentifier));
}
Expand Down

0 comments on commit 2577352

Please sign in to comment.