Skip to content

[Quantum] Fix workspace create crash for providers without managed_application - #10415

Merged
Ethan Yang (necusjz) merged 2 commits into
Azure:mainfrom
v-elegacheva:ekat/quantum-v2-provider-offer-fix
Oct 5, 2026
Merged

Ethan Yang (necusjz) merged 2 commits into
Azure:mainfrom
v-elegacheva:ekat/quantum-v2-provider-offer-fix

Conversation

@v-elegacheva

@v-elegacheva v-elegacheva commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

az quantum workspace create --workspace-kind V2 -r <provider>/<sku> ... crashed with an unhandled AttributeError: 'NoneType' object has no attribute 'offer_id' for providers that have no legacy marketplace ManagedApplication association. This happened even with --skip-autoadd, since that flag only skips additional auto-added providers, not ones passed explicitly via -r.

Root cause

_get_publisher_and_offer_from_provider_id assumed properties.managed_application is always populated (with real values, or the existing N/A sentinel meaning "no terms to accept"). For certain V2-native providers, the object itself is None, a case the function never guarded against.

Fix

Treat managed_application is None the same as the existing N/A sentinel (PUBLISHER_NOT_AVAILABLE/OFFER_NOT_AVAILABLE) instead of crashing. This reuses the already-correct downstream handling in _provider_terms_need_acceptance/_valid_publisher_and_offer (both already short-circuit on the N/A sentinel without calling the marketplace API), so no other function needed to change.

Testing

  • Added 4 unit tests for the fixed helper (happy path, case-insensitivity, not-found, and the crash scenario).
  • Added an integration-level test on _add_quantum_providers mocking cf_offerings to return a provider with no managed_application, reproducing the exact failing scenario end-to-end.
  • Full offline suite: 151 passed, 15 skipped, 72 subtests, no regressions.
  • azdev style quantum / azdev linter quantum: both PASSED.

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.

Copilot review overview

🟢 Approval recommended

The focused fix correctly reuses existing no-terms handling and has adequate regression coverage.

Review effort: Balanced
Findings: None

What changed in this PR

Fixes workspace creation for V2 providers without legacy marketplace associations.

Changes:

  • Handles missing managed_application using existing sentinel values.
  • Adds helper and workspace-level regression tests.
File Description
operations/​offerings.py Prevents missing managed applications from crashing.
tests/​latest/​test_quantum_offerings.py Tests provider lookup behavior and regression case.
tests/​latest/​test_quantum_workspace.py Tests provider addition end to end.

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

@v-elegacheva
v-elegacheva force-pushed the ekat/quantum-v2-provider-offer-fix branch from 3893116 to de03e64 Compare September 30, 2026 21:34
@yonzhan Yong Zhang (yonzhan) added this to the Backlog milestone Sep 30, 2026
@yonzhan

Copy link
Copy Markdown
Collaborator

Quantum

@rigidit

Copy link
Copy Markdown
Member

can we check if same crash still happens in the offerings table view. transform_offerings reads offering['properties']['managedApplication']['publisherId'] with no check

@rigidit

Copy link
Copy Markdown
Member

New version should be released for this

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.

Copilot review overview

🟢 Approval recommended

The focused fix reuses established sentinel handling and includes coverage for both affected command paths.

Review effort: Balanced
Findings: None

@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 ready for review October 2, 2026 17:29
…plication

Bug 55823: az quantum workspace create crashed with AttributeError when a provider has no legacy marketplace ManagedApplication association.

_get_publisher_and_offer_from_provider_id now treats managed_application=None the same as the existing N/A sentinel (no terms to accept) instead of crashing, reusing the already-correct downstream handling in _provider_terms_need_acceptance/_valid_publisher_and_offer.

Adds unit tests for the fixed helper plus an integration-level test on _add_quantum_providers reproducing the exact crash scenario.
@v-elegacheva
v-elegacheva force-pushed the ekat/quantum-v2-provider-offer-fix branch from d09b4f9 to d8613d7 Compare October 2, 2026 18:34
@necusjz
Ethan Yang (necusjz) merged commit 78c2e36 into Azure:main Oct 5, 2026
24 checks passed
@azclibot

Copy link
Copy Markdown
Collaborator

[Release] Update index.json for extension [ quantum-1.0.0b30 ] : https://dev.azure.com/msazure/One/_build/results?buildId=184124890&view=results

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.

6 participants