bicep
bicep copied to clipboard
feat: Initial Snippet for AVM Integration
Contributing a Pull Request
If you haven't already, read the full contribution guide. The guide may have changed since the last time you read it, so please double-check. Once you are done and ready to submit your PR, run through the relevant checklist below.
Contributing to documentation
- [ ] All documentation contributions should be made directly in the Bicep documentation on Microsoft Docs.
Contributing an example
We are integrating the Bicep examples into the Azure QuickStart Templates. If you'd like to contribute new example .bicep files that showcase abilities of the language, please follow these instructions to add them directly there. We can still take bug reports and fixes for the existing examples for the time being.
- [ ] This is a bug fix for an existing example
- [ ] I have resolved all warnings and errors shown by the Bicep VS Code extension
- [ ] I have checked that all tests are passing by running
dotnet test - [ ] I have consistent casing for all of my identifiers and am using camelCasing unless I have a justification to use another casing style
Contributing a feature
- [ ] I have opened a new issue for the proposal, or commented on an existing one, and ensured that the Bicep maintainers are good with the design of the feature being implemented
- [ ] I have included "Fixes #{issue_number}" in the PR description, so GitHub can link to the issue and close it when the PR is merged
- [ ] I have appropriate test coverage of my new feature
Contributing a snippet
-
[x] I have a snippet that is either a single, generic resource or multi resource that uses parent-child syntax
-
[x] I have checked that there is not an equivalent snippet already submitted
-
[x] I have used camelCasing unless I have a justification to use another casing style
-
[x] I have placeholders values that correspond to their property names (e.g.
dnsPrefix: 'dnsPrefix'), unless it's a property that MUST be changed or parameterized in order to deploy. In that case, I use 'REQUIRED' e.g. keyData -
[x] I have my symbolic name as the first tab stop ($1) in the snippet. e.g. res-aks-cluster.bicep
-
[x] I have a resource name property equal to "name"
-
[x] If applicable, I have set the
locationproperty tolocation: /*${<id>:location}*/'location'(notresourceGroup().location) where<id>is a placeholder id, and addedparam location stringto the test's main.bicep file so that the resulting main.combined.bicep file used in the tests compiles without errors -
[x] I have verified that the snippet deploys correctly when used in the context of an actual bicep file
e.g.
resource aksCluster 'Microsoft.ContainerService/managedClusters@2021-03-01' = { name: 'name'
Microsoft Reviewers: Open in CodeFlow
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 9.37%. Comparing base (
108d816) to head (f5c18da). Report is 990 commits behind head on main.
:exclamation: There is a different number of reports uploaded between BASE (108d816) and HEAD (f5c18da). Click for more details.
HEAD has 4 uploads less than BASE
Flag BASE (108d816) HEAD (f5c18da) dotnet 4 0
Additional details and impacted files
@@ Coverage Diff @@
## main #14182 +/- ##
===========================================
- Coverage 94.28% 9.37% -84.91%
===========================================
Files 1113 7 -1106
Lines 100791 288 -100503
Branches 8734 123 -8611
===========================================
- Hits 95028 27 -95001
+ Misses 4595 261 -4334
+ Partials 1168 0 -1168
| Flag | Coverage Δ | |
|---|---|---|
| dotnet | ? |
|
| typescript | 9.37% <ø> (+1.66%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
Hey @sydkar, Did you manage to take a look at this? Can you advise around the failing test?
Hi @ChrisSidebotham, to fix the test, you may need to add an integration test for the new snippet with the following steps:
- Add a new folder
Files\SnippetTemplates\avm-res-network-privatednszoneto theBicep.LangServer.IntegrationTestsproject. - Within the new folder, create two empty files named
main.bicepandmain.combined.bicep. - Add comments in main.bicep to provide values for the snippet. Also, add a
// Insert snippet herecomment to indicate where the snippet should be inserted. - Run the script
.\scripts\SetBaselines.ps1. This will updatemain.combined.bicepby applying the snippet values to the snippet template and inserting the result.
For reference, you can take a look at an example here: https://github.com/Azure/bicep/tree/main/src/Bicep.LangServer.IntegrationTests/Files/SnippetTemplates/res-app-gateway.
Hi @ChrisSidebotham, to fix the test, you may need to add an integration test for the new snippet with the following steps:
- Add a new folder
Files\SnippetTemplates\avm-res-network-privatednszoneto theBicep.LangServer.IntegrationTestsproject.- Within the new folder, create two empty files named
main.bicepandmain.combined.bicep.- Add comments in main.bicep to provide values for the snippet. Also, add a
// Insert snippet herecomment to indicate where the snippet should be inserted.- Run the script
.\scripts\SetBaselines.ps1. This will updatemain.combined.bicepby applying the snippet values to the snippet template and inserting the result.For reference, you can take a look at an example here: https://github.com/Azure/bicep/tree/main/src/Bicep.LangServer.IntegrationTests/Files/SnippetTemplates/res-app-gateway.
@shenglol would you mind adding this info to https://github.com/Azure/bicep/blob/main/CONTRIBUTING.md#snippets?
@shenglol - I have updated as necessary but seeing issues with module restoration.