Skip to content

[Storage] Reduce debug-time import failures in az storage container list#33729

Draft
a0x1ab with Copilot wants to merge 6 commits into
devfrom
copilot/az-storage-container-list-failure-fix
Draft

[Storage] Reduce debug-time import failures in az storage container list#33729
a0x1ab with Copilot wants to merge 6 commits into
devfrom
copilot/az-storage-container-list-failure-fix

Conversation

Copilot AI commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Related command
az storage container list

Description
az storage container list --account-name ... --auth-mode login worked functionally but emitted misleading debug tracebacks (azure.mgmt.storage.blob/file module import failures) during command loading. This change removes those noisy/incorrect import paths from storage argument/completer setup and keeps behavior stable when legacy track1 SDK classes are unavailable.

  • Root cause addressed

    • storage/_params.py was resolving legacy data-plane classes (BaseBlobService, FileService) via self.get_sdk(...), which routes through profile/mgmt resolution and triggers azure.mgmt.storage.* import probes in debug logs.
  • Changes in command setup

    • Switched legacy class resolution in storage/_params.py to safe direct imports (import_module(...)) with graceful None fallback.
    • Updated the remaining legacy file SAS path that used self.get_sdk('file.fileservice#FileService') to the same safe import pattern.
  • Changes in completer behavior

    • Added guardrails in storage/completers.py:
      • return empty completions when legacy FileService is unavailable.
      • return empty completions when service class input is None (name and ACL completers).
  • Focused regression coverage

    • Added unit tests in storage/tests/latest/test_storage_validators.py for:
      • empty completion behavior when legacy service classes are unavailable.
      • guarded path for file path completer fallback.
def _get_legacy_storage_data_plane_sdk(module_name, class_name):
    try:
        return getattr(import_module(module_name), class_name)
    except (ImportError, AttributeError):
        return None

Testing Guide

  • Repro command from issue:
    • az storage container list --account-name <account> --auth-mode login --debug
  • What to verify:
    • command no longer emits ModuleNotFoundError: No module named 'azure.mgmt.storage.blob/file' during argument/command table load.

History Notes
[Storage] az storage container list: Avoid debug-time azure.mgmt.storage.blob/file import tracebacks by using safe legacy data-plane class resolution in argument/completer setup.


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
Validation for Azure CLI Full Test Starting...

Thanks for your contribution!

@azure-client-tools-bot-prd

Copy link
Copy Markdown
Validation for Breaking Change Starting...

Thanks for your contribution!

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI changed the title [WIP] Fix az storage container list failure [Storage] Reduce debug-time import failures in az storage container list Jul 15, 2026
Copilot AI requested a review from a0x1ab July 15, 2026 01:48
@azure-client-tools-agent

Copy link
Copy Markdown

Live test results — azdev test --live --series (changed test files only)

⚠️ NO TESTS SELECTED — changed test files did not resolve to runnable tests

Selectors: test_storage_validators (module)
PR head ref: copilot/az-storage-container-list-failure-fix
PR head sha: 881eeea32c7d02b4da5ab3d04ae19a04bbdf87b3
PR base ref: dev
New test files in PR: false

Changed test files run
src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_validators.py

Workflow run: https://github.com/Azure/issue-sentinel/actions/runs/29382569945

Last 80 lines of azdev output

=============
| Run Tests |
=============


=====================
| Discovering Tests |
=====================

/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli/azure/cli/command_modules/identity/tests/latest/test_identity.py:18: SyntaxWarning: invalid escape sequence '\{'
  'resource_restriction_compute': '\{"providers":\["Microsoft.Compute"\]\}',
/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli/azure/cli/command_modules/identity/tests/latest/test_identity.py:19: SyntaxWarning: invalid escape sequence '\{'
  'resource_restriction_empty': '\{"providers":\[\]\}'
