-
Notifications
You must be signed in to change notification settings - Fork 382
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: Enabled support for *
properties in UDTs
#1891
feat: Enabled support for *
properties in UDTs
#1891
Conversation
…ts.ps1 Co-authored-by: Erika Gressi <[email protected]>
…ts.ps1 Co-authored-by: Erika Gressi <[email protected]>
Important The "Needs: Triage 🔍" label must be removed once the triage process is complete! Tip For additional guidance on how to triage this issue/PR, see the BRM Issue Triage documentation. Note This label was added as per ITA06. |
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.
Looks good to me 💪
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.
LGTM
## Description > Note: Required for Azure#1257 Enabled support for `*` properties in UDTs ([ref](https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/user-defined-data-types#:~:text=Decorators%20may%20be,10%20characters%20long.)) Used `>Any_other_property<` as a stand-in property name (as `*` seemed a bit unintuitive). We can change it to something else, but the Parameter name must be distinct enough & may not contain whitespaces. Tested for pattern module [Hub Networking](https://github.com/hundredacres/bicep-registry-modules/tree/hubspoke/avm/ptn/network/hub-networking) by @hundredacres Regenerated all docs for testing to ensure everything still works as intended. ## Tests ### Case 1: UDT is object ```bicep @description('Optional. A map of the hub virtual networks to create.') param hubVirtualNetworks hubVirtualNetworkObject type hubVirtualNetworkObject = { @description('Optional. Array of hub virtual networks to create.') *: hubVirtualNetworkType? }? ``` Result ![image](https://github.com/Azure/bicep-registry-modules/assets/5365358/f72a53ea-1e1f-4794-adf6-557e8b71943f) ### Case 2: UDT is array ```bicep @description('Optional. Type test') param testObject testObjectType type testObjectType = { @description('Optional. Array of hub virtual networks to create.') *: hubVirtualNetworkType? }[]? ``` Result ![image](https://github.com/Azure/bicep-registry-modules/assets/5365358/ac5c890d-bc76-448b-b9b8-9c627a2dd09b) ## Pipeline Reference <!-- Insert your Pipeline Status Badge below --> | Pipeline | | -------- | | [![avm.res.key-vault.vault](https://github.com/AlexanderSehr/bicep-registry-modules/actions/workflows/avm.res.key-vault.vault.yml/badge.svg?branch=users%2Falsehr%2FreadmeScriptAstrixSupport&event=workflow_dispatch)](https://github.com/AlexanderSehr/bicep-registry-modules/actions/workflows/avm.res.key-vault.vault.yml) | ## Type of Change <!-- Use the check-boxes [x] on the options that are relevant. --> - [ ] Update to CI Environment or utlities (Non-module effecting changes) - [ ] Azure Verified Module updates: - [ ] Bugfix containing backwards compatible bug fixes, and I have NOT bumped the MAJOR or MINOR version in `version.json`: - [ ] Someone has opened a bug report issue, and I have included "Closes #{bug_report_issue_number}" in the PR description. - [ ] The bug was found by the module author, and no one has opened an issue to report it yet. - [ ] Feature update backwards compatible feature updates, and I have bumped the MINOR version in `version.json`. - [ ] Breaking changes and I have bumped the MAJOR version in `version.json`. - [ ] Update to documentation ## Checklist - [ ] I'm sure there are no other open Pull Requests for the same update/change - [ ] I have run `Set-AVMModule` locally to generate the supporting module files. - [ ] My corresponding pipelines / checks run clean and green without any errors or warnings <!-- Please keep up to day with the contribution guide at https://aka.ms/avm/contribute/bicep --> --------- Co-authored-by: Erika Gressi <[email protected]>
## Description > Note: Required for Azure#1257 Enabled support for `*` properties in UDTs ([ref](https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/user-defined-data-types#:~:text=Decorators%20may%20be,10%20characters%20long.)) Used `>Any_other_property<` as a stand-in property name (as `*` seemed a bit unintuitive). We can change it to something else, but the Parameter name must be distinct enough & may not contain whitespaces. Tested for pattern module [Hub Networking](https://github.com/hundredacres/bicep-registry-modules/tree/hubspoke/avm/ptn/network/hub-networking) by @hundredacres Regenerated all docs for testing to ensure everything still works as intended. ## Tests ### Case 1: UDT is object ```bicep @description('Optional. A map of the hub virtual networks to create.') param hubVirtualNetworks hubVirtualNetworkObject type hubVirtualNetworkObject = { @description('Optional. Array of hub virtual networks to create.') *: hubVirtualNetworkType? }? ``` Result ![image](https://github.com/Azure/bicep-registry-modules/assets/5365358/f72a53ea-1e1f-4794-adf6-557e8b71943f) ### Case 2: UDT is array ```bicep @description('Optional. Type test') param testObject testObjectType type testObjectType = { @description('Optional. Array of hub virtual networks to create.') *: hubVirtualNetworkType? }[]? ``` Result ![image](https://github.com/Azure/bicep-registry-modules/assets/5365358/ac5c890d-bc76-448b-b9b8-9c627a2dd09b) ## Pipeline Reference <!-- Insert your Pipeline Status Badge below --> | Pipeline | | -------- | | [![avm.res.key-vault.vault](https://github.com/AlexanderSehr/bicep-registry-modules/actions/workflows/avm.res.key-vault.vault.yml/badge.svg?branch=users%2Falsehr%2FreadmeScriptAstrixSupport&event=workflow_dispatch)](https://github.com/AlexanderSehr/bicep-registry-modules/actions/workflows/avm.res.key-vault.vault.yml) | ## Type of Change <!-- Use the check-boxes [x] on the options that are relevant. --> - [ ] Update to CI Environment or utlities (Non-module effecting changes) - [ ] Azure Verified Module updates: - [ ] Bugfix containing backwards compatible bug fixes, and I have NOT bumped the MAJOR or MINOR version in `version.json`: - [ ] Someone has opened a bug report issue, and I have included "Closes #{bug_report_issue_number}" in the PR description. - [ ] The bug was found by the module author, and no one has opened an issue to report it yet. - [ ] Feature update backwards compatible feature updates, and I have bumped the MINOR version in `version.json`. - [ ] Breaking changes and I have bumped the MAJOR version in `version.json`. - [ ] Update to documentation ## Checklist - [ ] I'm sure there are no other open Pull Requests for the same update/change - [ ] I have run `Set-AVMModule` locally to generate the supporting module files. - [ ] My corresponding pipelines / checks run clean and green without any errors or warnings <!-- Please keep up to day with the contribution guide at https://aka.ms/avm/contribute/bicep --> --------- Co-authored-by: Erika Gressi <[email protected]>
Description
Enabled support for
*
properties in UDTs (ref)Used
>Any_other_property<
as a stand-in property name (as*
seemed a bit unintuitive). We can change it to something else, but the Parameter name must be distinct enough & may not contain whitespaces.Tested for pattern module Hub Networking by @hundredacres
Regenerated all docs for testing to ensure everything still works as intended.
Tests
Case 1: UDT is object
Result
Case 2: UDT is array
Result
Pipeline Reference
Type of Change
version.json
:version.json
.version.json
.Checklist
Set-AVMModule
locally to generate the supporting module files.