Skip to content
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 AdditionalPropertiesDescription property to ObjectType #15990

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

levimatheri
Copy link
Contributor

@levimatheri levimatheri commented Jan 2, 2025

Resolves #13893.

@levimatheri levimatheri requested a review from Copilot January 2, 2025 22:54

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 5 out of 18 changed files in this pull request and generated no comments.

Files not reviewed (13)
  • src/Bicep.Core/TypeSystem/Providers/MicrosoftGraph/MicrosoftGraphResourceTypeProvider.cs: Evaluated as low risk
  • src/Bicep.Core/TypeSystem/ResourceDerivedTypeResolver.cs: Evaluated as low risk
  • src/Bicep.Core/TypeSystem/Providers/ThirdParty/ExtensibilityResourceTypeFactory.cs: Evaluated as low risk
  • src/Bicep.Core/TypeSystem/Providers/ThirdParty/ThirdPartyResourceTypeProvider.cs: Evaluated as low risk
  • src/Bicep.Core/TypeSystem/DeclaredTypeManager.cs: Evaluated as low risk
  • src/Bicep.Core/TypeSystem/Providers/Az/AzResourceTypeFactory.cs: Evaluated as low risk
  • src/Bicep.Core/TypeSystem/Providers/Az/AzResourceTypeProvider.cs: Evaluated as low risk
  • src/Bicep.Core/TypeSystem/Providers/K8s/K8sResourceTypeProvider.cs: Evaluated as low risk
  • src/Bicep.LangServer.IntegrationTests/HoverTests.cs: Evaluated as low risk
  • src/Bicep.Core/TypeSystem/Types/NamespaceType.cs: Evaluated as low risk
  • src/Bicep.Core/TypeSystem/TypeValidator.cs: Evaluated as low risk
  • src/Bicep.Core.UnitTests/Utils/BuiltInTestTypes.cs: Evaluated as low risk
  • src/Bicep.Core/TypeSystem/TypeHelper.cs: Evaluated as low risk
Comments suppressed due to low confidence (2)

src/Bicep.Core/Emit/CompileTimeImports/ArmDeclarationToExpressionConverter.cs:385

  • Ensure that the new behavior of setting additionalPropertiesDescription is covered by tests.
additionalPropertiesDescription: addlProperties?.Description is StringLiteralExpression stringLiteral ? stringLiteral.Value : null),

src/Bicep.Core/Semantics/SymbolHelper.cs:61

  • The objectType.AdditionalPropertiesDescription might be null. Ensure that null values are handled appropriately.
return new PropertySymbol("*", objectType.AdditionalPropertiesDescription, objectType.AdditionalPropertiesType.Type);
Copy link
Contributor

github-actions bot commented Jan 2, 2025

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

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

Copy link
Contributor

github-actions bot commented Jan 2, 2025

Dotnet Test Results

    78 files   -     39      78 suites   - 39   31m 47s ⏱️ - 14m 28s
11 568 tests  -     24  11 568 ✅  -     24  0 💤 ±0  0 ❌ ±0 
26 866 runs   - 13 422  26 866 ✅  - 13 422  0 💤 ±0  0 ❌ ±0 

Results for commit 2629b5b. ± Comparison against base commit 3e1c6d7.

This pull request removes 1837 and adds 632 tests. Note that renamed tests count towards both.

		nestedProp1: 1
		nestedProp2: 2
		prop1: true
		prop2: false
	1
	2
	\$'")
	prop1: true
	prop2: false
