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>
|
|
@yonzhan @evelyn-ys Please review this and get this merged ASAP |
az storage blob download-batch: Fix encoding str into byteaz storage blob download-batch: Fix encoding str into byte
az storage blob download-batch: Fix encoding str into byteaz storage blob download-batch/delete-batch: Fix incorrectly encoding str into byte
There was a problem hiding this comment.
Pull Request Overview
This PR fixes bugs in Azure CLI storage batch operations where strings were incorrectly being encoded to bytes, causing failures in blob download-batch and delete-batch commands. The fix removes unnecessary UTF-8 encoding logic and improves test coverage.
- Removes problematic UTF-8 encoding of blob names in the
collect_blob_objectsfunction - Refactors test structure to use
ScenarioTestinstead ofLiveScenarioTestfor better test reliability - Adds proper test isolation by using unique container names for each test scenario
Reviewed Changes
Copilot reviewed 2 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/azure-cli/azure/cli/command_modules/storage/util.py | Removes unnecessary UTF-8 encoding logic that was causing string-to-byte conversion issues |
| src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_batch_operations.py | Refactors tests to use ScenarioTest, adds proper container isolation, and reorganizes test classes |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| def create_and_populate_container(src_container): | ||
| self.storage_cmd('storage container create -n {}', storage_account_info, src_container) | ||
|
|
||
| # upload test files to storage account | ||
| self.storage_cmd('storage blob upload-batch -s "{}" -d {}', storage_account_info, test_dir, src_container) |
There was a problem hiding this comment.
[nitpick] The nested function create_and_populate_container is duplicated logic from the original test. Consider extracting this as a helper method of the test class to improve code reusability and maintainability.
Related command
Description
Fix #32039 #32091 #32088
Fixing incorrectly encoding a str into utf-8 which would make it a byte.
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.