-
Notifications
You must be signed in to change notification settings - Fork 4k
Logic App Integration Account Control Numbers cmdlets #3566
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
Conversation
Can one of the admins verify this patch? |
@azuresdkci add to whitelist |
@daviburg this is failing because it can't find your package. Have you published the package yet? |
@azuresdkci test this please |
…sion removed by mistake while regenerating the file.
.SYNOPSIS | ||
Returns true if current mode is record | ||
#> | ||
function IsRecordMode() |
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 already availble from TestSupport.RunningMocked. Duplicating this is maintenance problem going forward.
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.
So if (-not [Microsoft.WindowsAzure.Commands.Utilities.Common.TestMockSupport]::RunningMocked) gives me the wrong result when running in Record mode, i.e. return trues which cause setup code not to run and the test to fail. I will keep the approach I mimicked from existing test code which works reliably.
@@ -21,22 +21,32 @@ namespace Microsoft.Azure.Commands.LogicApp.Cmdlets | |||
/// <summary> | |||
/// Gets the integration account agreement by name | |||
/// </summary> | |||
[Cmdlet(VerbsCommon.Get, "AzureRmIntegrationAccountAgreement"), OutputType(typeof (object))] | |||
[Cmdlet(VerbsCommon.Get, "AzureRmIntegrationAccountAgreement")] | |||
[OutputType(typeof(object))] |
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 essentially useless, please be more specific about the output type
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.
Fixing
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 change resulted in a breaking change build error. I think that as object return type provided no value this breaking change is unlikely to actually break any client. Is there a way to acknowledgement the breaking change as acceptable?
00:48:41 "D:\workspace\powershell\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.LogicApp\Microsoft.Azure.Commands.LogicApp.dll","Microsoft.Azure.Commands.LogicApp.Cmdlets.GetAzureIntegrationAccountAgreementCommand","Get-AzureRmIntegrationAccountAgreement","0","1020","The cmdlet 'Get-AzureRmIntegrationAccountAgreement' no longer has output type 'Object'.","Make cmdlet 'Get-AzureRmIntegrationAccountAgreement' return type 'Object'."
/// Gets the integration account generated interchange control number by agreement name | ||
/// </summary> | ||
[Cmdlet(VerbsCommon.Get, "AzureRmIntegrationAccountGeneratedIcn")] | ||
[OutputType(typeof(IntegrationAccountClient.IntegrationAccountControlNumber), typeof(IList<IntegrationAccountClient.QualifiedIntegrationAccountControlNumber>))] |
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.
Why areen't these simple public types?
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.
Fixing
/// Gets the integration account received interchange control number by agreement name and control number value. | ||
/// </summary> | ||
[Cmdlet(VerbsCommon.Get, "AzureRmIntegrationAccountReceivedIcn")] | ||
[OutputType(typeof(IntegrationAccountClient.IntegrationAccountControlNumber))] |
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.
Why is this not a simple, public type?
/// Updates the integration account generated interchange control number. | ||
/// </summary> | ||
[Cmdlet(VerbsCommon.Set, "AzureRmIntegrationAccountGeneratedIcn", SupportsShouldProcess = true)] | ||
[OutputType(typeof(IntegrationAccountClient.IntegrationAccountControlNumber))] |
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.
simple type
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.
In other words - you need to provide a simple type definition, not a type defined within another type.
@@ -193,6 +200,10 @@ | |||
<Project>{3819d8a7-c62c-4c47-8ddd-0332d9ce1252}</Project> | |||
<Name>Commands.ResourceManager.Common</Name> | |||
</ProjectReference> | |||
<ProjectReference Include="..\..\Resources\Commands.ResourceManager\Cmdlets\Commands.Resources.Rest.csproj"> |
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 not allowed. You cannot have a dependency on another cmdlets project
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.
Removing
/// <summary> | ||
/// LogicApp client partial class for integration account control number types. | ||
/// </summary> | ||
public partial class IntegrationAccountClient |
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 look like generated types, why are these here and not in your SDK?
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.
Because the types are client-side only. The swagger and SDK specify what the server is aware of, which here is just an obscure/opaque JToken object. The clients store state specific to themselves within the session. Different client-defined types can and are stored in different sessions.
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.
If these are exchanged with the service, you should consider adding these types to your API definition. This is not a blocker for the PR.
* Added Set-AzureRmIntegrationAccountReceivedIcn * Specified return type(s) of integration account cmdlets * Fixed return types for control number cmdlets
@daviburg You have two issues causing static analysis failures:
|
Cleaned up help files.
I added the exceptions for the return type. I did not find in the Jenkins build artifacts or console output where is the "Cmdlets with nouns that are plural" issue. |
on demand run here:http://azuresdkci.cloudapp.net/view/1-AzurePowerShell/job/powershell-demand/1432/ LGTM once the on demand run passes |
Description
New cmdlets for Logic App Integration Account Control Numbers:
Get, Set, List generated control numbers, Get, Remove received control numbers.
Building atop Azure/azure-sdk-for-net#2858
Underlying sessions entities are intentionally not exposed to cmdlet user. Cmdlet user will know high level business concept of control numbers. Sessions is Microsoft's B2B connector specific underlying storage mechanism for this and other states.
Full CRUD is intentionally not exposed to cmdlet user. Select commands above are exposed for the specific purpose of a service operator to fix up current state in the event of a disaster recovery to a back-up site.
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.
For the sake of completeness, will add an additional commit with change log update to this PR.
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.Remove cmdlet produces no output and a
PassThru
parameter would not work for it either.Cmdlet Parameter Guidelines