Azure / bicep-registry-modules

Bicep registry modules
MIT License
506 stars 351 forks source link

[AVM CI Environment Issue]: Implement that tests modules for `enableTelemetry` pass-thru #2977

Open AlexanderSehr opened 3 months ago

AlexanderSehr commented 3 months ago

Check for previous/existing GitHub issues

Issue Type?

Feature Request

Description

When modules re-use AVM modules, they should always pass the enableTelemetry parameter thru to enable users to effectively control if they want to enable/disable telemetry collection. While this should already be the case, we currently do not have a test for it and should definitely have one.

This test should scan a given module for AVM references in all its files (i.e., also in files that it may locally link to and in turn may have references) and ensure that each identified AVM deployment block contains enableTelemetry: enableTelemetry.

To make this easy, we should be able to use the Get-CrossReferencedModuleList function to identify all remote references throughout all files and then scan the bicep files for the found references - to then, finally, check if their corresponding deployment block contains the expected parameter handover.

Optionally, we could also test if the enableTelemetry parameter exists, though Bicep will anyways give the user an error of they add the property to a deployment without having the parameter available to reference from.

microsoft-github-policy-service[bot] commented 3 months ago

[!IMPORTANT] The "Needs: Triage :mag:" 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.