Skip to content

{Core} Apply transform after poller#24763

Draft
FumingZhang wants to merge 1 commit intoAzure:devfrom
FumingZhang:fuming/cli-core-transform-1129
Draft

{Core} Apply transform after poller#24763
FumingZhang wants to merge 1 commit intoAzure:devfrom
FumingZhang:fuming/cli-core-transform-1129

Conversation

@FumingZhang
Copy link
Copy Markdown
Member

Related command

Description

Testing Guide

History Notes

[Component Name 1] BREAKING CHANGE: az command a: Make some customer-facing breaking change
[Component Name 2] az command b: Add some customer-facing feature


This checklist is used to make sure that common guidelines for a pull request are followed.

@ghost ghost added Auto-Assign Auto assign by bot Core CLI core infrastructure labels Nov 29, 2022
@ghost ghost requested review from jiasli and yonzhan November 29, 2022 10:33
@ghost ghost assigned jiasli Nov 29, 2022
@ghost ghost added this to the Dec 2022 (2023-01-03) milestone Nov 29, 2022
@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Nov 29, 2022

Core

@jiasli
Copy link
Copy Markdown
Member

jiasli commented Nov 30, 2022

This change triggers some errors in network module

https://dev.azure.com/azclitools/public/_build/results?buildId=17938&view=logs&j=c61e0d44-5b9c-57c5-d29b-862780a2258b&t=5f0ca011-9971-599f-3af2-2e32dcc81141&l=22730

result = <azure.mgmt.network.v2022_01_01.models._models_py3.VirtualNetwork object at 0x7ff192a1e2f0>

    def transform_vnet_create_output(result):
>       return {'newVNet': result.result()}
E       AttributeError: 'VirtualNetwork' object has no attribute 'result'

This is because transform_vnet_create_output manually polls the LRO result by calling .result() on the poller.

def transform_vnet_create_output(result):
return {'newVNet': result.result()}

A downside is that az network vnet create can't show IndeterminateProgressBar.

If the transform is executed after LRO polling, the result is a VirtualNetwork object without result method, causing above error.

I don't think it is a good behavior to apply transform to a LRO poller. Instead, a transform should be applied to the LRO result. But, this behavior has been there since 2017 (8346147). Chaning the behavior may cause failures in other modules or extensions.

@jiasli
Copy link
Copy Markdown
Member

jiasli commented Nov 30, 2022

A workaround is added in Knack to serialize bytearray: microsoft/knack#268, though this workaround is less optimal. We still need to consider changing the behavior so that a transform is applied after LRO polling.

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

Labels

act-platform-engineering-squad Auto-Assign Auto assign by bot Core CLI core infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants