Skip to content

[AzureRT] December release #3263

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 12 commits into from
Dec 9, 2016
Merged

[AzureRT] December release #3263

merged 12 commits into from
Dec 9, 2016

Conversation

hyonholee
Copy link
Contributor

  • Add "Force" parameter to Remove cmdlets (Breaking change)
  • Remove unnecessary (redundant) properties from VM object.
  • Add DisplayHint property to VM object to enable Compact and Expand display modes
  • Add "Remove-AzureRmVMSecret" cmdlet

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

  • 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 PassThrough 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.

@@ -42,6 +42,7 @@ public class RemoveAzureRmContainerServiceAgentPoolProfileCommand : Microsoft.Az
[Parameter(
Mandatory = true,
Position = 1,
ParameterSetName = "NameParameterSet",
Copy link
Member

Choose a reason for hiding this comment

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

@hyonholee why was this parameter set added?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We generated these cmdlets. For Removing there are can be more than one way to removing (for example, removing with a name and removing with a id), so we added parameter set name for each removing way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If this is concerned, I will update our generator and remove parameter set when there is only one way to remove.

Copy link
Member

Choose a reason for hiding this comment

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

I was just wondering why it was added. As long as the scenario where only the ContainerService parameter is provided is covered, this will be fine

@@ -42,9 +42,17 @@ public class RemoveAzureRmVmssExtensionCommand : Microsoft.Azure.Commands.Resour
[Parameter(
Mandatory = true,
Position = 1,
ParameterSetName = "NameParameterSet",
Copy link
Member

Choose a reason for hiding this comment

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

@hyonholee same comment about parameter set

@@ -42,9 +42,17 @@ public class RemoveAzureRmVmssNetworkInterfaceConfigurationCommand : Microsoft.A
[Parameter(
Mandatory = true,
Position = 1,
ParameterSetName = "NameParameterSet",
Copy link
Member

Choose a reason for hiding this comment

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

@hyonholee same question about parameter set

@@ -88,34 +91,7 @@ public string ResourceGroupName
// Gets or sets the storage profile.
public StorageProfile StorageProfile { get; set; }

[JsonIgnore]
Copy link
Member

Choose a reason for hiding this comment

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

@hyonholee why were these properties removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is unnecessary. This property is just a copy of a nested property, which was used for piping scenario, but now the piping scenario works without these properties. There was a complain about these redundant property.

Copy link
Member

Choose a reason for hiding this comment

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

There are numerous cmdlets that output an object of type PSVirtualMachine, and existing scripts that use this object will no longer be able to use these properties, which means it's a breaking change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can we announce the breaking change? Do you think it is serious? These properties are not included in the VM response at the top level. They are nested properties and we added these redundant properties at the top level just for pipeline.

Copy link

@singhkays singhkays Dec 8, 2016

Choose a reason for hiding this comment

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

@hyonholee Not sure this release is setup to be a breaking change. Can we leave this in the object until next time we have a breaking change release?

@cormacpayne What do we need to do for a breaking change release?

Position = 1,
ValueFromPipelineByPropertyName = true,
Copy link
Member

Choose a reason for hiding this comment

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

@hyonholee why did you remove this attribute? Scripts that get DataDiskNames from the pipeline will no longer work

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pipeline works because I also updated Remove-AzureRmVMDataDisk. Please look at Test-VirtualMachineProfile test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually there is an issue with pipeline with Remove-AzureRmVMDataDisk (and other Remove command that removes a property from VM object.) Since this parameteter (DataDiskNames) have an alias "Name" and VM object has "Name" property for VM Name, in piping scenario (e.g. Get-AzureRmVM | Remove-AzureRmVMDataDisk ), VM name is piped to Remove-AzureRmVMDataDisk as a data disk name, and it tries to remove a data disk named VM name. Setting ValueFromPipelineByPropertyName to false removes this issue. Also we remove "DataDiskNames" (which is redundant property) from VM object, DataDiskNames are not piped from VM object to Remove-AzureRmVM. Remove-AzureRmVM is also modified when DataDiskNames are not provided, it interprets it as removing all existing data disks. So the command does not change the behavior of Get-AzureRmVM | Remove-AzureRmVM .

Position = 1,
ValueFromPipelineByPropertyName = true,
Copy link
Member

Choose a reason for hiding this comment

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

@hyonholee same comment about removing this attribute

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same issue with Remove-AzureRmVMDataDisk

ProfileNouns.VaultSecretGroup),
OutputType(
typeof(PSVirtualMachine))]
public class RemoveAzureVMSecretCommand : Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet
Copy link
Member

Choose a reason for hiding this comment

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

@hyonholee since this cmdlet makes changes, it should implement SupportsShouldProcess

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This cmdlet only updates a local VM object and does not actually remove the secret from VM, until Update-AzureRmVM is performed with the updated VM object. Other Remove cmdlets that change only local object do not have ShouldProcess or Force parameter

@cormacpayne
Copy link
Member

@hyonholee the build is failing because there is no help for the new cmdlet Remove-AzureRmVMSecret, and the same cmdlet does not implement SupportsShouldProcess

@hyonholee
Copy link
Contributor Author

I will update the help file. Thanks for comments.

@hyonholee hyonholee changed the base branch from dev to release-3.3.0 December 9, 2016 01:08
@cormacpayne
Copy link
Member

@cormacpayne cormacpayne merged commit b841e45 into Azure:release-3.3.0 Dec 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants