-
Notifications
You must be signed in to change notification settings - Fork 765
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for sourcing feature flags from bicepconfig.json #8559
Changes from 8 commits
caaa1be
a7cd125
6ca40cd
7308527
ab7903d
f197b63
5670a87
91c89f2
f8e1774
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
using Bicep.Core.Emit; | ||
using Bicep.Core.Features; | ||
using Bicep.Core.Registry; | ||
using Bicep.Core.Registry.Auth; | ||
|
@@ -17,14 +16,14 @@ public InvocationContext( | |
IAzResourceTypeLoader azResourceTypeLoader, | ||
TextWriter outputWriter, | ||
TextWriter errorWriter, | ||
IFeatureProvider? features = null, | ||
IFeatureProviderFactory? featureProviderFactory = null, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this need to be nullable? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes; this parameter is a backdoor for the integration tests to toggle various feature flags and set the assembly version to a static string. It is never set on contexts created in the Bicep.Cli package, which instead relies on the DI container to instantiate the factory. |
||
IContainerRegistryClientFactory? clientFactory = null, | ||
ITemplateSpecRepositoryFactory? templateSpecRepositoryFactory = null) | ||
{ | ||
// keep the list of services in this class in sync with the logic in the AddInvocationContext() extension method | ||
OutputWriter = outputWriter; | ||
ErrorWriter = errorWriter; | ||
Features = features ?? new FeatureProvider(); | ||
FeatureProviderFactory = featureProviderFactory; | ||
ClientFactory = clientFactory ?? new ContainerRegistryClientFactory(new TokenCredentialFactory()); | ||
TemplateSpecRepositoryFactory = templateSpecRepositoryFactory ?? new TemplateSpecRepositoryFactory(new TokenCredentialFactory()); | ||
NamespaceProvider = new DefaultNamespaceProvider(azResourceTypeLoader); | ||
|
@@ -36,9 +35,7 @@ public InvocationContext( | |
|
||
public TextWriter ErrorWriter { get; } | ||
|
||
public EmitterSettings EmitterSettings => new EmitterSettings(Features); | ||
|
||
public IFeatureProvider Features { get; } | ||
public IFeatureProviderFactory? FeatureProviderFactory { get; } | ||
|
||
public IContainerRegistryClientFactory ClientFactory { get; } | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a follow-up item, I think we should converge on a single message that covers enablement of all experimental features.