-
Notifications
You must be signed in to change notification settings - Fork 3.3k
{Core} Add CommandPreserveCasing and CommandIndexRebuild telemetry properties for command rebuild analysis #32451
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
base: dev
Are you sure you want to change the base?
Conversation
️✔️AzureCLI-FullTest
|
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
Hi @DanielMicrosoft, |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
️✔️AzureCLI-BreakingChangeTest
|
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds two new telemetry properties to support command rebuild analysis: CommandPreserveCasing (preserving the original casing of user-entered commands) and CmdIdxRebuildTriggered (indicating whether command index rebuild was triggered during execution).
Key Changes
- Added
roughly_parse_command_with_casing()utility function to parse commands while preserving original casing, complementing the existingroughly_parse_command()function - Updated telemetry session to track two new properties for command rebuild analysis
- Added comprehensive unit tests for both the existing and new command parsing functions
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/azure-cli-core/azure/cli/core/util.py | Added new roughly_parse_command_with_casing() function to extract command parts while preserving original user input casing |
| src/azure-cli-core/azure/cli/core/tests/test_util.py | Added comprehensive unit tests for both roughly_parse_command() and roughly_parse_command_with_casing(), including security tests to ensure sensitive flag values aren't captured |
| src/azure-cli-core/azure/cli/core/telemetry.py | Added two new telemetry properties (command_preserve_casing and cmd_idx_rebuild_triggered) with supporting functions to track command rebuild metrics |
| src/azure-cli-core/azure/cli/core/commands/init.py | Updated command execution to capture command with preserved casing early in the pipeline and pass it to telemetry tracking |
| src/azure-cli-core/azure/cli/core/init.py | Added telemetry tracking when module discovery triggers command index rebuild |
| .vscode/launch.json | Updated debug configuration to use debugpy type and removed deprecated debugOptions (appears unrelated to the PR's main purpose) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Related command
Description
ADO Task: https://msazure.visualstudio.com/One/_workitems/edit/35931568
Checklist:
helpcommand--helpcommandHelpcommand (does it case/re-build?)--Helpcommand (does it case/re-build?)--version(does it case/re-build?)--Versioncommand (does it case/re-build?)versioncommand (does it case/re-build?)Versioncommand (does it case/re-build?)Verify with
something help/--helpAdd meaningful tests for above conditions.
Testing Guide
History Notes
[Component Name 1] BREAKING CHANGE:
az command a: Make some customer-facing breaking change[Component Name 2]
az command b: Add some customer-facing featureThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.