-
Notifications
You must be signed in to change notification settings - Fork 778
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
Add foundation for extension config assignment syntax in bicepparam files and extensionConfigs on module declarations #16565
base: main
Are you sure you want to change the base?
Conversation
…param files. It's based off the existing extension declaration syntax but is subject to change.
… ext config assignments in params files can hook into extension declarations in bicep files.
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.
PR Overview
This PR adds foundational support for extension config assignment syntax while enhancing test coverage and updating related diagnostics.
- Adds new integration tests for module extension configurations.
- Updates baseline samples and CLI integration tests for improved error assertions.
- Refactors module diagnostics and template generation methods in integration tests.
Reviewed Changes
File | Description |
---|---|
src/Bicep.Core.IntegrationTests/ExtensibilityTests.cs | Introduces tests for valid and invalid extension config assignments. |
src/Bicep.Core.Samples/DataSets.cs | Adds a new DataSet sample ("Extensions_CRLF") for extension-related scenarios. |
src/Bicep.Cli.IntegrationTests/BuildParamsCommandTests.cs | Adds additional non-null assertions and updates expected diagnostic validations. |
src/Bicep.Core.Samples/BaselineData_Bicepparam.cs | Updates the baseline data list to include extension-related parameters files. |
src/Bicep.Core.IntegrationTests/ModuleTests.cs | Refactors diagnostic retrieval and template generation to use updated API methods. |
Copilot reviewed 69 out of 69 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
src/Bicep.Core.Samples/DataSets.cs:21
- [nitpick] The naming 'Extensions_CRLF' could be more descriptive; consider adding a comment to clarify its intent (e.g., indicating that it targets tests involving CRLF line endings) or renaming it for better clarity.
public static DataSet Extensions_CRLF => CreateDataSet();
name: 'moduleWithExtsWithAliases' | ||
//@ "name": "moduleWithExtsWithAliases", | ||
extensionConfigs: { | ||
//@ "extensionConfigs": { |
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.
Not certain why this is separate from the rest.
"contentVersion": "1.0.0.0", | ||
"parameters": {}, | ||
"extensionConfigs": { | ||
"k8s": {} |
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.
Property emission not yet implemented.
Test this change out locally with the following install scripts (Action run 13731067870) VSCode
Azure CLI
|
Dotnet Test Results 78 files - 39 78 suites - 39 31m 17s ⏱️ - 15m 31s Results for commit 4cefd1b. ± Comparison against base commit 450ba67. This pull request removes 1792 and adds 671 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
@@ -0,0 +1,7 @@ | |||
using 'main.bicep' | |||
|
|||
extension k8s with { |
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.
Not sure why the symbol isn't showing up.
@@ -184,6 +184,9 @@ public LanguageExpression ConvertExpression(Expression expression) | |||
case ParametersAssignmentReferenceExpression exp: | |||
return CreateFunction("parameters", new JTokenExpression(exp.Parameter.Name)); | |||
|
|||
case ExtensionConfigAssignmentExpression exp: |
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.
I'm not sure if this is needed. This syntax is only usable in param files. I think referencing assignments from other assignments should be permissible, but that's for a later PR.
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 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: Foundation for Integration of extension resources with deployment stacks. bicep-reps#6
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
I have a resource name property equal to "name"
If applicable, I have set the
location
property tolocation: /*${<id>:location}*/'location'
(notresourceGroup().location
) where<id>
is a placeholder id, and addedparam location string
to the test's main.bicep file so that the resulting main.combined.bicep file used in the tests compiles without errorsI have verified that the snippet deploys correctly when used in the context of an actual bicep file
e.g.
Microsoft Reviewers: Open in CodeFlow