Azure / Azure/azure-cli

No telemetry data for autocomplete

Open
#25,943 1 comment 0 reactions 2 assignees Claimed by @jiasli View on GitHub
act-platform-engineering-squad Azure CLI Team Core feature-request
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

**Describe the bug**

In general, telemetry data is uploaded by `telemetry.conclude()` in `__main__.py`.
However, if autocomplate is enabled. `argcomplate` will call `os._exit` method after printing completion.
https://github.com/kislyuk/argcomplete/blob/bf16566adcfb2fd0307c6ecdf24304b21b0b5752/argcomplete/__init__.py#L139-L141
`os._exit` prevents the execution of `finally` code block in `__main__.py`.

Adding `exit_method=sys.exit` can fix this bug, but the completion is slowed by **90ms** (260 -> 350), which is a noticeable delay in autocomplete.
https://github.com/Azure/azure-cli/blob/37053a386dfcce2f78277e1667fc84b80b6b5feb/src/azure-cli-core/azure/cli/core/parser.py#L204

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.