-
Notifications
You must be signed in to change notification settings - Fork 4k
Update Cognitive Services Mgmt. PS with the latest Cognitive Services Mgmt. SDK #5200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Cognitive Services Mgmt. PS with the latest Cognitive Services Mgmt. SDK #5200
Conversation
1. Apply Cognitive Services SDK 3.0.0.0 2. Update NuGet refs
Revision to 0.9.1 |
@@ -55,7 +55,7 @@ public PSCognitiveServicesAccount(CognitiveServicesModels.CognitiveServicesAccou | |||
|
|||
public string Etag { get; private set; } | |||
|
|||
public ProvisioningState? ProvisioningState { get; private set; } | |||
public string ProvisioningState { get; private set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only meaningful change introduced by new SDK (3.0.0.0) but I don't think it is breaking.
Added to BreakingChangeIssues.csv.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@felixwa This is a breaking change, right. As in, I could have had scripts with things like:
$account.ProvisioningState == [ProvisioningState]::Running
and such a script will now be broken. I think you need to adapt this type in PSCognitiveServicesAccount so that this is not broken. It is OK to add an additional string field and deprecate this field, but you will need to do some translation between the string field from the wire and this enumeration until the next breaking change release (build)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@markcowl , the meaning of this PR is to introduce this change as we found we cannot enum all possible ProvisioningState so we changed the Swagger, SDK then this PS, change its type from an enum to a string.
I don't want to add back that enum in PS as it has gone in SDK also I cannot predicate possible values of that enum. If RP returns back a value not in the enum, PS throws an exception at client side.
Is there an option we wait "until the next breaking change release (build)"? If so we could wait but I really don't want to add that enum back in PS and only in PS.
@felixwa breaking changes are not allowed. You will need to make a powershell-specific fix for this one field, and you should be able to do this without throwing on the client side.
Downgrade Newtonsoft.Json 10->6 as 10 resutls in UT cases fail at buddy build (though can pass at my local).
Downgrade NuGet refs in Test project as UT cases in buddy build keep failing.
Add breaking changes into exception list.
Quote the breaking change exceptions.
Quote every field of BreakingCHangeIssues.csv
Quote columns of BreakingChangeIssues.csv
</Reference> | ||
<Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these should come from the common dependecies file
@@ -55,7 +55,7 @@ public PSCognitiveServicesAccount(CognitiveServicesModels.CognitiveServicesAccou | |||
|
|||
public string Etag { get; private set; } | |||
|
|||
public ProvisioningState? ProvisioningState { get; private set; } | |||
public string ProvisioningState { get; private set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@felixwa This is a breaking change, right. As in, I could have had scripts with things like:
$account.ProvisioningState == [ProvisioningState]::Running
and such a script will now be broken. I think you need to adapt this type in PSCognitiveServicesAccount so that this is not broken. It is OK to add an additional string field and deprecate this field, but you will need to do some translation between the string field from the wire and this enumeration until the next breaking change release (build)
@@ -781,3 +781,6 @@ | |||
"Microsoft.Azure.Commands.Compute.dll","Microsoft.Azure.Commands.Compute.SetAzureVMCommand","Set-AzureRmVM","0","2080","The parameter 'Generalized' in parameter set 'GeneralizeIdParameterSetName' for cmdlet 'Set-AzureRmVM' no longer has the attribute 'ValueFromPipelineByPropertyName'.","Add the attribute 'ValueFromPipelineByPropertyName' back to parameter 'Generalized' in parameter set 'GeneralizeIdParameterSetName'." | |||
"Microsoft.Azure.Commands.Compute.dll","Microsoft.Azure.Commands.Compute.SetAzureVMCommand","Set-AzureRmVM","0","2060","The position of parameter 'Redeploy' has changed for parameter set 'RedeployIdParameterSetName' for cmdlet 'Set-AzureRmVM'.","Revert the position change made to parameter 'Redeploy' for parameter set 'RedeployIdParameterSetName'." | |||
"Microsoft.Azure.Commands.Compute.dll","Microsoft.Azure.Commands.Compute.SetAzureVMCommand","Set-AzureRmVM","0","2080","The parameter 'Redeploy' in parameter set 'RedeployIdParameterSetName' for cmdlet 'Set-AzureRmVM' no longer has the attribute 'ValueFromPipelineByPropertyName'.","Add the attribute 'ValueFromPipelineByPropertyName' back to parameter 'Redeploy' in parameter set 'RedeployIdParameterSetName'." | |||
"d:\workspace\powershell\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.CognitiveServices\Microsoft.Azure.Commands.Management.CognitiveServices.dll","Microsoft.Azure.Commands.Management.CognitiveServices.GetAzureCognitiveServicesAccountCommand","Get-AzureRmCognitiveServicesAccount","0","3000","The type of property 'ProvisioningState' of type 'Microsoft.Azure.Commands.Management.CognitiveServices.Models.PSCognitiveServicesAccount' has changed from 'System.Nullable`1[Microsoft.Azure.Management.CognitiveServices.Models.ProvisioningState]' to 'System.String'.","Change the type of property 'ProvisioningState' back to 'System.Nullable`1[Microsoft.Azure.Management.CognitiveServices.Models.ProvisioningState]'." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not allowed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@felixwa breaking changes are not allowed until the breaking change release. You will need to deprecate this field and adapt to the breaking change in the wire - likely by intrpoducing a new field to your output type, and providing the best available mapping in the existing enum property
@felixwa Also, please update changelog.md with these changes |
Remove dlls exist in common dependencies
1. After disucssion with Mark, redefine Provisioning state in PS and mark it as obsolete. 2. Log changes in Changelog.md 3. Revert changes in BreakingChangeIssues.csv 4. Revision to 0.9.1
Revert BreakingCHangeIssues.csv
Update upcoming-breaking-changes.md
Update upcoming-breaking-changes.md 2
Description
This checklist is used to make sure that common guidelines for a pull request are followed. You can find a more complete discussion of PowerShell cmdlet best practices here.
General Guidelines
Testing Guidelines
Cmdlet Signature Guidelines
ShouldProcess
and haveSupportShouldProcess=true
specified in the cmdlet attribute. You can find more information onShouldProcess
here.OutputType
attribute if any output is produced - if the cmdlet produces no output, it should implement aPassThru
parameter.Cmdlet Parameter Guidelines