Skip to content

fix and add test for invalid parameter type #17193

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

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

polatengin
Copy link
Member

@polatengin polatengin commented May 20, 2025

Fixes #16731

Adding diagnostic error when there is a type mismatch between the parameter in the bicep file and the parameter in the bicepparam file.

Also adding a test to verify the error message is correct

Microsoft Reviewers: Open in CodeFlow

@polatengin polatengin self-assigned this May 20, 2025
@polatengin polatengin marked this pull request as draft May 20, 2025 17:51
Copy link
Contributor

github-actions bot commented May 20, 2025

Test this change out locally with the following install scripts (Action run 15167759712)

VSCode
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-vsix.sh) --run-id 15167759712
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-vsix.ps1) } -RunId 15167759712"
Azure CLI
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-cli.sh) --run-id 15167759712
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-cli.ps1) } -RunId 15167759712"

Copy link
Contributor

github-actions bot commented May 20, 2025

Dotnet Test Results

    77 files   -     40      77 suites   - 40   35m 7s ⏱️ - 25m 53s
12 153 tests  -     10  12 143 ✅  -     20  0 💤 ±0  10 ❌ +10 
28 068 runs   - 14 020  28 048 ✅  - 14 040  0 💤 ±0  20 ❌ +20 

For more details on these failures, see this check.

Results for commit ddc892c. ± Comparison against base commit 992886f.

This pull request removes 1896 and adds 644 tests. Note that renamed tests count towards both.

		nestedProp1: 1
		nestedProp2: 2
		prop1: true
		prop2: false
	1
	2
	\$'")
	prop1: true
	prop2: false
