-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Introduce a bicep reference builder #52742
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
Introduce a bicep reference builder #52742
Conversation
API Change CheckAPIView identified API level changes in this PR and created the following API reviews |
This comment was marked as outdated.
This comment was marked as outdated.
df242c0 to
be423ba
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.
Pull Request Overview
This PR introduces a Bicep reference builder that enhances the Azure Provisioning library by enabling proper resolution of property references within Bicep expressions. The changes establish a system for tracking and building references to nested properties, lists, and dictionaries, allowing for more robust expression generation and interpolation capabilities.
Key changes:
- Added
ToBicepExpression()extension method for converting BicepValue instances to their expression representations - Implemented specialized reference classes for list and dictionary indexing operations
- Enhanced collection classes to maintain proper self-references for nested items
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| BicepValueToExpressionTests.cs | Comprehensive test suite covering literal values, property references, collections, and interpolation scenarios |
| BicepValueHelpers.cs | Utility class providing helper methods for setting self-references on BicepValue instances |
| ProvisionableConstruct.cs | Simplified construct compilation by delegating to CompileProperties method |
| BicepValueReference.cs | Enhanced with specialized subclasses for list and dictionary indexing operations |
| BicepTypeMapping.cs | Updated type mapping to handle AzureLocation and ResourceType, improved construct compilation |
| BicepValueOfT.cs | Refactored value storage to support lazy evaluation via value factories |
| BicepValue.cs | Added utility import for helper methods |
| BicepListOfT.cs | Enhanced collection management with proper self-reference tracking for items |
| BicepExpressionExtensions.cs | New extension method for converting BicepValue instances to expressions |
| BicepDictionaryOfT.cs | Enhanced dictionary operations with self-reference management for values |
| Azure.Provisioning.netstandard2.0.cs | API surface update adding BicepExpressionExtensions |
| Azure.Provisioning.net8.0.cs | API surface update adding BicepExpressionExtensions |
This comment was marked as outdated.
This comment was marked as outdated.
…the collection, and fix test cases
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.
Pull Request Overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Pull Request Overview
Copilot reviewed 19 out of 20 changed files in this pull request and generated 5 comments.
Comments suppressed due to low confidence (1)
sdk/provisioning/Azure.Provisioning/src/BicepDictionaryOfT.cs:1
- [nitpick] The condition
values != nullis repeated twice. Consider storing the result in a local variable or using a null-coalescing pattern to avoid redundancy and improve readability.
// Copyright (c) Microsoft Corporation. All rights reserved.
sdk/provisioning/Azure.Provisioning/src/Primitives/ProvisionableConstruct.cs
Outdated
Show resolved
Hide resolved
sdk/provisioning/Azure.Provisioning/src/Utilities/BicepValueHelpers.cs
Outdated
Show resolved
Hide resolved
…lpers.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Fixes #51371
Fixes #48491
Fixes #52263
Fixes #53346
This PR introduces a new API:
which allows you to convert any IBicepValue instance into an expression representing its hierarchy.
Remaining items: