-
Notifications
You must be signed in to change notification settings - Fork 4k
EH PS Cmdlets #3251
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
EH PS Cmdlets #3251
Conversation
Squashed commit of the following: commit 5cf2ad3 Merge: 5f1336c 040141e Author: REDMOND\v-ajnava <[email protected]> Date: Mon Dec 5 15:26:49 2016 -0800 Merge branch 'dev' of https://github.com/Azure/azure-powershell into AJ_power_eh commit 5f1336c Author: Arun Dsouza <[email protected]> Date: Mon Dec 5 11:51:30 2016 -0800 Updated with Wix file and EH only commit a508e7b Author: Arun Dsouza <[email protected]> Date: Mon Dec 5 10:38:08 2016 -0800 wix updated commit d3f8211 Author: REDMOND\v-ajnava <[email protected]> Date: Wed Nov 30 14:50:20 2016 -0800 Resolved system.management.automation ref issue. commit 24d2744 Author: REDMOND\v-ajnava <[email protected]> Date: Tue Nov 29 12:21:28 2016 -0800 ServiceBus PS cmdlets commit c4cd95f Merge: 0001c62 1eb3f3b Author: REDMOND\v-ajnava <[email protected]> Date: Sat Nov 26 13:57:28 2016 -0800 Merge branch 'AJ_power1' of https://github.com/v-Ajnava/azure-powershell into AJ_power1 # Conflicts: # setup/azurecmdfiles.wxi # src/ResourceManager/EventHub/Commands.EventHub.Test/Commands.EventHubs.Test.csproj # src/ResourceManager/EventHub/Commands.EventHub.Test/ScenarioTests/NamespaceTests.ps1 # src/ResourceManager/EventHub/Commands.EventHub.Test/SessionRecords/Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.ConsumerGroupsTests/ConsumerGroupsCRUD.json # src/ResourceManager/EventHub/Commands.EventHub.Test/SessionRecords/Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.EventHubsTests/EventHubsAuthorizationRulesCRUD.json # src/ResourceManager/EventHub/Commands.EventHub.Test/SessionRecords/Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.EventHubsTests/EventHubsCRUD.json # src/ResourceManager/EventHub/Commands.EventHub.Test/SessionRecords/Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.NamespaceTests/NamespaceAuthorizationRulesCRUD.json # src/ResourceManager/EventHub/Commands.EventHub.Test/SessionRecords/Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.NamespaceTests/NamespaceCRUD.json commit 0001c62 Author: REDMOND\v-ajnava <[email protected]> Date: Thu Nov 24 03:58:12 2016 -0800 Review comments and WXI file commit 1eb3f3b Author: REDMOND\v-ajnava <[email protected]> Date: Wed Nov 23 11:09:35 2016 -0800 WXI file commit 15ce842 Author: REDMOND\v-ajnava <[email protected]> Date: Wed Nov 23 11:02:43 2016 -0800 Review changes commit 9c094fa Author: REDMOND\sazeesha <[email protected]> Date: Fri Nov 18 18:32:15 2016 -0800 New Session Records commit 86816de Author: REDMOND\sazeesha <[email protected]> Date: Fri Nov 18 14:27:33 2016 -0800 Fix for build failure commit acda882 Author: REDMOND\sazeesha <[email protected]> Date: Fri Nov 18 11:30:36 2016 -0800 reference to test project commit 046adb2 Author: REDMOND\sazeesha <[email protected]> Date: Thu Nov 17 17:34:27 2016 -0800 Azure EventHub PS CmdLets commit a6fad5a Author: REDMOND\v-ajnava <[email protected]> Date: Thu Nov 17 17:26:41 2016 -0800 removed the extra line from Test.Targets commit 78914ad Author: REDMOND\v-ajnava <[email protected]> Date: Thu Nov 17 17:11:15 2016 -0800 added a reference to eventhub test project to Test.Targets commit 1ca66a2 Author: REDMOND\v-ajnava <[email protected]> Date: Wed Nov 16 19:50:26 2016 -0800 Added the set property commit 9061a2c Author: REDMOND\v-ajnava <[email protected]> Date: Wed Nov 16 17:19:17 2016 -0800 Changes regarding the new object creation for New and Set cmdlets commit 46cfcce Author: REDMOND\v-ajnava <[email protected]> Date: Mon Nov 14 19:22:59 2016 -0800 cleaned SetupManagementClients and added 'Hyak.Common' reference commit 52aa0b4 Author: REDMOND\sazeesha <[email protected]> Date: Mon Nov 14 17:11:34 2016 -0800 EventHub PS CmdLets
Hi @v-Ajnava, I'm your friendly neighborhood Azure Pull Request Bot (You can call me AZPRBOT). Thanks for your contribution!
TTYL, AZPRBOT; |
@v-Ajnava Hey Ajit, last week we upgraded to ADAL 2.28.3, so you will need to update all instances of |
@@ -0,0 +1,11 @@ | |||
<?xml version="1.0" encoding="utf-8"?> |
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.
remove this file
public override void ExecuteCmdlet() | ||
{ | ||
// delete a ConsumerGroup | ||
Client.DeletConsumerGroup(ResourceGroupName, NamespaceName, EventHubName, ConsumerGroupName); |
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.
Need to implement ShouldProcess
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.
Resolved
|
||
[Parameter(Mandatory = false, | ||
ValueFromPipelineByPropertyName = true, | ||
ParameterSetName = EventHubParameterSetName, |
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.
Are there two different parameter sets? If so, you need to attribute the commands appropriately, and you need to set the DefaultParameterSetName attribute for the cmndletr. Cmdlet attribute sets should differ by at least one required parameter,
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.
No, there is single parameter set.
|
||
[Parameter(Mandatory = true, | ||
ValueFromPipelineByPropertyName = true, | ||
Position = 4, |
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.
Too many positional parameters, please keep this to 3-4
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.
Resolved
public string AuthorizationRuleName { get; set; } | ||
|
||
[Parameter(Mandatory = true, | ||
Position = 4, |
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.
Too many positional parameters
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.
Resolved
public override void ExecuteCmdlet() | ||
{ | ||
// Update a EventHub namespace | ||
Dictionary<string, string> tagDictionary = TagsConversionHelper.CreateTagDictionary(Tag, validate: true); |
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.
Implement SHouldProcess
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.
Resolved
|
||
[Parameter(Mandatory = false, | ||
ValueFromPipelineByPropertyName = true, | ||
Position = 4, |
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.
Too many positional parameters
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.
Resolved
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile> | ||
<ErrorReport>prompt</ErrorReport> | ||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> | ||
<CodeAnalysisRuleSetDirectories>;$(ProgramFiles)\Microsoft Visual Studio 12.0\Team Tools\Static Analysis Tools\Rule Sets</CodeAnalysisRuleSetDirectories> |
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 shouyld not be set, this is not necessarily where these reside
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.
Resolved
<None Include="..\AzureRM.EventHub.psd1"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</None> | ||
<None Include="app.config" /> |
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.
remove
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.
Resolved
@@ -0,0 +1,11 @@ | |||
<?xml version="1.0" encoding="utf-8"?> |
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.
remove
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.
Resolved
@@ -105,6 +113,10 @@ | |||
<SpecificVersion>False</SpecificVersion> | |||
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.4.1.1\lib\net40\Microsoft.WindowsAzure.Management.dll</HintPath> | |||
</Reference> | |||
<Reference Include="Microsoft.WindowsAzure.Management.Storage, Version=5.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.
Why are you adding these references to the common library? If you need them in your test assembly, add them there
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.
Resolved, Removed the references.
@@ -6,14 +6,17 @@ | |||
<package id="Microsoft.Azure.Common" version="2.1.0" targetFramework="net45" /> | |||
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" /> | |||
<package id="Microsoft.Azure.Management.Resources" version="2.20.0-preview" targetFramework="net45" /> | |||
<package id="Microsoft.Azure.Test.Framework" version="1.0.6179.26854-prerelease" targetFramework="net45" /> |
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.
Same comment. DO not add dependencies here
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.
Resolved, Removed the references.
Squashed commit of the following: commit 5cf2ad3 Merge: 5f1336c 040141e Author: REDMOND\v-ajnava <[email protected]> Date: Mon Dec 5 15:26:49 2016 -0800 Merge branch 'dev' of https://github.com/Azure/azure-powershell into AJ_power_eh commit 5f1336c Author: Arun Dsouza <[email protected]> Date: Mon Dec 5 11:51:30 2016 -0800 Updated with Wix file and EH only commit a508e7b Author: Arun Dsouza <[email protected]> Date: Mon Dec 5 10:38:08 2016 -0800 wix updated commit d3f8211 Author: REDMOND\v-ajnava <[email protected]> Date: Wed Nov 30 14:50:20 2016 -0800 Resolved system.management.automation ref issue. commit 24d2744 Author: REDMOND\v-ajnava <[email protected]> Date: Tue Nov 29 12:21:28 2016 -0800 ServiceBus PS cmdlets commit c4cd95f Merge: 0001c62 1eb3f3b Author: REDMOND\v-ajnava <[email protected]> Date: Sat Nov 26 13:57:28 2016 -0800 Merge branch 'AJ_power1' of https://github.com/v-Ajnava/azure-powershell into AJ_power1 # Conflicts: # setup/azurecmdfiles.wxi # src/ResourceManager/EventHub/Commands.EventHub.Test/Commands.EventHubs.Test.csproj # src/ResourceManager/EventHub/Commands.EventHub.Test/ScenarioTests/NamespaceTests.ps1 # src/ResourceManager/EventHub/Commands.EventHub.Test/SessionRecords/Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.ConsumerGroupsTests/ConsumerGroupsCRUD.json # src/ResourceManager/EventHub/Commands.EventHub.Test/SessionRecords/Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.EventHubsTests/EventHubsAuthorizationRulesCRUD.json # src/ResourceManager/EventHub/Commands.EventHub.Test/SessionRecords/Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.EventHubsTests/EventHubsCRUD.json # src/ResourceManager/EventHub/Commands.EventHub.Test/SessionRecords/Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.NamespaceTests/NamespaceAuthorizationRulesCRUD.json # src/ResourceManager/EventHub/Commands.EventHub.Test/SessionRecords/Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.NamespaceTests/NamespaceCRUD.json commit 0001c62 Author: REDMOND\v-ajnava <[email protected]> Date: Thu Nov 24 03:58:12 2016 -0800 Review comments and WXI file commit 1eb3f3b Author: REDMOND\v-ajnava <[email protected]> Date: Wed Nov 23 11:09:35 2016 -0800 WXI file commit 15ce842 Author: REDMOND\v-ajnava <[email protected]> Date: Wed Nov 23 11:02:43 2016 -0800 Review changes commit 9c094fa Author: REDMOND\sazeesha <[email protected]> Date: Fri Nov 18 18:32:15 2016 -0800 New Session Records commit 86816de Author: REDMOND\sazeesha <[email protected]> Date: Fri Nov 18 14:27:33 2016 -0800 Fix for build failure commit acda882 Author: REDMOND\sazeesha <[email protected]> Date: Fri Nov 18 11:30:36 2016 -0800 reference to test project commit 046adb2 Author: REDMOND\sazeesha <[email protected]> Date: Thu Nov 17 17:34:27 2016 -0800 Azure EventHub PS CmdLets commit a6fad5a Author: REDMOND\v-ajnava <[email protected]> Date: Thu Nov 17 17:26:41 2016 -0800 removed the extra line from Test.Targets commit 78914ad Author: REDMOND\v-ajnava <[email protected]> Date: Thu Nov 17 17:11:15 2016 -0800 added a reference to eventhub test project to Test.Targets commit 1ca66a2 Author: REDMOND\v-ajnava <[email protected]> Date: Wed Nov 16 19:50:26 2016 -0800 Added the set property commit 9061a2c Author: REDMOND\v-ajnava <[email protected]> Date: Wed Nov 16 17:19:17 2016 -0800 Changes regarding the new object creation for New and Set cmdlets commit 46cfcce Author: REDMOND\v-ajnava <[email protected]> Date: Mon Nov 14 19:22:59 2016 -0800 cleaned SetupManagementClients and added 'Hyak.Common' reference commit 52aa0b4 Author: REDMOND\sazeesha <[email protected]> Date: Mon Nov 14 17:11:34 2016 -0800 EventHub PS CmdLets
EventHub Cleanup and App.config fix Microsoft.Rest.ClientRuntime.Azure.Authentication - 2.2.9 - preivew Test project updated Review comments resolved. Removed the references from Common library.
|
||
``` | ||
git rebase -i HEAD~3 | ||
``` |
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.
it looks liek you need to rebase, there are far too many file changes in this
on demand run here: http://azuresdkci.cloudapp.net/job/powershell-demand/1338/ |
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="2.28.1" targetFramework="net45" /> | ||
<package id="Microsoft.Net.Http" version="2.2.29" targetFramework="net45" /> | ||
<package id="Microsoft.Rest.ClientRuntime" version="2.3.2" targetFramework="net45" /> | ||
<package id="Microsoft.Rest.ClientRuntime.Azure" version="3.3.2" targetFramework="net45" /> |
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 will need to be updated to 3.3.4
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.
Resolved
<package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="net45" /> | ||
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="2.28.1" targetFramework="net45" /> | ||
<package id="Microsoft.Net.Http" version="2.2.29" targetFramework="net45" /> | ||
<package id="Microsoft.Rest.ClientRuntime" version="2.3.2" targetFramework="net45" /> |
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 will need to be updated to 2.3.4
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.
Resolved
<Private>True</Private> | ||
</Reference> | ||
<Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> | ||
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.2.3.3\lib\net45\Microsoft.Rest.ClientRuntime.dll</HintPath> |
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.
2.3.4
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.
Resolved
<Private>True</Private> | ||
</Reference> | ||
<Reference Include="Microsoft.Rest.ClientRuntime.Azure, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> | ||
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.3.3.2\lib\net45\Microsoft.Rest.ClientRuntime.Azure.dll</HintPath> |
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.
3.3.4
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.
Resolved
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="2.28.3" targetFramework="net45" /> | ||
<package id="Microsoft.Net.Http" version="2.2.28" targetFramework="net45" /> | ||
<package id="Microsoft.Rest.ClientRuntime" version="2.3.3" targetFramework="net45" /> | ||
<package id="Microsoft.Rest.ClientRuntime.Azure" version="3.3.2" targetFramework="net45" /> |
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.
3.3.4
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.
Resolved
<package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="net45" /> | ||
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="2.28.3" targetFramework="net45" /> | ||
<package id="Microsoft.Net.Http" version="2.2.28" targetFramework="net45" /> | ||
<package id="Microsoft.Rest.ClientRuntime" version="2.3.3" targetFramework="net45" /> |
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.
2.3.4
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.
Resolved
|
||
[Parameter(Mandatory = true, | ||
Position = 2, | ||
ParameterSetName = SASRuleParameterSetName, |
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 resolved. If you don't have more than one parameter set, then remove the ParameterSetName from this attribute. If you do have multiple parameter sets, then you need to attribute ther parameters for the parameter set they belong in, and you need to set 'DefaultParameterSetName' in the Cmdlet attribute
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.
Resolved
|
||
[Parameter(Mandatory = true, | ||
Position = 3, | ||
ParameterSetName = RegenerateKeySetName, |
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 there are not multiple parameter sets, then remove the ParameterSetName from this attribute. If there are multiople parameter sets, then you need to indicate the parameter set for each parameter and add the 'DefaultParameterSetName' setting to the Cmdlet attribute
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.
Resolved
On demand: http://azuresdkci.cloudapp.net/view/1-AzurePowerShell/job/powershell-demand/1345/ Sign job: http://azuresdkci.cloudapp.net/view/1-AzurePowerShell/job/powershell-sign/759/ LGTM once both pass |
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 aPassThrough
parameter.Cmdlet Parameter Guidelines