-
Notifications
You must be signed in to change notification settings - Fork 756
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
Extendable Param Files
feature
#13900
Extendable Param Files
feature
#13900
Conversation
Test this change out locally with the following install scripts (Action run 9843636081) VSCode
Azure CLI
|
Test Results 66 files - 33 66 suites - 33 23m 48s ⏱️ - 7m 57s For more details on these failures, see this check. Results for commit 2b30da2. ± Comparison against base commit a8eff9c. ♻️ This comment has been updated with latest results. |
What happens when |
A couple of comments, some which should be addressed now and something in the future. Understanding the override characteristics would be important -
Could we possibly get a decorator such as @MergeCharacteristcs with values:
Can we support chained extends?
It would be great if our main.bicepparam would extend region.bicepparam and region extent env.bicepparm. That would give us a nice changed hierarchy. Finally, can the extend use paths that are dynamic? Given the above hierarchy, when I deploy an object using a main.bicepparam, I'd like to have the main have the following main.bicepparam
region.bicepparam
env.bicepparam
|
I find the proposed design very limited. As far as I understood from the meeting the following things are not possible:
I think better approach would be to have something like:
In this scenario you are clearly defining that this is shared bicep parameters file. Also additionally you provide two (or more if you want, these are optional statements) bicep files to serve as intelisense for the shared file. In this scenario when you define that this is shared bicep parameters files any errors related to required parameters are turned off. In VSC you can still see from intelisense if specific parameter is required or not. You can also see the description for those parameters. In case main1.bicep and main2.bicep contains the same parameter let's say location and that contains two different descriptions upon hovering the parameter when added you can see the description for both. In summary you still get intelisense and other information like description, allowed values, etc, but without the errors you would get in regular bicep parameters files. With that said I would like to see support for the rest of the missing features as well:
Would also be nice that if you can declare which parameters from extends statement you would like to add instead of adding everything. Similar to how it is in import statements. It would really make sense if all these features are released at once otherwise it is best to be preview feature until every feature is added. |
I dont like the idea of typing "using null" as it seems a little clunky. I would rather it be some other form of MS decorator or keyword such as "using sharedbicepparam" which can imply that the bicepparam file can be extended to other files. One other point with this, if this gets implemented, could this lead to a future development whereby we can use the "extends" command direct from a main.bicep file rather than a bicepparam file? This could lead to the possibility of having one global variables file whereby individual main files could 'import' selected variables from the sharedbicepparam file when needed. This could also be through the form of a function, like loadJsonContext(), but maybe something like loadBicepparamFile() ? |
This pr doesn't explain nor solve how we can decouple the bicepparam files between modules and main bicep files. The biggest problem right now is you need to define all the parameters in the main bicep files. I have an extended explanation here on why this is an issue and how i think this could be tackled: #12200 A main bicep file should be rather clean of everything. If we have a look at where Microsoft is heading with the bicep verified modules, i believe Microsoft needs an implementation where they can host modules with their own bicep param files as a blueprint. Only the last part is now solved with the extend, where you can override the definition of the bicep files. |
src/Bicep.Cli.IntegrationTests/Files/BuildParamsCommandTests/Extends/shared.json
Show resolved
Hide resolved
I have watched the last meeting but did not see any of the feedback given before implemented. In fact it seems that everything was the same and the only small change is that using is having none for value instead of null. That is only cosmetic change and it is irrelevant for the functionality. Kind of disappointed due to that. |
…proposal-modular-parameters
@polatengin : Please note that using parameters of type |
With this PR
extends
using none
is allowedextends
keyword makebicepparam
file inherits from anotherbicepparam
using none
is valid only on shared bicepparam files and it turns off the parameter validation process on the fileHow does it work
Files:
Compiled output:
Fixes #12019
Contributing a feature
Microsoft Reviewers: Open in CodeFlow