Skip to content

{Core} Add prebuilt command index/help index for core modules#32929

Merged
DanielMicrosoft merged 26 commits intoAzure:devfrom
DanielMicrosoft:xxxxx-prebuilt-command-index
Mar 25, 2026
Merged

{Core} Add prebuilt command index/help index for core modules#32929
DanielMicrosoft merged 26 commits intoAzure:devfrom
DanielMicrosoft:xxxxx-prebuilt-command-index

Conversation

@DanielMicrosoft
Copy link
Copy Markdown
Contributor

@DanielMicrosoft DanielMicrosoft commented Mar 6, 2026

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_index on/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 feature


This checklist is used to make sure that common guidelines for a pull request are followed.

@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd bot commented Mar 6, 2026

️✔️AzureCLI-FullTest
️✔️acr
️✔️latest
️✔️3.12
️✔️3.13
️✔️acs
️✔️latest
️✔️3.12
️✔️3.13
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.13
️✔️ams
️✔️latest
️✔️3.12
️✔️3.13
️✔️apim
️✔️latest
️✔️3.12
️✔️3.13
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.13
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️aro
️✔️latest
️✔️3.12
️✔️3.13
️✔️backup
️✔️latest
️✔️3.12
️✔️3.13
️✔️batch
️✔️latest
️✔️3.12
️✔️3.13
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.13
️✔️billing
️✔️latest
️✔️3.12
️✔️3.13
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️cdn
️✔️latest
️✔️3.12
️✔️3.13
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.13
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.13
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.13
️✔️config
️✔️latest
️✔️3.12
️✔️3.13
️✔️configure
️✔️latest
️✔️3.12
️✔️3.13
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.13
️✔️container
️✔️latest
️✔️3.12
️✔️3.13
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.13
️✔️core
️✔️latest
️✔️3.12
️✔️3.13
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.13
️✔️databoxedge
️✔️latest
️✔️3.12
️✔️3.13
️✔️dls
️✔️latest
️✔️3.12
️✔️3.13
️✔️dms
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.13
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.13
️✔️find
️✔️latest
️✔️3.12
️✔️3.13
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.13
️✔️identity
️✔️latest
️✔️3.12
️✔️3.13
️✔️iot
️✔️latest
️✔️3.12
️✔️3.13
️✔️keyvault
️✔️latest
️✔️3.12
️✔️3.13
️✔️lab
️✔️latest
️✔️3.12
️✔️3.13
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️maps
️✔️latest
️✔️3.12
️✔️3.13
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.13
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.13
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.13
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.13
️✔️network
️✔️latest
️✔️3.12
️✔️3.13
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.13
️✔️postgresql
️✔️latest
️✔️3.12
️✔️3.13
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.13
️✔️profile
️✔️latest
️✔️3.12
️✔️3.13
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.13
️✔️redis
️✔️latest
️✔️3.12
️✔️3.13
️✔️relay
️✔️latest
️✔️3.12
️✔️3.13
️✔️resource
️✔️latest
️✔️3.12
️✔️3.13
️✔️role
️✔️latest
️✔️3.12
️✔️3.13
️✔️search
️✔️latest
️✔️3.12
️✔️3.13
️✔️security
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.13
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.13
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.13
️✔️sql
️✔️latest
️✔️3.12
️✔️3.13
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.13
️✔️storage
️✔️latest
️✔️3.12
️✔️3.13
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.13
️✔️telemetry
️✔️latest
️✔️3.12
️✔️3.13
️✔️util
️✔️latest
️✔️3.12
️✔️3.13
️✔️vm
️✔️latest
️✔️3.12
️✔️3.13

@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd bot commented Mar 6, 2026

️✔️AzureCLI-BreakingChangeTest
️✔️Non Breaking Changes

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Mar 6, 2026

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 6, 2026

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).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.json and helpIndex.latest.json with azure-cli-core and 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.

Comment on lines +107 to +109
"demo": [
"azure.cli.command_modules.util"
],
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fun finding: there is no demo module from az -h.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@necusjz appears intentional that the command-level help exists but is suppressed from top-level help.

See:

with self.command_group('demo', deprecate_info=g.deprecate(hide=True)) as g:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i see, let's deprecate demo in the next comming breaking change window.

Comment on lines +6 to +12
"account": {
"summary": "Manage Azure subscription information.",
"tags": ""
},
"acr": {
"summary": "Manage private registries with Azure Container Registries.",
"tags": ""
Copy link
Copy Markdown
Member

@necusjz necusjz Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shall we consider to compress tags: ""? I.e., only introdue tags when it exists.

necusjz
necusjz previously approved these changes Mar 24, 2026
Copy link
Copy Markdown
Member

@necusjz necusjz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

naga-nandyala
naga-nandyala previously approved these changes Mar 24, 2026
Copy link
Copy Markdown
Contributor

@naga-nandyala naga-nandyala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New script inside /scripts folder..

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@DanielMicrosoft DanielMicrosoft dismissed stale reviews from naga-nandyala and necusjz via 4a45bef March 24, 2026 23:16
@DanielMicrosoft DanielMicrosoft requested a review from YanaXu as a code owner March 24, 2026 23:16
@naga-nandyala naga-nandyala self-requested a review March 25, 2026 00:40
@DanielMicrosoft DanielMicrosoft merged commit 40eea72 into Azure:dev Mar 25, 2026
49 checks passed
nddq pushed a commit to nddq/azure-cli that referenced this pull request Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Auto-Assign Auto assign by bot Core CLI core infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants