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
Fix for various issues noticed with provider syntax #13542
Conversation
Test this change out locally with the following install scripts (Action run 8192360911) VSCode
Azure CLI
|
9d7f637
to
394ea29
Compare
394ea29
to
f8872c2
Compare
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.
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.
Regarding the use of the identifier syntax, I thought that the idea was to hide it behind a feature flag (FF), but it seems like the way to do it is adopting the new syntax without subjecting it to the presence of the dynamic type loading FF
This PR builds on top of #13078, #13542 and #13537 to complete the implementation of "implicit" providers - e.g. giving the user the ability to control which providers are available and imported by default fully through the bicepconfig file. ## Example Given the following bicepconfig file: ```json { "providers": { "az": "builtin:", "foo": "br:example.azurecr.io/providers/foo:1.2.3" }, "implicitProviders": ["foo"], } ``` And `.bicep` files will now have `foo` restored from the registry, and imported by default. In this example, `az` is *not* imported by default, and would require an explicit `provider az` in any file wishing to use it. ## Changes * Implicit providers are fully supported in the restoration flow, and errors are surfaced. * The `DefaultNamespaceProvider` has been replaced with a purely config-driven equivalent (`NamespaceProvider`). This also introduces a stricter separation between `NamespaceProvider` (returns a list of available namespace types including diagnostics), and `NamespaceResolver` (take the list of available namespaces, and can be queried to provide information about what is/isn't in scope - e.g. for binding). * Improve some of the diagnostics in error cases, add tests. * Existing functionality should be unaffected. ## Outstanding issues * Implicit providers introduce places where diagnostics can be surfaced without a syntax to attach to. Some of the errors will need to be updated to clarify the source of the problem (bicep config). ###### Microsoft Reviewers: [Open in CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/Azure/bicep/pull/13725)
BCP395
codefix incorrectly replacesprovider 'kubernetes@1.0.0'
with non-working syntaxprovider 'kubernetes'
, whereas it should beprovider kubernetes
.provider k|
import <provider>
instead ofprovider <provider>
BCP395
, rather than the new one.