Azure / bicep-registry-modules

Bicep registry modules
MIT License
499 stars 347 forks source link

[AVM CI Environment Issue]: `Set-AVMModule` fails when using square bracket notation for object #3026

Closed cecheta closed 1 month ago

cecheta commented 2 months ago

Check for previous/existing GitHub issues

Issue Type?

Bug

Description

The Set-AVMModule script fails to update the README if using square bracket notation to access an object property from a dependency.

Error:

Exception: Failed to process file [/workspaces/bicep-registry-modules/avm/res/machine-learning-services/workspace/tests/e2e/defaults/main.test.bicep]. Please check if it properly formatted. Original error message: [Conversion from JSON failed with error: Unexpected content while parsing JSON. Path 'tags.tag', line 9, position 9.]

To reproduce:

@description('Test output.')
output test object = {
  'test key': 'test value'
}
module nestedDependencies 'dependencies.bicep' = {
  scope: resourceGroup
  name: '${uniqueString(deployment().name, resourceLocation)}-nestedDependencies'
}

@batchSize(1)
module testDeployment '../../../main.bicep' = [
  for iteration in ['init', 'idem']: {
    scope: resourceGroup
    name: '${uniqueString(deployment().name, resourceLocation)}-test-${serviceShort}-${iteration}'
    params: {
      tags: {
        tag: nestedDependencies.outputs.test['test key']
      }
    }
  }
]
microsoft-github-policy-service[bot] commented 2 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.

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

[!WARNING] Tagging the AVM Core Team (@Azure/avm-core-team-technical-bicep) due to a module owner or contributor having not responded to this issue within 3 business days. The AVM Core Team will attempt to contact the module owners/contributors directly.

[!TIP]

  • To prevent further actions to take effect, the "Status: Response Overdue 🚩" label must be removed, once this issue has been responded to.
  • To avoid this rule being (re)triggered, the ""Needs: Triage :mag:" label must be removed as part of the triage process (when the issue is first responded to)!
AlexanderSehr commented 2 months ago

Hey @cecheta, good catch, and as usual, my sincere apologies. As I'm updating the regex via PR #2999 anyways, I'll see to add the fix there.

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

[!WARNING] Tagging the AVM Core Team (@Azure/avm-core-team-technical-bicep) due to a module owner or contributor having not responded to this issue within 3 business days. The AVM Core Team will attempt to contact the module owners/contributors directly.

[!TIP]

  • To prevent further actions to take effect, the "Status: Response Overdue 🚩" label must be removed, once this issue has been responded to.
  • To avoid this rule being (re)triggered, the ""Needs: Triage :mag:" label must be removed as part of the triage process (when the issue is first responded to)!
microsoft-github-policy-service[bot] commented 2 months ago

[!CAUTION] This issue requires the AVM Core Team's (@Azure/avm-core-team-technical-bicep) immediate attention as it hasn't been responded to within 6 business days.

[!TIP]

  • To avoid this rule being (re)triggered, the "Needs: Triage :mag:" and "Status: Response Overdue :triangular_flag_on_post:" labels must be removed when the issue is first responded to!
  • Remove the "Needs: Immediate Attention :bangbang:" label once the issue has been responded to.