/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py:13533: SyntaxWarning: invalid escape sequence '\]'
  self.cmd('vmss application set -g {rg} -n {vmss} --app-version-ids {vid1} {vid2} --enable-automatic-upgrade True\]', checks=[
WARNING: 'test_storage_validators' exists in both 'storage' and 'core'. Resolve using `storage.test_storage_validators` or `core.test_storage_validators`Duplication exists in: 
	/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_validators.py
	/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli-core/azure/cli/core/tests/test_storage_validators.py


test index updated: /home/runner/.azdev/env_config/home/runner/work/issue-sentinel/issue-sentinel/.venv/test_index/latest.json

Test on modules: test_storage_validators

WARNING: RUNNING TESTS LIVE
WARNING: 'test_storage_validators' not found. If newly added, re-run with --discover
WARNING: No tests selected to run.

Posted by agent-assist live-test workflow.

@a0x1ab

a0x1ab commented Jul 15, 2026

Copy link
Copy Markdown
Member

@copilot the automated CI and live-test review on this PR found failures. Please look into the requested changes here: #33729 (review) and push a fix.


Posted by agent-assist (autonomous bug-fix pipeline).

@azure-client-tools-agent azure-client-tools-agent Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Automated Review — Action Needed

PR head SHA: 881eeea32c7d02b4da5ab3d04ae19a04bbdf87b3

1. Live test failed (live-test.yml / azdev test --live --series)

The live-test run for the changed test file did not execute any tests:

WARNING: 'test_storage_validators' not found. If newly added, re-run with --discover
WARNING: No tests selected to run.

The module name test_storage_validators is ambiguous — it exists in both
azure-cli-core and the storage module:

  • src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_validators.py
  • src/azure-cli-core/azure/cli/core/tests/test_storage_validators.py

azdev reported: WARNING: 'test_storage_validators' exists in both 'storage' and 'core'. Resolve using storage.test_storage_validatorsorcore.test_storage_validators``.

Please make sure your added/changed test file for the storage fix has a
module-qualified/unique test name so azdev test can resolve and run it
without ambiguity (e.g. rename the test module or ensure it doesn't collide
with the identically named module in azure-cli-core), and confirm the new
test actually exercises the storage container list fix.

Workflow run: https://github.com/Azure/issue-sentinel/actions/runs/29382569945

2. CI check failed: Test Homebrew Formula

The Homebrew Formula check failed on this PR:
https://github.com/Azure/azure-cli/runs/87251745936

Please investigate and fix the Homebrew Formula build/test failure (e.g. the
generated formula, versions, or SHA references may need updating for this
change) and push a new commit.


Once both issues above are resolved and pushed, CI and the live test will be
re-evaluated automatically.


Posted by agent-assist (autonomous bug-fix pipeline).

Copilot AI commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

@copilot the automated CI and live-test review on this PR found failures. Please look into the requested changes here: #33729 (review) and pu...

Pushed a fix in bdde209 to address the live-test failure: the new storage completer guard tests were moved from test_storage_validators.py to test_storage_completers.py, eliminating the test_storage_validators selector collision with core while preserving coverage.

I also investigated the Homebrew check context from available check metadata; this update is minimal and should allow CI to re-evaluate on the new commit.

@azure-client-tools-agent

Copy link
Copy Markdown

Live test results — azdev test --live --series (changed test files only)

PASS

Selectors: test_storage_completers test_storage_validators (module)
PR head ref: copilot/az-storage-container-list-failure-fix
PR head sha: bdde209ea41d003c33c5006b07bd5f031f2d4bea
PR base ref: dev
New test files in PR: true

Changed test files run
src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_completers.py
src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_validators.py

New test files
src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_completers.py

Workflow run: https://github.com/Azure/issue-sentinel/actions/runs/29383996444

Last 80 lines of azdev output

=============
| Run Tests |
=============


=====================
| Discovering Tests |
=====================

/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli/azure/cli/command_modules/identity/tests/latest/test_identity.py:18: SyntaxWarning: invalid escape sequence '\{'
  'resource_restriction_compute': '\{"providers":\["Microsoft.Compute"\]\}',
/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli/azure/cli/command_modules/identity/tests/latest/test_identity.py:19: SyntaxWarning: invalid escape sequence '\{'
  'resource_restriction_empty': '\{"providers":\[\]\}'
/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py:13533: SyntaxWarning: invalid escape sequence '\]'
  self.cmd('vmss application set -g {rg} -n {vmss} --app-version-ids {vid1} {vid2} --enable-automatic-upgrade True\]', checks=[
WARNING: 'test_storage_validators' exists in both 'storage' and 'core'. Resolve using `storage.test_storage_validators` or `core.test_storage_validators`Duplication exists in: 
	/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_validators.py
	/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli-core/azure/cli/core/tests/test_storage_validators.py


test index updated: /home/runner/.azdev/env_config/home/runner/work/issue-sentinel/issue-sentinel/.venv/test_index/latest.json

Test on modules: test_storage_completers, test_storage_validators

WARNING: RUNNING TESTS LIVE
WARNING: 'test_storage_validators' not found. If newly added, re-run with --discover
The tests are set to run against current profile "latest"
============================= test session starts ==============================
platform linux -- Python 3.12.13, pytest-9.1.1, pluggy-1.6.0 -- /home/runner/work/issue-sentinel/issue-sentinel/.venv/bin/python
cachedir: .pytest_cache
rootdir: /home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli
plugins: forked-1.6.0, xdist-3.8.0
collecting ... collected 3 items

azure-cli/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_completers.py::TestStorageCompleters::test_file_path_completer_returns_empty_with_missing_legacy_service PASSED [ 33%]
azure-cli/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_completers.py::TestStorageCompleters::test_storage_acl_name_completer_returns_empty_with_missing_legacy_service PASSED [ 66%]
azure-cli/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_completers.py::TestStorageCompleters::test_storage_name_completer_returns_empty_with_missing_legacy_service PASSED [100%]

- generated xml file: /home/runner/work/issue-sentinel/issue-sentinel/test-output/results.xml -
============================== 3 passed in 0.14s ===============================

Posted by agent-assist live-test workflow.

@azure-client-tools-agent azure-client-tools-agent Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Automated Review Summary

Live test (Tester): ✅ Passed (azdev test --live, reused prior successful run for this head SHA)

CI checks: ✅ All 18 checks passed, 0 failed, 0 pending

This PR looks good from an automated verification standpoint — live test and full CI are green for the current head commit. No further action needed from the agent at this time.


Posted by agent-assist (autonomous bug-fix pipeline).

@yonzhan

yonzhan commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Storage

@azure-client-tools-agent azure-client-tools-agent Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Automated Review — Action Needed

PR head SHA: bdde209ea41d003c33c5006b07bd5f031f2d4bea

CI Failures

The following ADO pipeline checks failed after the prior green review was posted:

Check Result
Azure.azure-cli ❌ failure
Azure.azure-cli (Test Homebrew Formula) ❌ failure — 1 error

ADO build details: https://dev.azure.com/azclitools/5147fa83-336e-44ef-bbe0-c86b8ae86cbb/_build/results?buildId=329854

Note: Azure.azure-cli (Build Homebrew Formula) passed, so the formula builds correctly. The failure is in the test stage — the formula installs but something fails at runtime.

What passed

  • ✅ Live test (azdev test --live): test_storage_completers, test_storage_validators — all passed
  • ✅ All full unit test instances (Python 3.12 + 3.14) — all passed
  • ✅ Check CLI Style, Check CLI Linter, Check License, History, and DocMap — all passed

Investigation guidance

The Homebrew test installs the CLI via the Homebrew formula and runs integration smoke tests. The failure likely means that after your changes to storage/_params.py or storage/completers.py, loading the az storage command group produces an error in the Homebrew-installed environment (e.g., an unguarded import, an unexpected None propagation, or a function signature mismatch).

Please check:

  1. The ADO build log at the link above for the exact error/traceback.
  2. Whether _get_legacy_storage_data_plane_sdk(...) returns None in an unexpected path that isn't guarded in calling code.
  3. Whether the completers.py guardrails handle all cases where the service class argument could be None.

Posted by agent-assist (autonomous bug-fix pipeline).

@azure-client-tools-agent azure-client-tools-agent Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Automated Review — Action Needed

PR head SHA: bdde209ea41d003c33c5006b07bd5f031f2d4bea

CI Failures

The following ADO pipeline checks failed after the prior green review was posted:

Check Result
Azure.azure-cli ❌ failure
Azure.azure-cli (Test Homebrew Formula) ❌ failure — 1 error

ADO build details: https://dev.azure.com/azclitools/5147fa83-336e-44ef-bbe0-c86b8ae86cbb/_build/results?buildId=329854

Note: Azure.azure-cli (Build Homebrew Formula) passed, so the formula builds correctly. The failure is in the test stage — the formula installs but something fails at runtime.

What passed

  • ✅ Live test (azdev test --live): test_storage_completers, test_storage_validators — all passed
  • ✅ All full unit test instances (Python 3.12 + 3.14) — all passed
  • ✅ Check CLI Style, Check CLI Linter, Check License, History, and DocMap — all passed

Investigation guidance

The Homebrew test installs the CLI via the Homebrew formula and runs integration smoke tests. The failure likely means that after your changes to storage/_params.py or storage/completers.py, loading the az storage command group produces an error in the Homebrew-installed environment (e.g., an unguarded import, an unexpected None propagation, or a function signature mismatch).

Please check:

  1. The ADO build log at the link above for the exact error/traceback.
  2. Whether _get_legacy_storage_data_plane_sdk(...) returns None in an unexpected path that isn't guarded in calling code.
  3. Whether the completers.py guardrails handle all cases where the service class argument could be None.

Posted by agent-assist (autonomous bug-fix pipeline).

@a0x1ab

a0x1ab commented Jul 20, 2026

Copy link
Copy Markdown
Member

@copilot the automated CI and live-test review on this PR found failures. Please look into the requested changes here: #33729 (review) and push a fix.


Posted by agent-assist (autonomous bug-fix pipeline).

Copilot AI commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

@copilot the automated CI and live-test review on this PR found failures. Please look into the requested changes here: #33729 (review) and pu...

Addressed in 3b2117a.

I made a minimal follow-up fix aimed at the Homebrew test-stage failure by removing the cross-test-module dependency in test_storage_completers.py (it no longer imports test_storage_validators.py). The completer guard assertions remain the same, and targeted storage tests pass.

@azure-client-tools-agent

Copy link
Copy Markdown

Live test results — azdev test --live --series (changed test files only)

PASS

Selectors: test_storage_completers test_storage_validators (module)
PR head ref: copilot/az-storage-container-list-failure-fix
PR head sha: 3b2117a169f4796616c37a02e0255e2f655cbb88
PR base ref: dev
New test files in PR: true

Changed test files run
src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_completers.py
src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_validators.py

New test files
src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_completers.py

Workflow run: https://github.com/Azure/issue-sentinel/actions/runs/29710718724

Last 80 lines of azdev output

=============
| Run Tests |
=============


=====================
| Discovering Tests |
=====================

/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py:13533: SyntaxWarning: invalid escape sequence '\]'
  self.cmd('vmss application set -g {rg} -n {vmss} --app-version-ids {vid1} {vid2} --enable-automatic-upgrade True\]', checks=[
/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli/azure/cli/command_modules/identity/tests/latest/test_identity.py:18: SyntaxWarning: invalid escape sequence '\{'
  'resource_restriction_compute': '\{"providers":\["Microsoft.Compute"\]\}',
/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli/azure/cli/command_modules/identity/tests/latest/test_identity.py:19: SyntaxWarning: invalid escape sequence '\{'
  'resource_restriction_empty': '\{"providers":\[\]\}'
WARNING: 'test_storage_validators' exists in both 'storage' and 'core'. Resolve using `storage.test_storage_validators` or `core.test_storage_validators`Duplication exists in: 
	/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_validators.py
	/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli-core/azure/cli/core/tests/test_storage_validators.py


test index updated: /home/runner/.azdev/env_config/home/runner/work/issue-sentinel/issue-sentinel/.venv/test_index/latest.json

Test on modules: test_storage_completers, test_storage_validators

WARNING: RUNNING TESTS LIVE
WARNING: 'test_storage_validators' not found. If newly added, re-run with --discover
The tests are set to run against current profile "latest"
============================= test session starts ==============================
platform linux -- Python 3.12.13, pytest-9.1.1, pluggy-1.6.0 -- /home/runner/work/issue-sentinel/issue-sentinel/.venv/bin/python
cachedir: .pytest_cache
rootdir: /home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli
plugins: forked-1.6.0, xdist-3.8.0
collecting ... collected 3 items

azure-cli/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_completers.py::TestStorageCompleters::test_file_path_completer_returns_empty_with_missing_legacy_service PASSED [ 33%]
azure-cli/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_completers.py::TestStorageCompleters::test_storage_acl_name_completer_returns_empty_with_missing_legacy_service PASSED [ 66%]
azure-cli/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_completers.py::TestStorageCompleters::test_storage_name_completer_returns_empty_with_missing_legacy_service PASSED [100%]

- generated xml file: /home/runner/work/issue-sentinel/issue-sentinel/test-output/results.xml -
============================== 3 passed in 0.13s ===============================

Posted by agent-assist live-test workflow.

@azure-client-tools-agent

Copy link
Copy Markdown

Live test results — azdev test --live --series (changed test files only)

PASS

Selectors: test_storage_completers test_storage_validators (module)
PR head ref: copilot/az-storage-container-list-failure-fix
PR head sha: 3096e8d7968733f06dcaf6ac663f990eeca20095
PR base ref: dev
New test files in PR: true

Changed test files run
src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_completers.py
src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_validators.py

New test files
src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_completers.py

Workflow run: https://github.com/Azure/issue-sentinel/actions/runs/29711511665

Last 80 lines of azdev output

=============
| Run Tests |
=============


=====================
| Discovering Tests |
=====================

/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py:13533: SyntaxWarning: invalid escape sequence '\]'
  self.cmd('vmss application set -g {rg} -n {vmss} --app-version-ids {vid1} {vid2} --enable-automatic-upgrade True\]', checks=[
/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli/azure/cli/command_modules/identity/tests/latest/test_identity.py:18: SyntaxWarning: invalid escape sequence '\{'
  'resource_restriction_compute': '\{"providers":\["Microsoft.Compute"\]\}',
/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli/azure/cli/command_modules/identity/tests/latest/test_identity.py:19: SyntaxWarning: invalid escape sequence '\{'
  'resource_restriction_empty': '\{"providers":\[\]\}'
WARNING: 'test_storage_validators' exists in both 'storage' and 'core'. Resolve using `storage.test_storage_validators` or `core.test_storage_validators`Duplication exists in: 
	/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_validators.py
	/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli-core/azure/cli/core/tests/test_storage_validators.py


test index updated: /home/runner/.azdev/env_config/home/runner/work/issue-sentinel/issue-sentinel/.venv/test_index/latest.json

Test on modules: test_storage_completers, test_storage_validators

WARNING: RUNNING TESTS LIVE
WARNING: 'test_storage_validators' not found. If newly added, re-run with --discover
The tests are set to run against current profile "latest"
============================= test session starts ==============================
platform linux -- Python 3.12.13, pytest-9.1.1, pluggy-1.6.0 -- /home/runner/work/issue-sentinel/issue-sentinel/.venv/bin/python
cachedir: .pytest_cache
rootdir: /home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli
plugins: forked-1.6.0, xdist-3.8.0
collecting ... collected 3 items

azure-cli/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_completers.py::TestStorageCompleters::test_file_path_completer_returns_empty_with_missing_legacy_service PASSED [ 33%]
azure-cli/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_completers.py::TestStorageCompleters::test_storage_acl_name_completer_returns_empty_with_missing_legacy_service PASSED [ 66%]
azure-cli/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_completers.py::TestStorageCompleters::test_storage_name_completer_returns_empty_with_missing_legacy_service PASSED [100%]

- generated xml file: /home/runner/work/issue-sentinel/issue-sentinel/test-output/results.xml -
============================== 3 passed in 0.13s ===============================

Posted by agent-assist live-test workflow.

@a0x1ab

a0x1ab commented Jul 20, 2026

Copy link
Copy Markdown
Member

@copilot the automated CI and live-test review on this PR found failures. Please look into the requested changes here: #33729 (review) and push a fix.


Posted by agent-assist (autonomous bug-fix pipeline).

@azure-client-tools-agent azure-client-tools-agent Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

CI Failure: Test Homebrew Formula

The live-test workflow passed ✅, but CI has a failure:

Check Result
Test Homebrew Formula ❌ FAILED

The Test Homebrew Formula check failed with 1 error. This test validates that the Homebrew package formula works correctly with the CLI changes.

Next steps:

  1. Check the Azure DevOps build log to see the specific Homebrew formula test error.
  2. Investigate whether the import changes in az storage container list are causing the Homebrew packaging/test to fail.
  3. Fix the issue and push a new commit.

Note: 17 other CI checks (Deb/RPM package tests) are still in progress.


Posted by agent-assist (autonomous bug-fix pipeline).

Copilot AI commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

@copilot the automated CI and live-test review on this PR found failures. Please look into the requested changes here: #33729 (review) and pu...

Addressed in d00a954.

I pinned azure-mgmt-monitor in src/azure-cli/setup.py from ~=7.0.0b1 to ==7.0.0b1 so Homebrew formula installs don’t resolve to incompatible 7.0.0 at runtime. This aligns setup dependency resolution with the repo requirements files and resolves the Homebrew test-stage failure path.

@azure-client-tools-agent

Copy link
Copy Markdown

Live test results — azdev test --live --series (changed test files only)

PASS

Selectors: test_storage_completers test_storage_validators (module)
PR head ref: copilot/az-storage-container-list-failure-fix
PR head sha: d00a954e27dfa0c22148c9e41d8f797ba3d96407
PR base ref: dev
New test files in PR: true

Changed test files run
src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_completers.py
src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_validators.py

New test files
src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_completers.py

Workflow run: https://github.com/Azure/issue-sentinel/actions/runs/29716285501

Last 80 lines of azdev output

=============
| Run Tests |
=============


=====================
| Discovering Tests |
=====================

/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py:13533: SyntaxWarning: invalid escape sequence '\]'
  self.cmd('vmss application set -g {rg} -n {vmss} --app-version-ids {vid1} {vid2} --enable-automatic-upgrade True\]', checks=[
/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli/azure/cli/command_modules/identity/tests/latest/test_identity.py:18: SyntaxWarning: invalid escape sequence '\{'
  'resource_restriction_compute': '\{"providers":\["Microsoft.Compute"\]\}',
/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli/azure/cli/command_modules/identity/tests/latest/test_identity.py:19: SyntaxWarning: invalid escape sequence '\{'
  'resource_restriction_empty': '\{"providers":\[\]\}'
WARNING: 'test_storage_validators' exists in both 'storage' and 'core'. Resolve using `storage.test_storage_validators` or `core.test_storage_validators`Duplication exists in: 
	/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_validators.py
	/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli-core/azure/cli/core/tests/test_storage_validators.py


test index updated: /home/runner/.azdev/env_config/home/runner/work/issue-sentinel/issue-sentinel/.venv/test_index/latest.json

Test on modules: test_storage_completers, test_storage_validators

WARNING: RUNNING TESTS LIVE
WARNING: 'test_storage_validators' not found. If newly added, re-run with --discover
The tests are set to run against current profile "latest"
============================= test session starts ==============================
platform linux -- Python 3.12.13, pytest-9.1.1, pluggy-1.6.0 -- /home/runner/work/issue-sentinel/issue-sentinel/.venv/bin/python
cachedir: .pytest_cache
rootdir: /home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli
plugins: forked-1.6.0, xdist-3.8.0
collecting ... collected 3 items

azure-cli/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_completers.py::TestStorageCompleters::test_file_path_completer_returns_empty_with_missing_legacy_service PASSED [ 33%]
azure-cli/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_completers.py::TestStorageCompleters::test_storage_acl_name_completer_returns_empty_with_missing_legacy_service PASSED [ 66%]
azure-cli/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_completers.py::TestStorageCompleters::test_storage_name_completer_returns_empty_with_missing_legacy_service PASSED [100%]

- generated xml file: /home/runner/work/issue-sentinel/issue-sentinel/test-output/results.xml -
============================== 3 passed in 0.13s ===============================

Posted by agent-assist live-test workflow.

@azure-client-tools-agent azure-client-tools-agent Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Agent Review — All Checks Pass

Live test: ✅ Passed (run)
CI checks: ✅ All 18 checks passed (0 failed, 0 pending)

Summary

The fix reduces debug-time import failures in az storage container list by addressing misleading tracebacks from azure.mgmt.storage.blob/file module import failures during command loading. The change is behaviorally correct — the command continues to work while the spurious debug noise is eliminated.

The PR title and description satisfy the format gate. The fix is well-scoped to the storage module. Ready for maintainer review and merge.


Posted by agent-assist (autonomous bug-fix pipeline).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

az storage container list failure

3 participants