Azure / bicep

Bicep is a declarative language for describing and deploying Azure resources
MIT License
3.26k stars 753 forks source link

Support partial public registry completions #15646

Closed anthony-c-martin closed 1 day ago

anthony-c-martin commented 1 day ago

Add support for typing a partial path and looking for completions:

image

Microsoft Reviewers: Open in CodeFlow
github-actions[bot] commented 1 day ago

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

VSCode - Mac/Linux ```sh bash <(curl -Ls https://aka.ms/bicep/nightly-vsix.sh) --run-id 11950460183 ``` - Windows ```powershell iex "& { $(irm https://aka.ms/bicep/nightly-vsix.ps1) } -RunId 11950460183" ```
Azure CLI - Mac/Linux ```sh bash <(curl -Ls https://aka.ms/bicep/nightly-cli.sh) --run-id 11950460183 ``` - Windows ```powershell iex "& { $(irm https://aka.ms/bicep/nightly-cli.ps1) } -RunId 11950460183" ```
github-actions[bot] commented 1 day ago

Dotnet Test Results

    78 files   -     39      78 suites   - 39   30m 35s ⏱️ - 14m 15s 11 434 tests  -      6  11 434 ✅  -      5  0 💤 ±0  0 ❌  - 1  26 599 runs   - 13 238  26 599 ✅  - 13 237  0 💤 ±0  0 ❌  - 1 

Results for commit a9bad413. ± Comparison against base commit cd32858d.

This pull request removes 1843 and adds 650 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 ��A\u000b�0\u0014\u0007��\u0014�\u0007�ۜ�3�\u0010t�\u0008\u000b��1r��\u0016j �囇�P�E-h���`o\u001b����j\u0016Z���0\u0000�0�\u001d1\u0004�o�[�KD�\u0003AD\u0006�!�4����Zժ4��q�\u000fb�:�uD��(P\u0006\u000cC(C\u000011{��=\u001a:\u0017U\u001f��Hu�Oչh���o_�������S� ���\u0000*\u0003i�\u0018""\u0010���(������8��V�|�ܮ\u0013w� ��,˲���\u0001mqh�\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 �0\u0010\u0006�=E�\u0001�<�(t�Fp�\u0001b;b���V(�w7]�\u000b-n�\u0010̷�\u000cd����[ۮ��P��\u0018\u0019\u001248�DR~\�0�\u0011�O\u0014Q�(G\u0008�Ï��Z7�r�L��\u000f�\u0006�&�!fZpf\u00187�0ʹPr�jI_�-qi�c�\u0015)��T_��=�k���^����wE��O�D�\u000f`Zi�&\u0010�T�\�'������]\u0001m I\u0003�\u0006�=T� \u001f칆�ܳy��y�y\u0000�¡\u001b\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 ��M �0\u0010\u0005�=EO���$\u0013\u0017ݻ� A\u000b��Tl�\u0005��\u000bA��Mm\u0005�-3\u00192Ix<ݸv��]~���*�lt"0J��w��@O� R�\u0019K��Gy�T���Q�8�\u0007I���P�\u0019h)a!-��\u0018�ՋP�\u000e֐�]��\u001a����cU���\u0018j���Q�����\u0013}ʿ\u0010�A\u0011HS؆�(\u0013�?I&�<����\u0013DQ\u0014Esx\u0000R3'.\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��K �0\u0010\u0006�{�� fb��\u000b�]� � \udbc7\udc58�B�ݫB�\u000b�\u001b���[f\u0018f��doڝ5G[y&�\$�̍w����=P@\u0000_8ᨤ&���o2���T�*K��A"�&�\u000b�\u0003�\u00022\u0000�L�R"f��v��\u0001��p�kwue��ŗ�o(�\u001a��h4��~ߚ�)��\u000b\u0002\u0012\u0001\u0015j1�\u001f��/��?�����\u0006Q\u0014E�\u001a�ՠ\u000bm\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\u000c\u0000��}��\u0007�M�����\u0017��\u000fP��\u00137�6a ���A�lxُ`�c\u0013HJH�zo�-�\u0014�����5#c� ���\u000e\u0004��~�k)}Bh;z'=�uc*��\u001c�~�\u0008�i�\u001ccо�\u0010�\u001c�\u0014J�\u001aV6�\u000c� ��i�qV�زK}+��|(}�o:\u0003>�Ʒ��~@� \u0000-�\u0012\u001a\u0008WR�l:�N���?�w(�-1i0�a~���Г���\�7�q\u001cg:/q\u001e�8\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���\u000b�0\u0014\u0007��+�?`ns���C�!#,\u0008���A\u0006Z���?�c__DisplayClass4_0.<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.<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 499,[(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.<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.<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 499,[(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)))]) … ```

:recycle: This comment has been updated with latest results.