Skip to content

Conversation

@varunkch
Copy link

@varunkch varunkch commented Jan 12, 2018

Description

Adding new Powershell module for MSI (Managed Service Identity).

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.

@varunkch
Copy link
Author

I ran the tests by setting the credentials using Set-TestEnvironment and the tests succeeded but no SessionRecords were generated.

@cormacpayne
Copy link
Member

@varunkch the build is failing because there is no markdown help provided for your cmdlets. See this guide for more information on using the platyPS module to generate the markdown files for your cmdlets.

Copy link
Contributor

@maddieclayton maddieclayton left a comment

Choose a reason for hiding this comment

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

Here is an initial review - I may have a few more comments once these comments are addressed and I can do another in depth review.

Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason you can't use GetRMModulePath below? No reason to add a method if it is not necessary.

Copy link
Author

Choose a reason for hiding this comment

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

Changed to use GetRMModulePath

Copy link
Contributor

Choose a reason for hiding this comment

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

It is standard for modules to start at version 1.0.0.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please update this to the current version of Profile (4.2.0).

Copy link
Contributor

Choose a reason for hiding this comment

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

You will need to regenerate the WIX file: https://github.com/Azure/azure-powershell/wiki/Azure-Powershell-Developer-Guide#updating-the-installer

This should fix your build issues.

Copy link
Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

Choose a reason for hiding this comment

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

Please change RootNamespace and AssemblyName to Microsoft.Azure.Commands.ManagedServiceIdentity.Tests

Copy link
Contributor

Choose a reason for hiding this comment

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

Add better message and store in Resources

Copy link
Contributor

Choose a reason for hiding this comment

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

Please add descriptions for each of these cmdlets - if you regenerate the description for the individual modules should be automatically filled in, but you will have to fill the module description manually.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please add sample output for all examples.

Copy link
Contributor

Choose a reason for hiding this comment

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

Change to System.Boolean

Copy link
Contributor

Choose a reason for hiding this comment

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

Please update the online version for these markdown files

@cormacpayne
Copy link
Member

@maddieclayton would you mind taking a look at that changes Varun pushed, as well as helping him with the failing test?

@MiYanni
Copy link
Contributor

MiYanni commented Feb 12, 2018

@varunkch Can you also squash the commits? Thanks.

@maddieclayton
Copy link
Contributor

@varunkch Once you have fixed the test (as outlined by Cormac over email) and squashed the commits, please assign this back to me.

Copy link
Contributor

@maddieclayton maddieclayton left a comment

Choose a reason for hiding this comment

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

Once the online version is updated, this will be good to go. Ping me once this is done, and I will start a sign run.

---
external help file: Microsoft.Azure.Commands.ManagedServiceIdentity.dll-Help.xml
Module Name: AzureRM.ManagedServiceIdentity
online version: 1.0.0
Copy link
Contributor

Choose a reason for hiding this comment

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

All you need to do is follow the format, and it will create the proper link:

online version: https://docs.microsoft.com/en-us/powershell/module/azurerm.managedserviceidentity/get-azurermuserassignedidentity

online version: https://docs.microsoft.com/en-us/powershell/module/azurerm.managedserviceidentity/new-azurermuserassignedidentity

online version: https://docs.microsoft.com/en-us/powershell/module/azurerm.managedserviceidentity/remove-azurermuserassignedidentity

@maddieclayton
Copy link
Contributor

@maddieclayton
Copy link
Contributor

<Project>{3436a126-edc9-4060-8952-9a1be34cdd95}</Project>
<Name>Commands.ScenarioTests.ResourceManager.Common</Name>
</ProjectReference>
<ProjectReference Include="..\..\Profile\Commands.Profile\Commands.Profile.csproj">
Copy link
Contributor

Choose a reason for hiding this comment

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

You will need to remove both Profile and Resources in order to pass the sign job. Additionally, it seems like a lot of these project references are unnecessary (scenariotests for instance should only be in the test csproj). Please go through and remove the references that are not being used in your project.

Copy link
Author

@varunkch varunkch Mar 1, 2018

Choose a reason for hiding this comment

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

Well I had added these references when you mentioned that I need to add all the common references from this file line 15-35 for sign job to pass:
https://github.com/Azure/azure-powershell/blob/preview/src/ResourceManager/Resources/Resources.sln#L15

I though we need to add all :)

Removed Resources, Profile and ScenarioTests, RBAC, Storage, Network since we dont need them

VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ManagedServiceIdentity", "Commands.ManagedServiceIdentity\Commands.ManagedServiceIdentity.csproj", "{228EB071-FA04-43B3-95F9-7D76DBF0B850}"
ProjectSection(ProjectDependencies) = postProject
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't look correct - please fix this so it follows the format below. Did you add the new project on visual studio?

@varunkch
Copy link
Author

varunkch commented Mar 5, 2018

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