Skip to content

Quantum: manage V2 workspace quota - #10229

Open
v-elegacheva wants to merge 6 commits into
Azure:mainfrom
v-elegacheva:ekat/quantum-workspace-quota
Open

Quantum: manage V2 workspace quota#10229
v-elegacheva wants to merge 6 commits into
Azure:mainfrom
v-elegacheva:ekat/quantum-workspace-quota

Conversation

@v-elegacheva

@v-elegacheva v-elegacheva commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

🤖 PR Validation — ⚠️ Review suggested

Breaking Changes
⚠️ None
⚠️Azure CLI Extensions Breaking Change Test
⚠️quantum
rule cmd_name rule_message suggest_message
⚠️ 1006 - ParaAdd quantum workspace create cmd quantum workspace create added parameter quota
⚠️ 1006 - ParaAdd quantum workspace update cmd quantum workspace update added parameter quota

Summary

Adds a new --quota argument to az quantum workspace create and az quantum workspace update for managing V2 provider target quota allocations.

Changes

  • --quota argument: repeatable --quota accepting key=value pairs or JSON (providerId, targetId, standardMinutesLifetime, highMinutesLifetime), with parse-time validation
  • Workspace operations: applies quotas to matching providers on create/update. On update, omitted values are preserved and 0 is treated as a literal allocation. --quota is gated to V2 workspaces. The guard runs before any mutating ARM call. On update, it follows a read-only GET used to obtain the workspace kind, so V1 workspaces are rejected without mutation.
  • Regenerated vendored SDK: bumps control plane API version to 2026-06-15-preview, adds TargetQuotaAllocations and related model fields
  • extension version bump

Testing

  • Live e2e (dev mode, real az).
    • create --help / update --help surface --quota
  • -Parse-time rejection of negative value
    • V1 workspace rejects --quota with a clear error and no mutation
  • azdev style and azdev linter pass
  • Unit tests passed

@azure-client-tools-bot-prd

Copy link
Copy Markdown

Hi v-elegacheva,
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in pyproject.toml (or setup.py, if the extension has not migrated yet) as well.

@azure-pipelines

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

@yonzhan

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@yonzhan

Copy link
Copy Markdown
Collaborator

Please fix CI issues

…06-15-preview

Regenerates the vendored azure-mgmt-quantum SDK against API version 2026-06-15-preview. Adds TargetQuotaAllocations and related model fields consumed by the --quota feature.
@v-elegacheva
v-elegacheva force-pushed the ekat/quantum-workspace-quota branch from 5ea045c to 97c2ab8 Compare August 19, 2026 16:04
Adds --quota to 'az quantum workspace create' and 'az quantum workspace update' for managing V2 provider target quota allocations (targetQuotas). Preserves omitted values on update, treats zero as a literal allocation, and validates provider/target inputs.
1.0.0b21 was released upstream (az quantum job update), so bump to 1.0.0b22 and record the --quota / API version 2026-06-15-preview changes under a new HISTORY entry.
@v-elegacheva
v-elegacheva force-pushed the ekat/quantum-workspace-quota branch from 97c2ab8 to c31bf3e Compare August 19, 2026 16:10
@v-elegacheva
v-elegacheva marked this pull request as ready for review August 19, 2026 16:15
Copilot AI lite review requested due to automatic review settings August 19, 2026 16:15
@azure-pipelines

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

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds support in the Quantum CLI extension for managing V2 workspace provider target quota allocations via a new --quota parameter on workspace create/update, alongside a vendored control-plane SDK regeneration and extension version bump.

Changes:

  • Added --quota argument parsing/validation and applied target quota allocations onto workspace providers during az quantum workspace create and az quantum workspace update.
  • Updated workspace update implementation to support quota updates (and still optionally toggle API-key auth).
  • Regenerated vendored azure_mgmt_quantum SDK and updated ARM template API versions; bumped extension version and release notes.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/quantum/setup.py Bumps extension package version to 1.0.0b22.
src/quantum/HISTORY.rst Adds 1.0.0b22 release notes including --quota and API version note.
src/quantum/azext_quantum/vendored_sdks/azure_mgmt_quantum/operations/_operations.py Updates default api-version used by generated request builders.
src/quantum/azext_quantum/vendored_sdks/azure_mgmt_quantum/models/_models.py Adds TargetQuotaAllocations model and related fields on provider/offer models.
src/quantum/azext_quantum/vendored_sdks/azure_mgmt_quantum/models/init.py Exposes new TargetQuotaAllocations model in package exports.
src/quantum/azext_quantum/vendored_sdks/azure_mgmt_quantum/aio/_configuration.py Updates async client configuration default api-version doc/behavior.
src/quantum/azext_quantum/vendored_sdks/azure_mgmt_quantum/aio/_client.py Updates async client docstring default api-version.
src/quantum/azext_quantum/vendored_sdks/azure_mgmt_quantum/_configuration.py Updates sync client configuration default api-version doc/behavior.
src/quantum/azext_quantum/vendored_sdks/azure_mgmt_quantum/_client.py Updates sync client docstring default api-version.
src/quantum/azext_quantum/tests/latest/test_quantum_workspace.py Adds unit tests for quota parsing/validation and quota application/update behavior.
src/quantum/azext_quantum/operations/workspace.py Implements V2 gating and quota application in create/update flows.
src/quantum/azext_quantum/operations/templates/create-workspace-and-assign-role.json Bumps workspace ARM template apiVersion and reference api-version.
src/quantum/azext_quantum/commands.py Routes quantum workspace update to the new update handler.
src/quantum/azext_quantum/_params.py Introduces QuotaAction argparse action and wires --quota into create/update.
src/quantum/azext_quantum/_help.py Adds examples for create/update using --quota.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/quantum/HISTORY.rst
Comment thread src/quantum/azext_quantum/operations/workspace.py
@v-elegacheva
v-elegacheva marked this pull request as draft August 19, 2026 17:03
@v-elegacheva
v-elegacheva marked this pull request as ready for review August 19, 2026 17:07
@azure-pipelines

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

@v-elegacheva
v-elegacheva marked this pull request as draft August 19, 2026 17:42
Comment thread src/quantum/azext_quantum/_params.py
Comment thread src/quantum/azext_quantum/tests/latest/test_quantum_workspace.py
Comment thread src/quantum/azext_quantum/_params.py Outdated
Comment thread src/quantum/azext_quantum/commands.py
Comment thread src/quantum/azext_quantum/_params.py
…keys, refresh recordings

- --quota now rejects repeated keys within a single flag instead of silently merging two targets; use one --quota per target.
- Accept kebab-case/snake_case quota keys (case-insensitive) as aliases of camelCase; help/examples use kebab-case.
- Reject non-integer (float) minute values instead of truncating.
- Update control-plane test recordings to api-version 2026-06-15-preview.
@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

Comment thread src/quantum/azext_quantum/_params.py Outdated
Comment thread src/quantum/azext_quantum/_params.py Outdated
Comment thread src/quantum/azext_quantum/_params.py Outdated
@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@v-elegacheva
v-elegacheva marked this pull request as ready for review August 20, 2026 00:06
@azure-pipelines

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

@yonzhan

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@v-elegacheva
v-elegacheva marked this pull request as draft August 20, 2026 15:58
@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@v-elegacheva
v-elegacheva marked this pull request as ready for review August 20, 2026 17:17
@azure-pipelines

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

@v-elegacheva

Copy link
Copy Markdown
Contributor Author

hello Ethan Yang (@necusjz) ! Could you please review this PR when you get a chance? Thank you for your time :)

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.

7 participants