[Storage] WIP: align CLI with storage TypeSpec migration - #33310
Libba Lawrence (l0lawrence) wants to merge 1 commit into
Conversation
Update generated enum module path (_azure_*_storage_enums -> _enums) and consolidate AccessTierOptional into AccessTier to match the storage TypeSpec migration. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Validation for Azure CLI Full Test Starting...
Thanks for your contribution! |
|
Validation for Breaking Change Starting...
Thanks for your contribution! |
|
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>
|
There was a problem hiding this comment.
🟡 Changes recommended
Update the SDK dependency pins or retain compatibility fallbacks, and restrict tier choices for standard blob commands.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Updates Storage CLI enum lookups for the TypeSpec-generated Azure Storage SDK layout.
Changes:
- Migrates blob and file-share lookups to
_generated.models._enums. - Replaces
AccessTierOptionalwithAccessTier. - Updates page-blob tier validation.
File summaries
| File | Review summary |
|---|---|
src/azure-cli/azure/cli/command_modules/storage/_params.py |
Updated enum lookups, but current SDK pins still use the old module paths. AccessTier also permits tiers invalid for standard blob rewrite commands. |
src/azure-cli/azure/cli/command_modules/storage/_validators.py |
Updated page-blob tier lookup, but the current blob SDK pin causes valid tier values to be rejected. |
Review details
Suppressed comments (2)
src/azure-cli/azure/cli/command_modules/storage/_params.py:231
AccessTieris broader than the enum previously used here: the migrated SDK class includesPremium(andSmart), while the oldAccessTierOptionaldid not. This sharedtier_typeis also used forstorage blob rewrite'sstandard_blob_tierargument, wherePremiumis not a valid standard tier, so--tier Premiumwill now pass CLI parsing and be sent as an invalid standard tier. Keep command-specific choices or filter the values for the standard-tier commands.
t_blob_tier = self.get_sdk('_generated.models._enums#AccessTier',
resource_type=ResourceType.DATA_STORAGE_BLOB)
src/azure-cli/azure/cli/command_modules/storage/_params.py:1934
- The file-share dependency remains pinned to
azure-storage-file-share==12.25.0b1, whose generated package still contains_azure_file_storage_enums.pyrather than_enums.py. Consequentlyget_sdkreturnsNonefor this lookup (and the laterModeCopyMode/OwnerCopyModelookups), so those arguments are registered without enum types until the matching migrated SDK is pinned.
t_delete_snapshot = self.get_sdk('_generated.models._enums#DeleteSnapshotsOptionType',
resource_type=ResourceType.DATA_STORAGE_FILESHARE)
- Files reviewed: 2/2 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| namespace.premium_page_blob_tier = getattr(cmd.get_models( | ||
| '_generated.models._azure_blob_storage_enums#PremiumPageBlobAccessTier'), namespace.tier) | ||
| '_generated.models._enums#PremiumPageBlobAccessTier'), namespace.tier) |
| t_rehydrate_priority = self.get_sdk('_generated.models._enums#RehydratePriority', | ||
| resource_type=ResourceType.DATA_STORAGE_BLOB) |
WIP / Draft — companion changes for the Azure Storage TypeSpec migration in azure-sdk-for-python.
The TSP-generated SDK renames the internal generated-enums module from
_azure_blob_storage_enums.py/_azure_file_storage_enums.pyto_enums.py, and consolidates the legacyAccessTierOptionalenum intoAccessTier. The CLI reaches into these private_generated.*paths viacmd.get_models(...)so it must be updated to follow the new layout.Changes
_params.py— 6 lookups updated to_generated.models._enums#X;AccessTierOptional→AccessTier_validators.py— 2 lookups updated to_generated.models._enums#XTracks SDK PRs: