Repository navigation
Quantum: Remove the unused job --storage option and legacy SDK storage support - #10541
v-elegacheva wants to merge 15 commits into
Conversation
Save CLI and vendored SDK removal, regression tests, and migration guidance. New changes have not been tested.
|
Thank you for your contribution v-elegacheva! We will review the pull request and get back to you soon. |
Keep workspace creation changes owned by PR Azure#10478 and preserve the standalone job storage removal. Rename the shared command-parser test helper to reflect its workspace and job usage.
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the change removing per-job storage overrides in favor of workspace-linked storage.
No open issues 🎉
What changed in this PR
Removes the unused per-job --storage option and legacy storage overrides from the Quantum extension’s vendored SDK, keeping jobs on workspace-linked storage.
Changes:
- Removes
--storagefrom job commands and adds migration errors that do not echo its value. - Removes SDK storage connection-string overrides and obsolete container helpers.
- Adds regression tests, updates migration documentation and help, and bumps the version to
1.0.0b32.
| File | Description |
|---|---|
src/quantum/setup.py |
Bumps the extension version to 1.0.0b32. |
src/quantum/README.rst |
Documents option removal and migration guidance. |
src/quantum/HISTORY.rst |
Records the breaking change and SDK cleanup. |
src/quantum/azext_quantum/vendored_sdks/azure_quantum_python/workspace.py |
Removes storage overrides and uses linked storage exclusively. |
src/quantum/azext_quantum/vendored_sdks/azure_quantum_python/storage.py |
Removes obsolete connection-string container helpers. |
src/quantum/azext_quantum/tests/latest/test_quantum_workspace.py |
Tests SDK argument rejection and linked-storage behavior. |
src/quantum/azext_quantum/tests/latest/test_quantum_jobs.py |
Tests parsing, safe rejection, help, and job submission. |
src/quantum/azext_quantum/operations/job.py |
Removes storage parameters and forwards optional arguments by keyword. |
src/quantum/azext_quantum/_params.py |
Removes job storage argument registration. |
src/quantum/azext_quantum/_help.py |
Clarifies workspace-linked storage behavior. |
src/quantum/azext_quantum/__init__.py |
Adds a pre-parse guard for removed storage options. |
Review effort: Balanced
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
| @@ -18,6 +19,35 @@ | |||
| CLI_REPORTED_VERSION = ext.version if ext else "unknown" | |||
|
|
|||
|
|
|||
| def _reject_removed_job_storage_argument(cli_ctx, **kwargs): | |||
There was a problem hiding this comment.
this seems to be not standard practice in az cli, I would not introduce this:
- The list of short forms (
--st…--storage) is fixed in the code. If an option starting with--stis ever added to these commands, the check would block it. - It also duplicates the CLI's normal error output instead of using the parser's error path.
There was a problem hiding this comment.
Removed the custom pre-parse guard and the hardcoded abbreviation checks. The removed option now follows the standard cli unrecognized-argument path. The regression test checks exit code 2and the standard error for all three commands and both argument spellings
| ++++++++++++++ | ||
| * [BREAKING CHANGE] Removed the ignored ``--storage`` argument from ``az quantum job submit``, ``az quantum execute``, and ``az quantum run``. Remove this argument from scripts; jobs continue to use workspace-linked storage because the backend already supports only that storage. The workspace-level ``--storage-account`` argument is unchanged. | ||
| * Updated the vendored Quantum SDK to remove explicit storage connection-string overrides and their obsolete container helpers, matching the upstream SDK change. | ||
| * Reject the removed job ``--storage`` option with migration guidance without echoing its value in the error message or command-log error entry. |
There was a problem hiding this comment.
this describes implementation details; fold it into the first
| @@ -59,6 +59,18 @@ Note that the `@EntryPoint` attribute tells Q# which operation to run when the p | |||
| Prepare to submit and manage jobs in Azure Quantum using the `az quantum` extension | |||
| =================================================================================== | |||
|
|
|||
| .. important:: | |||
There was a problem hiding this comment.
I think we can drop this as history entry and command help already cover it
There was a problem hiding this comment.
🔵 Needs a closer look
Managed-storage creation and ARM polling changes affect V1/V2 provisioning and RBAC, but offline-only validation leaves provisioning completion and job access to managed storage unconfirmed in a live environment.
No open issues 🎉
Review effort: Balanced
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
| for command in ('quantum job submit', 'quantum run', 'quantum execute'): | ||
| for option in ('--storage legacy-storage', '--storage=legacy-storage'): | ||
| with self.subTest(command=command, option=option): | ||
| with self.assertLogs('cli.azure.cli.core.azclierror', level='ERROR') as errors: |
There was a problem hiding this comment.
test_job_commands_reject_storage mostly checks argparse behaviour, and it depends on the internal logger name cli.azure.cli.core.azclierror. Consider removing it or keeping one simple case.
There was a problem hiding this comment.
got it. I removed test_job_commands_reject_Storage, including its dependency on the internal CLI logger. The removed option continues to use the standard Azure CLI unrecognized-argument handling
| output_mock.assert_called_once_with(cmd, 'job-123', 'test-rg', 'test-ws') | ||
| self.assertIs(result, expected_result) | ||
|
|
||
| def test_submit_uses_workspace_storage(self): |
There was a problem hiding this comment.
test_submit_uses_workspace_storage replaces 10 functions with mocks and checks the whole request payload, so most changes to submit() will break it. The only assertion this PR needs is that Workspace(...) is created without storage. That same test imports job inside the test function while also importing submit at module level. Pick one style
There was a problem hiding this comment.
got it. I simplified the test to check that Workspace is called with only resource_id and credential, without a storage argument. It now stops at the sdk constructor boundary, so the upload and job-payload mocks and assertions are removed. The test also consistently uses the module-level submit import.
| class QuantumWorkspaceStorageContractTest(unittest.TestCase): | ||
|
|
||
| @patch('azext_quantum.vendored_sdks.azure_quantum_python.workspace.WorkspaceMgmtClient') | ||
| def test_get_container_uri_uses_linked_storage(self, management_client_mock): |
There was a problem hiding this comment.
I don't think we should add tests for azure-quantum-python dependency here - it should live in it's own repo
There was a problem hiding this comment.
Got it, removed
| @unittest.mock.patch('azext_quantum.operations.job.output') | ||
| @unittest.mock.patch('azext_quantum.operations.job.wait') | ||
| @unittest.mock.patch('azext_quantum.operations.job.submit') | ||
| def test_run_forwards_optional_arguments(self, submit_mock, wait_mock, output_mock): |
There was a problem hiding this comment.
test_run_forwards_optional_arguments mostly repeats the implementation, maybe skip it?
There was a problem hiding this comment.
got it, removed
| Jobs use storage linked to the Azure Quantum workspace. Arbitrary per-job storage | ||
| accounts are not supported. |
There was a problem hiding this comment.
new help text "Arbitrary per-job storage accounts are not supported" describes a removed feature. The release note already covers this, so I'd drop it.
There was a problem hiding this comment.
Got it, removed the added text from help entries
| Jobs use storage linked to the Azure Quantum workspace. Arbitrary per-job storage | ||
| accounts are not supported. |
There was a problem hiding this comment.
new help text "Arbitrary per-job storage accounts are not supported" describes a removed feature. The release note already covers this, so I'd drop it.
There was a problem hiding this comment.
Got it, removed the added text from help entries
| Jobs use storage linked to the Azure Quantum workspace. Arbitrary per-job storage | ||
| accounts are not supported. |
There was a problem hiding this comment.
new help text "Arbitrary per-job storage accounts are not supported" describes a removed feature. The release note already covers this, so I'd drop it.
There was a problem hiding this comment.
Got it, removed the added text from help entries
| 1.0.0b32 | ||
| ++++++++++++++ | ||
| * [BREAKING CHANGE] Removed the ignored ``--storage`` argument from ``az quantum job submit``, ``az quantum execute``, and ``az quantum run``. Commands using this argument now report an unrecognized-argument error. Remove it from scripts; jobs continue to use workspace-linked storage. The workspace-level ``--storage-account`` argument is unchanged. | ||
| * Updated the vendored Quantum SDK to remove explicit storage connection-string overrides and their obsolete container helpers, matching the upstream SDK change. |
There was a problem hiding this comment.
The second HISTORY.rst bullet (vendored SDK cleanup) is an internal detail that users won't see, consider removing it.
There was a problem hiding this comment.
got it, removed the sdk-cleanup bullet.
There was a problem hiding this comment.
🔵 Needs a closer look
Removing three public CLI parameters triggers ParaRemove validation, and the PR lacks release-timing context needed for a maintainer to confirm compliance with the linked breaking-change policy.
No open issues 🎉
1 resolved since last review
Review effort: Balanced
|
This is still in Draft. Moving to next milestone (Dec 2026) |

🤖 PR Validation — ❌ Action needed
❌Azure CLI Extensions Breaking Change Test
Summary
Remove the unused job-level
--storageoption and legacy storage connection-string support from the vendored Quantum SDK. Jobs continue to use workspace-linked storage.Changes
--storagefromaz quantum job submit,az quantum run, andaz quantum execute.--storage-accountoption.Testing
submit()callsWorkspacewithresource_idandcredential, without astorageargument. Existing job and workspace tests remain unchanged.--storage valueand--storage=valueacross all three affected commands.--storage; workspace creation still exposes--storage-account.