Safely unwrapping of enum object#10055
Open
vlkhomenko wants to merge 4 commits into
Open
Conversation
…es the value through unchanged if it's already a plain type. ARM deployment templates require plain string values, not enum objects. Passing an enum directly would cause serialization errors.
️✔️Azure CLI Extensions Breaking Change Test
|
|
Hi @vlkhomenko, |
Contributor
|
Thank you for your contribution @vlkhomenko! We will review the pull request and get back to you soon. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Quantum workspace creation flow to ensure ARM-template deployment parameters use plain (JSON-serializable) primitive values instead of SDK enum objects, preventing serialization issues and test failures.
Changes:
- Added a helper to unwrap enum-like values to their underlying primitive.
- Applied the helper when extracting storage account SKU name/tier and kind from an existing storage account for ARM deployment parameters.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…ployment parameters use plain (JSON-serializable) primitive values instead of SDK enum objects, preventing serialization issues and test failures.
…nko/azure-cli-extensions into quatum-workspace-sku-fix
Author
|
@microsoft-github-policy-service agree company="Microsoft" |
Contributor
|
/azp run |
|
Commenter does not have sufficient privileges for PR 10055 in repo Azure/azure-cli-extensions |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Safely unwrapping of enum object into its plain string value, or passes the value through unchanged if it's already a plain type.
ARM deployment templates require plain string values, not enum objects. Passing an enum directly would cause serialization errors.
Currently, tests get SkuName.Standard_LRS value instead of Standard_LRS that causes test failures.
This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
General Guidelines
azdev style <YOUR_EXT>locally? (pip install azdevrequired)python scripts/ci/test_index.py -qlocally? (azdevrequired; see.azure-pipelines/templates/azdev_setup.ymlfor the install command untilazdev==0.2.11b1is on PyPI)For new extensions:
About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update
src/index.jsonautomatically.You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify
src/index.json.