Skip to content

Relay PS Draft #3789

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

Merged
merged 3 commits into from
May 2, 2017
Merged

Relay PS Draft #3789

merged 3 commits into from
May 2, 2017

Conversation

v-Ajnava
Copy link

@v-Ajnava v-Ajnava commented Apr 18, 2017

Description

Relay Power Shell First draft.

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

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.
  • The pull request does not introduce breaking changes (unless a major version change occurs in the assembly and module).

Testing Guidelines

  • Pull request includes test coverage for the included changes.
  • PowerShell scripts used in tests should do any necessary setup as part of the test or suite setup, and should not use hard-coded values for locations or existing resources.

Cmdlet Signature Guidelines

  • New cmdlets that make changes or have side effects should implement ShouldProcess and have SupportShouldProcess=true specified in the cmdlet attribute. You can find more information on ShouldProcess here.
  • Cmdlet specifies OutputType attribute if any output is produced - if the cmdlet produces no output, it should implement a PassThru parameter.

Cmdlet Parameter Guidelines

  • Parameter types should not expose types from the management library - complex parameter types should be defined in the module.
  • Complex parameter types are discouraged - a parameter type should be simple types as often as possible. If complex types are used, they should be shallow and easily creatable from a constructor or another cmdlet.
  • Cmdlet parameter sets should be mutually exclusive - each parameter set must have at least one mandatory parameter not in other parameter sets.

@azurecla
Copy link

@v-Ajnava, Thanks for signing the contribution license agreement so quickly! Actual humans will now validate the agreement and then evaluate the PR.

Thanks, AZPRBOT;

@cormacpayne
Copy link
Member

@v-Ajnava applying the needs-revision label until feedback from design review is resolved

Copy link
Member

@markcowl markcowl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comments from the review have only been partially applied. Specific comments inline for the first set of cmdlets - most comments apply to all cmdlets.

# ProcessorArchitecture = ''

# Modules that must be imported into the global environment prior to importing this module
RequiredModules = @(@{ModuleName = 'AzureRM.Profile'; ModuleVersion = '2.7.0'; })
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should match the current version (2.8.0)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved

PSData = @{

# Tags applied to this module. These help with module discovery in online galleries.
Tags = 'Azure','ResourceManager','ARM','Relay'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about ServiceBus as a Tag?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved

-->
## Current Release

## Version 0.0.1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only heading in the file should be for 'Current Release' - the file will be updated after the release.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So please remove the heading for version 0.0.1

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved

## Version 0.0.1
* Adds commandlets for the Azure Relay

- New-AzureRmRelayNamespace
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably too much info. Simply adding a list of cdlets and a summary of what, as a group, the cmdlets allow you to do should be sufficient.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved

<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<SignAssembly>true</SignAssembly>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to sign the test assembly, please don't

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved.

/// 'Remove-AzureRmRelayNamespaceAuthorizationRule' Cmdlet deletes specified Relay Namespace AuthorizationRule
/// </summary>
[Cmdlet(VerbsCommon.Remove, RelayNamespaceAuthorizationRuleVerb, SupportsShouldProcess = true), OutputType(typeof(bool))]
public class RemoveAzureRmRelayNamespaceAuthorizationRule : AzureRelayCmdletBase
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment - authorization rule cmdlets should be centralized

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this file is excluded. missed to delete the file. deleting this file now.

ValueFromPipelineByPropertyName = true,
HelpMessage = "Relay Namespace object.")]
[ValidateNotNullOrEmpty]
public RelayNamespaceAttirbutesUpdateParameter InputObject { get; set; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ValueFromPipeline, as noted previously

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved.

/// 'Set-AzureRmRelayNamespaceAuthorizationRule' Cmdlet updates specified Relay Namespace AuthorizationRule
/// </summary>
[Cmdlet(VerbsCommon.Set, RelayNamespaceAuthorizationRuleVerb, SupportsShouldProcess = true), OutputType(typeof(AuthorizationRuleAttributes))]
public class SetAzureRelayNamespaceAuthorizationRule : AzureRelayCmdletBase
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment about authorization rule cmdlets

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I excluded individual authorization rules cmdlets but missed to delete these files. Deleting it now.

/// <para> If AuthorizationRule name provided, a single AuthorizationRule detials will be returned</para>
/// <para> If AuthorizationRule name not provided, list of AuthorizationRules will be returned</para>
/// </summary>
[Cmdlet(VerbsCommon.Get, RelayWcfRelayAuthorizationRuleVerb), OutputType(typeof(List<AuthorizationRuleAttributes>))]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comments as for all authorization rule cmdlets. Also, comments from HybridConnection relays apply ato all cmdlets here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I excluded individual authorization rules cmdlets but missed to delete these files. Deleting it now.

Position = 1,
HelpMessage = "Namespace Name.")]
[ValidateNotNullOrEmpty]
public string NamespaceName { get; set; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you neglected to apply the review commenbts here

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My apologies, I excluded individual authorization rules cmdlets but missed to delete these files. Deleting it now.

Ajit Navasare (MINDTREE LIMITED) added 2 commits May 1, 2017 13:11
@cormacpayne
Copy link
Member

Copy link
Member

@markcowl markcowl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of nits, which you could clean up in a subsequent PR

{
if (ShouldProcess(target: RegenerateKey, action: string.Format(Resources.RegenerateKeyHybirdconnection, Name, HybridConnection)))
{
WriteObject(Client.HybridConnectionsRegenerateKeys(ResourceGroupName, Namespace, HybridConnection, Name, RegenerateKey));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should enumerate the keys if this is a collection (for each of these branches), bu using WriteObject(collection, true)

@@ -0,0 +1,43 @@
// ----------------------------------------------------------------------------------
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<nit>For .Net coding Guildines compatibility, you should change the name fo the file to match the name of the class </nit>

@@ -1453,3 +1453,18 @@
"Microsoft.Azure.Commands.Network.dll","Microsoft.Azure.Commands.Network.NewAzureRmIpsecPolicyCommand","New-AzureRmIpsecPolicy","1","8410","Parameter SADataSizeKilobytes of cmdlet New-AzureRmIpsecPolicy does not follow the enforced naming convention of using a singular noun for a parameter name.","Consider using a singular noun for the parameter name."
"Microsoft.Azure.Commands.Network.dll","Microsoft.Azure.Commands.Network.NewAzureVirtualNetworkGatewayConnectionCommand","New-AzureRmVirtualNetworkGatewayConnection","1","8410","Parameter UsePolicyBasedTrafficSelectors of cmdlet New-AzureRmVirtualNetworkGatewayConnection does not follow the enforced naming convention of using a singular noun for a parameter name.","Consider using a singular noun for the parameter name."
"Microsoft.Azure.Commands.Network.dll","Microsoft.Azure.Commands.Network.NewAzureVirtualNetworkGatewayConnectionCommand","New-AzureRmVirtualNetworkGatewayConnection","1","8410","Parameter IpsecPolicies of cmdlet New-AzureRmVirtualNetworkGatewayConnection does not follow the enforced naming convention of using a singular noun for a parameter name.","Consider using a singular noun for the parameter name."
"Microsoft.Azure.Commands.AnalysisServices.Dataplane.dll","Microsoft.Azure.Commands.AnalysisServices.Dataplane.RestartAzureAnalysisServer","Restart-AzureAnalysisServicesInstance","2","8210","Restart-AzureAnalysisServicesInstance does not have a Force parameter but the cmdlet verb 'Restart' indicates that it may perform destructive actions under certain circumstances. Consider whether the cmdlet should have a Force parameter anduse ShouldContinue under some circumstances. ","Consider wether the cmdlet should have a Force parameter and use ShouldContinue under some circumstances. "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to set suppressions for severity 2 signature issues - these are just wranings. Sev 0 and Sev 1 need to be suppressed, if valid.

@markcowl
Copy link
Member

markcowl commented May 2, 2017

@markcowl markcowl merged commit a22c522 into Azure:preview May 2, 2017
@v-Ajnava v-Ajnava deleted the Relaypower branch April 12, 2018 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants