{Core} Add prebuilt command index/help index for core modules#32929
{Core} Add prebuilt command index/help index for core modules#32929DanielMicrosoft merged 26 commits intoAzure:devfrom
Conversation
️✔️AzureCLI-FullTest
|
️✔️AzureCLI-BreakingChangeTest
|
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
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>
|
0c276da to
3d173dc
Compare
There was a problem hiding this comment.
Pull request overview
Adds packaged “latest” command/help index assets to azure-cli-core and updates core index/help caching logic to use these prebuilt indices for faster startup on the latest cloud profile while keeping non-latest profiles on the existing local-index path.
Changes:
- Package
commandIndex.latest.jsonandhelpIndex.latest.jsonwithazure-cli-coreand add a generator/verification script. - Introduce separate session caches for extension command index + help overlays, and update command resolution/help index logic to blend packaged core data with extension overlays.
- Expand test coverage for latest vs non-latest behavior and add a pipeline job to verify generated assets stay in sync.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/azure-cli-core/setup.py | Ships the packaged latest index JSON files in the core wheel. |
| src/azure-cli-core/azure/cli/core/init.py | Implements packaged-index fast paths, extension overlays, and latest/non-latest branching behavior. |
| src/azure-cli-core/azure/cli/core/_session.py | Adds new Session() stores for extension index + help overlays. |
| src/azure-cli-core/azure/cli/core/mock.py | Ensures dummy CLI configs copy the additional index/help cache files. |
| src/azure-cli-core/azure/cli/core/tests/test_help.py | Updates/extends tests for help caching and latest packaged help behavior. |
| src/azure-cli-core/azure/cli/core/tests/test_command_registration.py | Adds tests for packaged-index command resolution and overlay behaviors. |
| src/azure-cli-core/azure/cli/core/commandIndex.latest.json | New packaged “latest” command-to-module map. |
| src/azure-cli-core/azure/cli/core/helpIndex.latest.json | New packaged “latest” top-level help summary map. |
| scripts/generate_latest_indices.py | New generator/verify script for the packaged latest assets. |
| azure-pipelines.yml | Adds CI verification job to detect drift in generated latest index files. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…resh, not core modules also
| "demo": [ | ||
| "azure.cli.command_modules.util" | ||
| ], |
There was a problem hiding this comment.
fun finding: there is no demo module from az -h.
There was a problem hiding this comment.
@necusjz appears intentional that the command-level help exists but is suppressed from top-level help.
See:
There was a problem hiding this comment.
i see, let's deprecate demo in the next comming breaking change window.
| "account": { | ||
| "summary": "Manage Azure subscription information.", | ||
| "tags": "" | ||
| }, | ||
| "acr": { | ||
| "summary": "Manage private registries with Azure Container Registries.", | ||
| "tags": "" |
There was a problem hiding this comment.
shall we consider to compress tags: ""? I.e., only introdue tags when it exists.
naga-nandyala
left a comment
There was a problem hiding this comment.
New script inside /scripts folder..
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
4a45bef
Related command
Description
This branch adds and validates a prebuilt latest-profile command/help indexing flow to speed up Azure CLI startup and help scenarios while preserving behavior: we now use packaged latest command/help indexes as the base, blend in installed-extension overlays, normalize top-level command handling, and apply smarter fallback logic so unknown commands avoid unnecessary full core reloads while still loading extensions when needed.
We also added a targeted refresh path for missing latest extension help overlay data, kept the logic best-effort and safe, and covered regressions with focused tests (including uppercase help and cached-help overlay refresh), plus line-ending hygiene for generated latest index JSON files to reduce CRLF/LF churn in PRs.
End-to-end manual validation with
core.use_command_indexon/off shows equivalent user-facing results with expected internal load-path/performance improvements.Loop doc
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.