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
[FEAT] - Centralized management of provider versions using bicepconfig.json
#13078
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
asilverman
added
the
story: dynamic type loading
Collects all work items related to decoupling of Bicep types from compiler
label
Jan 22, 2024
Test this change out locally with the following install scripts (Action run 8086334010) VSCode
Azure CLI
|
asilverman
force-pushed
the
asilverman/central-mgmt-of-providers
branch
2 times, most recently
from
January 23, 2024 17:20
50f0a8d
to
ebdb8ee
Compare
asilverman
force-pushed
the
asilverman/central-mgmt-of-providers
branch
from
January 24, 2024 21:13
f93e017
to
39ac777
Compare
asilverman
force-pushed
the
asilverman/central-mgmt-of-providers
branch
from
January 26, 2024 18:54
78449ed
to
74434fe
Compare
…/central-mgmt-of-providers
…/central-mgmt-of-providers
…ndling of provider specifications. The error messages in several files were updated to provide more detailed information about the expected format of a provider specification string. The handling of provider specifications was also modified to accommodate different types of syntax. A new method was added to create a string literal with a specific text span, and the check for `syntax.IsSkipped` was removed as it is no longer needed with the updated error message format. 1. Updated error messages in `DynamicAzTypesTests.cs`, `ProviderImportTests.cs`, and `DiagnosticBuilder.cs` to provide more detailed information about the expected format of a provider specification string. 2. Added a new method `CreateStringLiteralWithTextSpan` in `SyntaxFactory.cs` to create a string literal with a specific text span. 3. Modified `ProviderSpecificationFactory.cs` to handle different types of syntax when creating a provider specification. 4. Removed the `isDynamicLoadingEnabled` parameter from the `ExpectedProviderSpecification` method in `DiagnosticBuilder.cs` and updated the error message. 5. Updated `Parser.cs` to use the new error message format in `ExpectedProviderSpecification`. 6. Updated `ModuleDispatcher.cs` to handle cases where the provider specification is null. 7. Updated `StringSyntax.cs` to include a method `GetInnerSpan` that returns the span between the quotes for a string token. 8. Updated `ErrorBuilderTests.cs` to reflect changes in the `ExpectedProviderSpecification` method. 9. Updated `ProviderSpecificationFactoryTests.cs` to include a new enum `SyntaxType` and updated test cases to use this new enum. 10. Updated `RegistryProviderTests.cs` to change the provider string in the test case. 11. Updated `SourceFileGroupingBuilder.cs` to use the new error message format in `ExpectedProviderSpecification`. 12. Updated `TypeAssignmentVisitor.cs` to remove the check for `syntax.IsSkipped` as it is no longer needed with the updated error message format.
asilverman
requested review from
StephenWeatherford,
anthony-c-martin and
shenglol
February 27, 2024 17:46
…ttps://github.com/Azure/bicep into asilverman/central-mgmt-of-providers
asilverman
force-pushed
the
asilverman/central-mgmt-of-providers
branch
from
February 27, 2024 17:54
f323165
to
aa17e93
Compare
shenglol
reviewed
Feb 27, 2024
shenglol
reviewed
Feb 27, 2024
shenglol
reviewed
Feb 27, 2024
shenglol
reviewed
Feb 27, 2024
src/Bicep.Core/TypeSystem/Providers/ProviderSpecificationTrivia.cs
Outdated
Show resolved
Hide resolved
shenglol
reviewed
Feb 27, 2024
src/Bicep.Core/TypeSystem/Providers/ResourceTypesProviderDescriptor.cs
Outdated
Show resolved
Hide resolved
shenglol
reviewed
Feb 27, 2024
shenglol
approved these changes
Feb 27, 2024
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.
None of my comments is blocking, so approving the PR. We should probably still wait for Anthony's approval.
anthony-c-martin
approved these changes
Feb 28, 2024
anthony-c-martin
added a commit
that referenced
this pull request
Feb 29, 2024
anthony-c-martin
added a commit
that referenced
this pull request
Feb 29, 2024
#13078 and #13487 had incompatible changes and were merged at the same time. This PR fixes validation on the main branch. ###### Microsoft Reviewers: [Open in CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/Azure/bicep/pull/13496)
anthony-c-martin
added a commit
that referenced
this pull request
Apr 3, 2024
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)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
story: dynamic type loading
Collects all work items related to decoupling of Bicep types from compiler
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Microsoft Reviewers: Open in CodeFlow