…
Bicep.Cli.IntegrationTests.BuildParamsCommandTests ‑ BuildParams_Extends_InvalidType_ThrowsError
Bicep.Cli.IntegrationTests.BuildParamsCommandTests ‑ BuildParams_Extends_Multiple_InvalidType_ThrowsMultipleErrors
Bicep.Core.IntegrationTests.AzTypesViaRegistryTests ‑ Bicep_compiler_handles_corrupted_extension_package_gracefully (\u001f�\u0008\u0000\u0000\u0000\u0000\u0000\u0000
�ӽ
�0\u0010\u0007��>E�\u0003�I{IZ�����\u0003��D���V(��n:��\u0016�~\u0008�7�\u000er��g�ƴ+4\u0019V5����\u000c�[
��yG�&B?q�5hA\u0008m�\u001f�ݵnLeG��\u001f\u0014D�4�\u001c\u0013a�\u001e��qĴ\u000c\u0000B�����&bZ��\u001c�\u000c[v�/Eמ����L�����[ѷ��\u0010��\��E\u0000�p%Cm�?I&�<�7�m\u000blKL\u001b�֘��to�5���q\u001c�\u0019�\u0003����\u0000\u000c\u0000\u0000,"Value cannot be null. (Parameter 'source')")
Bicep.Core.IntegrationTests.AzTypesViaRegistryTests ‑ Bicep_compiler_handles_corrupted_extension_package_gracefully (\u001f�\u0008\u0000\u0000\u0000\u0000\u0000\u0000
��A\u000b�0\u0014\u0000���\u0015�\u001f07}�4�\u0010t�\u0008\u000b��1r��\u0016j �盇�P�E-h�q�����F܍j\u0016Z���\u0008\u0017�%�w�\u0010\u0000o�[\u000c$b�"*A2�p��)��U�JS�\u0018{� /���r\u001d1��\u0000�\u000c\u0003"\u0004�C\u0001\u0013\u0013;t�X�/�>FY�ꆜ�sѦ�]��>���y�õ���S\u000f\u0010��@�\u0007\u0002Q�h���Qf�������n�����v�8Sl~�o�dY�e
�\u000e����\u0000\u000c\u0000\u0000,"'7' is an invalid end of a number. Expected a delimiter. Path: $.INVALID_JSON | LineNumber: 0 | BytePositionInLine: 20.")
Bicep.Core.IntegrationTests.AzTypesViaRegistryTests ‑ Bicep_compiler_handles_corrupted_extension_package_gracefully (\u001f�\u0008\u0000\u0000\u0000\u0000\u0000\u0000
��K\u000e�0\u0010\u0006�=\u0005'(3e����K��(��P�@$1��vab"�
�����N:m��xc�uiv契:�X�Ɂ�\u0012
�{�Q ?�\u0000�����Gy�5���Q�8�\u0007�,2��*\u000bd�4�J&��R�r��h
��i�EgO��Zylj�\u001b����/\u001a\u000cz��o=ѧ�\u0003(�\u001a0!@E>��>��d�����/=A\u0010\u0004A��\u0007\u00014�m\u0000\u000c\u0000\u0000,"The path: index.json was not found in artifact contents")
Bicep.Core.IntegrationTests.AzTypesViaRegistryTests ‑ Bicep_compiler_handles_corrupted_extension_package_gracefully (\u001f�\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0003�ӽ
�0\u0010\u0007��>E� ��%^\u001d�;�
A\u000b~�T�\u0014\u000b⻛\u000e�C�Km\u0005�[\u00029��\u0010�2��n[�CQ7�\u0014lR)�\u0006�Z���\u001e\u001a\u0014�/ ��f!�n�M\u0006���uXe�Y?He����ȑ5gڰBI���V��\u001f�ar�����⪛��r}C9ְ�C�A����\u0019��\u000f�\u0004\u001a@ҀH\u0018�\u001f���Y2����?�� ��(Z�\u0013�\u0019u�\u0000\u000c\u0000\u0000,"The path: index.json was not found in artifact contents")
Bicep.Core.IntegrationTests.AzTypesViaRegistryTests ‑ Bicep_compiler_handles_corrupted_extension_package_gracefully (\u001f�\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0003�ӽ\u000e�0\u0010\u0007��>E�\u0003�\u001em)������\u0000\u0015Έ\u0011$�	���-�q���ab�c����޴[4)V5\u0013>�֌��[����\u001d���~�k�l7mGߤǽnLeW�c�\u000f�Cj�,�\u0018�ԡT�\u0007�\u0000�P��֒�\u001aD�4�9Ί\u0014[v�oEמ\u000f�/}Mg������-�\H\u0002����~\u0017 <P��Β�?���z�\u0002�\u0012�\u0006�\u001d�G��
=�k�ϥws\u001c�q��\u0002\u0004\u000f��\u0000\u000c\u0000\u0000,"Value cannot be null. (Parameter 'source')")
Bicep.Core.IntegrationTests.AzTypesViaRegistryTests ‑ Bicep_compiler_handles_corrupted_extension_package_gracefully (\u001f�\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0003��A\u000b�0\u0014\u0007��\u0014�\u0007�{ss.�\u0010t�\u0008\u000b��1r��\u0016j �囇�tQ\u000b����1���N5+�R]VاDz\u0018
�\u0018\u0001c��-`\u0002�x!�\u0008�M��\u000c�I�{U�Ҭ2Ŭ\u001fDCG�Y�#\u0010L��\u000b
���a(g�v꫁tn�>GY��\u0006_�kѶ�}�߾����~�����B\u0019\u0002N�g\u0004�\u0007D\u0002N���$����?�89,6���o\u0013w�\u001f��;Y�eY�{\u0002P�-�\u0000\u000c\u0000\u0000,"'7' is an invalid end of a number. Expected a delimiter. Path: $.INVALID_JSON | LineNumber: 0 | BytePositionInLine: 20.")
Bicep.Core.IntegrationTests.DirectResourceCollectionTests ‑ DirectResourceCollectionAccess_NotAllowedWithinLoops ("output loopOutput array = [for i in range(0, 2): {
  prop: map(containerWorkers, (w) => w.properties.ipAddress.ip)
}]")
Bicep.Core.IntegrationTests.DirectResourceCollectionTests ‑ DirectResourceCollectionAccess_NotAllowedWithinLoops ("resource propertyLoop 'Microsoft.ContainerInstance/containerGroups@2022-09-01' = {
  name: 'gh9440-loop'
  location: 'westus'
  properties: {
    containers: [for i in range(0, 2): {
      name: 'gh9440-w1c-${i}'
      properties: {
        command: [
          'echo "${join(map(containerWorkers, (w) => w.properties.ipAddress.ip), ',')}"'
        ]
      }
    }]
  }
}")
…

♻️ This comment has been updated with latest results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No warning/error for type mismatch for extendable bicepparam values
1 participant