Azure / Azure/azure-cli

Recording YAML shouldn't include `index.json` and `.whl` files

Open
#17,435 1 comment 0 reactions 2 assignees Claimed by @kairu-ms View on GitHub
act-observability-squad act-platform-engineering-squad act-quality-productivity-squad Core feature-request Monitor - Autoscale Network - Private Link Test Framework
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

**Describe the bug**

If an extension is installed by a command module in main repo, the recording `.yaml` file includes

https://github.com/Azure/azure-cli/blob/5b95a87f0294ee95feae1a43a14aa8e0656dea3a/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_private_link_resource_event_grid.yaml#L58

```yaml
uri: https://azcliextensionsync.blob.core.windows.net/index1/index.json
response:
body:
string: "{\n \"extensions\": {\n \"account\": [\n {\n \"downloadUrl\":
\"https://azurecliprod.blob.core.windows.net/cli-extensions/account-0.1.0-py2.py3-none-any.whl\",\n
\ \"filename\": \"account-0.1.0-py2.py3-none-any.whl\",\n \"metadata\":
{\n \"azext.isExperimental\": true,\n \"azext.minCliCoreVersion\":
```

https://github.com/Azure/azure-cli/blob/5b95a87f0294ee95feae1a43a14aa8e0656dea3a/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_private_link_resource_event_grid.yaml#L9287

```yaml
uri: https://azurecliprod.blob.core.windows.net/cli-extensions/eventgrid-0.4.9-py2.py3-none-any.whl
response:
body:
string: !!binary |
UEsDBBQAAAAIAA98slBejYsbowEAAKAEAAAbAAAAYXpleHRfZXZlbnRncmlkL19faW5pdF9fLnB5
tVLBauMwEL3rKwZyqA2pP6DgQ3DLspC0sO1daOVxokWWhDQuSZb9953EjoudTWEPnYONpPee3hvN
Au6/sMQCKh8O0Wx3BJnOYWN09Mk3xPsx+KjIeFfAylo4gxJETBjfsS6YuzYaXcIaOldjBNohbL6/
XbYLeEUcF7QnMO6MCdH/Qk0QvSdofATbY/icV21/J8t/aXLRRN+COnYRC21NoX1kAy1nJlgdK9+2
ytVp7RUnE2I4UEfck8R3dLSNpi7kDm0AWEA4WOPoAWqT1E+LZec67st9TxNCaKtSgqcT8RsTp/LZ
```

The sheer size makes GitHub unable to show and diff those files.

Affected files:

```
src/azure-cli/azure/cli/command_modules/monitor/tests/latest/recordings/test_monitor_autoscale_rule_for_spring_cloud.yaml
src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_private_endpoint_connection_event_grid_domain.yaml
src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_private_endpoint_connection_event_grid_topic.yaml
src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_private_link_resource_event_grid.yaml
```

**Possible solutions**

Either:

1. Totally block the installation of extensions in main repo modules' tests, as this will cause CI instability (e.g. #17434). These tests should be at least marked as `@live_only()`.

2. Any request to `https://azurecliprod.blob.core.windows.net/` should be patched and removed, like `ResourceGroupPreparer`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.