…
Bicep.Core.IntegrationTests.AzTypesViaRegistryTests ‑ Bicep_compiler_handles_corrupted_extension_package_gracefully (\u001f�\u0008\u0000\u0000\u0000\u0000\u0000\u0000
�Խ
�0\u0010\u0000��>E�\u0003�I�\u001f+tw\u0011\|�؞X��4\u0011
⻛\u000e����\u001f�|C��A.?\u0017\u0012�u�\u0005�Cc\u0008\u0017\u0011
	\u001a\u001bu$��\u001d�\u0015b�"��`\u0008�v�Jz܍Ս+e��~P���\u0016%�L�"��\u0017@�dRJ�r�l(�\u0012\k{N�*��\̭��ˡ����
���tG���ȋ�\u0003bI�����\u0014nDx��������PA[Cf!�Ay�&����\u001ax.]��y�7�\u0017\udb1f\uddfd\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
��K\u000e� \u0010\u0006`֞�\u0013�\u0019\u0018�]t��+\u0010m�#�������҅��6nj1�o	L\u0018 ?"��aW�cQ7���D����\u0012M��P#C�\u0002\u000c�\u001eW�a�N&tMkk��\u001a{� ��=�E�F�L�F#P�\u000cHm��av\u000e�Ͷ��sWW�N\�ʍ\u0005�\A�F����[W�)�\u0000�!\u0019����H���2>��d������� ��(
�	!��\u0005\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
���\u000b�0\u0014\u0007��+�?`nso��C�!#,\u0008���A\u0006Z���?�<D\u0017��?��9�=���w�۫z�U��\u0012s`�èo�\u0010���7��Q�F\u0010��\u0005BN��$-\u001ee�
3�\u0018{� &\u001dU��\u000e��!`\u001c��\u0014�\u0002�̔�\u001d%\u001a8wU]�4Ot���-o�����hu���p��-����s�\u000bB�s@D\u0000�&��d����t����F��氋݅c~�g�,˲��\u0002�B�
\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\u0003�Խ
�0\u0010\u0000��>E�\u0003�I�g�\u000e��\u0015���*�\u0016��*m��/�u\u0010�\u0016��\u0008�[\u0002���\u00107�:1qR��\u000b�]��F�\u0012�����FL�QD������;i�(+S@+c��A�\u001c�*͒�i.}O\u0008%	\u001cZ��\u000cb�\u0018���T� ��&��7�YW��ϴ:|�o�\u001a��z\u0002�\u000e��2�\u0015CTI	�G��?���\u0013F��6\�6�]�,0l�{�,˲��\u0002�\u000f0z\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\u0003�Խ
�0\u0010\u0007��>E�\u0003�I�K���Ep�\u0001b{�bki#\u0014�w7\u001dĥť~������\u0010�a��vK�\u00056-������qO+5x�\u0013�\u0010a\u001e8�\u0006�w�n�M\u0006\Zg\u001b��'f��dN�;��	#!M���R-�\u0004��Z>V\u0013)���g����\u001d�sշ�c�߾f0��~��*�\*��\u0000��\u0000�\u0005�\u001a@���$����+�6\u0015v5�\u000e�\u0015�[l�\u0005��S��o�\u0016\u0004A\u0010��\u001d���.\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��K
� \u0010\u0006`�=�'0���,��W�6�\u00071%&4Pz��E���nҤP��:̈��l��m�\u000ee\u0013�Dn2F��#�8�>\u0000\u0005\u0004�\u000b'�(4��~�IFt�uM\u001ce�^?HX��SU\u0016`��\u0005�V��¢������\u0003zu������7�Ρ�CA5U��E�Q����\u001e��Ϲ �F��\u0013H
1� �i�H&�<����\u0013$I�$kx\u0002<�+�\u0000\u000c\u0000\u0000,"The path: index.json was not found in artifact contents")
Bicep.Core.IntegrationTests.AzTypesViaRegistryTests ‑ Repository_not_found_in_registry (ArtifactRegistryAddress { RegistryAddress = mcr.microsoft.com, RepositoryPath = unknown/path/az, ExtensionVersion = 0.0.0-placeholder },Azure.RequestFailedException: The artifact does not exist in the registry.
   at Bicep.Core.Registry.AzureContainerRegistryManager.DownloadManifestAndLayersAsync(IOciArtifactReference artifactReference, ContainerRegistryContentClient client) in /home/runner/work/bicep/bicep/src/Bicep.Core/Registry/AzureContainerRegistryManager.cs:line 138
   at Bicep.Core.Registry.AzureContainerRegistryManager.DownloadManifestAndLayersAsync(IOciArtifactReference artifactReference, ContainerRegistryContentClient client) in /home/runner/work/bicep/bicep/src/Bicep.Core/Registry/AzureContainerRegistryManager.cs:line 138,[(BCP192, Error, Unable to restore the artifact with reference "br:mcr.microsoft.com/unknown/path/az:0.0.0-placeholder": The artifact does not exist in the registry.)])
Bicep.Core.IntegrationTests.AzTypesViaRegistryTests ‑ Repository_not_found_in_registry (ArtifactRegistryAddress { RegistryAddress = mcr.microsoft.com, RepositoryPath = unknown/path/az, ExtensionVersion = 0.0.0-placeholder },Azure.RequestFailedException: The artifact does not exist in the registry.
   at Bicep.Core.Registry.AzureContainerRegistryManager.DownloadManifestAndLayersAsync(IOciArtifactReference artifactReference, ContainerRegistryContentClient client) in D:\a\bicep\bicep\src\Bicep.Core\Registry\AzureContainerRegistryManager.cs:line 138
   at Bicep.Core.Registry.AzureContainerRegistryManager.DownloadManifestAndLayersAsync(IOciArtifactReference artifactReference, ContainerRegistryContentClient client) in D:\a\bicep\bicep\src\Bicep.Core\Registry\AzureContainerRegistryManager.cs:line 138,[(BCP192, Error, Unable to restore the artifact with reference "br:mcr.microsoft.com/unknown/path/az:0.0.0-placeholder": The artifact does not exist in the registry.)])
Bicep.Core.IntegrationTests.AzTypesViaRegistryTests ‑ Repository_not_found_in_registry (ArtifactRegistryAddress { RegistryAddress = unknown.registry.azurecr.io, RepositoryPath = bicep/extensions/az, ExtensionVersion = 0.0.0-placeholder },System.AggregateException: Retry failed after 4 tries. Retry settings can be adjusted in ClientOptions.Retry or by configuring a custom retry policy in ClientOptions.RetryPolicy. (No such host is known. (unknown.registry.azurecr.io:443)) (No such host is known. (unknown.registry.azurecr.io:443)) (No such host is known. (unknown.registry.azurecr.io:443)) (No such host is known. (unknown.registry.azurecr.io:443))
   at Bicep.Core.Registry.AzureContainerRegistryManager.DownloadManifestAndLayersAsync(IOciArtifactReference artifactReference, ContainerRegistryContentClient client) in /home/runner/work/bicep/bicep/src/Bicep.Core/Registry/AzureContainerRegistryManager.cs:line 138
   at Bicep.Core.Registry.AzureContainerRegistryManager.<>c__DisplayClass4_0.<<PullArtifactAsync>g__DownloadManifestInternalAsync|0>d.MoveNext() in /home/runner/work/bicep/bicep/src/Bicep.Core/Registry/AzureContainerRegistryManager.cs:line 44
--- End of stack trace from previous location ---
   at Bicep.Core.Registry.AzureContainerRegistryManager.PullArtifactAsync(RootConfiguration configuration, IOciArtifactReference artifactReference) in /home/runner/work/bicep/bicep/src/Bicep.Core/Registry/AzureContainerRegistryManager.cs:line 51
   at Bicep.Core.Registry.AzureContainerRegistryManager.DownloadManifestAndLayersAsync(IOciArtifactReference artifactReference, ContainerRegistryContentClient client) in /home/runner/work/bicep/bicep/src/Bicep.Core/Registry/AzureContainerRegistryManager.cs:line 138
   at Bicep.Core.Registry.AzureContainerRegistryManager.<>c__DisplayClass4_0.<<PullArtifactAsync>g__DownloadManifestInternalAsync|0>d.MoveNext() in /home/runner/work/bicep/bicep/src/Bicep.Core/Registry/AzureContainerRegistryManager.cs:line 44
--- End of stack trace from previous location ---
   at Bicep.Core.Registry.AzureContainerRegistryManager.PullArtifactAsync(RootConfiguration configuration, IOciArtifactReference artifactReference) in /home/runner/work/bicep/bicep/src/Bicep.Core/Registry/AzureContainerRegistryManager.cs:line 63
   at Bicep.Core.Registry.OciArtifactRegistry.TryRestoreArtifactAsync(RootConfiguration configuration, OciArtifactReference reference) in /home/runner/work/bicep/bicep/src/Bicep.Core/Registry/OciArtifactRegistry.cs:line 495,[(BCP192, Error, Unable to restore the artifact with reference "br:unknown.registry.azurecr.io/bicep/extensions/az:0.0.0-placeholder": Retry failed after 4 tries. Retry settings can be adjusted in ClientOptions.Retry or by configuring a custom retry policy in ClientOptions.RetryPolicy. (No such host is known. (unknown.registry.azurecr.io:443)) (No such host is known. (unknown.registry.azurecr.io:443)) (No such host is known. (unknown.registry.azurecr.io:443)) (No such host is known. (unknown.registry.azurecr.io:443)))])
Bicep.Core.IntegrationTests.AzTypesViaRegistryTests ‑ Repository_not_found_in_registry (ArtifactRegistryAddress { RegistryAddress = unknown.registry.azurecr.io, RepositoryPath = bicep/extensions/az, ExtensionVersion = 0.0.0-placeholder },System.AggregateException: Retry failed after 4 tries. Retry settings can be adjusted in ClientOptions.Retry or by configuring a custom retry policy in ClientOptions.RetryPolicy. (No such host is known. (unknown.registry.azurecr.io:443)) (No such host is known. (unknown.registry.azurecr.io:443)) (No such host is known. (unknown.registry.azurecr.io:443)) (No such host is known. (unknown.registry.azurecr.io:443))
   at Bicep.Core.Registry.AzureContainerRegistryManager.DownloadManifestAndLayersAsync(IOciArtifactReference artifactReference, ContainerRegistryContentClient client) in D:\a\bicep\bicep\src\Bicep.Core\Registry\AzureContainerRegistryManager.cs:line 138
   at Bicep.Core.Registry.AzureContainerRegistryManager.<>c__DisplayClass4_0.<<PullArtifactAsync>g__DownloadManifestInternalAsync|0>d.MoveNext() in D:\a\bicep\bicep\src\Bicep.Core\Registry\AzureContainerRegistryManager.cs:line 44
--- End of stack trace from previous location ---
   at Bicep.Core.Registry.AzureContainerRegistryManager.PullArtifactAsync(RootConfiguration configuration, IOciArtifactReference artifactReference) in D:\a\bicep\bicep\src\Bicep.Core\Registry\AzureContainerRegistryManager.cs:line 51
   at Bicep.Core.Registry.AzureContainerRegistryManager.DownloadManifestAndLayersAsync(IOciArtifactReference artifactReference, ContainerRegistryContentClient client) in D:\a\bicep\bicep\src\Bicep.Core\Registry\AzureContainerRegistryManager.cs:line 138
   at Bicep.Core.Registry.AzureContainerRegistryManager.<>c__DisplayClass4_0.<<PullArtifactAsync>g__DownloadManifestInternalAsync|0>d.MoveNext() in D:\a\bicep\bicep\src\Bicep.Core\Registry\AzureContainerRegistryManager.cs:line 44
--- End of stack trace from previous location ---
   at Bicep.Core.Registry.AzureContainerRegistryManager.PullArtifactAsync(RootConfiguration configuration, IOciArtifactReference artifactReference) in D:\a\bicep\bicep\src\Bicep.Core\Registry\AzureContainerRegistryManager.cs:line 63
   at Bicep.Core.Registry.OciArtifactRegistry.TryRestoreArtifactAsync(RootConfiguration configuration, OciArtifactReference reference) in D:\a\bicep\bicep\src\Bicep.Core\Registry\OciArtifactRegistry.cs:line 495,[(BCP192, Error, Unable to restore the artifact with reference "br:unknown.registry.azurecr.io/bicep/extensions/az:0.0.0-placeholder": Retry failed after 4 tries. Retry settings can be adjusted in ClientOptions.Retry or by configuring a custom retry policy in ClientOptions.RetryPolicy. (No such host is known. (unknown.registry.azurecr.io:443)) (No such host is known. (unknown.registry.azurecr.io:443)) (No such host is known. (unknown.registry.azurecr.io:443)) (No such host is known. (unknown.registry.azurecr.io:443)))])
…

♻️ This comment has been updated with latest results.

@levimatheri levimatheri marked this pull request as ready for review January 3, 2025 16:20
@levimatheri levimatheri requested a review from Copilot January 3, 2025 16:54

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 6 out of 21 changed files in this pull request and generated no comments.

Files not reviewed (15)
  • src/Bicep.Core/TypeSystem/Providers/MicrosoftGraph/MicrosoftGraphResourceTypeProvider.cs: Evaluated as low risk
  • src/Bicep.Core/TypeSystem/Providers/Az/AzResourceTypeFactory.cs: Evaluated as low risk
  • src/Bicep.Core/TypeSystem/Providers/Az/AzResourceTypeProvider.cs: Evaluated as low risk
  • src/Bicep.Core/TypeSystem/Providers/K8s/K8sResourceTypeProvider.cs: Evaluated as low risk
  • src/Bicep.Core/TypeSystem/Providers/ThirdParty/ThirdPartyResourceTypeProvider.cs: Evaluated as low risk
  • src/Bicep.Core/TypeSystem/ArmTemplateTypeLoader.cs: Evaluated as low risk
  • src/Bicep.Core/TypeSystem/DeclaredTypeManager.cs: Evaluated as low risk
  • src/Bicep.Core/TypeSystem/Providers/ThirdParty/ExtensibilityResourceTypeFactory.cs: Evaluated as low risk
  • src/Bicep.LangServer.IntegrationTests/HoverTests.cs: Evaluated as low risk
  • src/Bicep.Core/TypeSystem/Types/NamespaceType.cs: Evaluated as low risk
  • src/Bicep.Core/TypeSystem/TypeValidator.cs: Evaluated as low risk
  • src/Bicep.Core.UnitTests/Utils/BuiltInTestTypes.cs: Evaluated as low risk
  • src/Bicep.Core/TypeSystem/TypeHelper.cs: Evaluated as low risk
  • src/Bicep.Core/TypeSystem/TypeCollapser.cs: Evaluated as low risk
  • src/Bicep.Core/TypeSystem/ResourceDerivedTypeResolver.cs: Evaluated as low risk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Description information not shown for any property name
1 participant