Skip to content

Azure RM Dns Bug Fixes and Update to Help File #2835

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 34 commits into from
Sep 1, 2016

Conversation

corinagum
Copy link

@corinagum corinagum commented Aug 25, 2016

  1. [No work item#] Update to Help File
  2. [No work item#] Fix -Confirm parameter to accept $false & remove -Force
  3. Bug 6412699 PowerShell Error: can’t convert …DnsRecordSet to type …DnsRecordSet
  4. Bug 3172031 PowerShell should warn if record name suffix matches zone name
  5. Bug 5600833 PowerShell New/Remove-AzureRmDnsRecordSet supports SOA
  6. Bug 6059441 PowerShell should expose NumRecordSets and MaxNumRecordSets

This checklist is used to make sure that common issues in a pull request are covered by the creator. You can find a more complete discussion of PowerShell cmdlet best practices here.

Below in Overall Changes, check off the boxes that apply to your PR. Within each of the categories that you select, make sure that you can check off all of the boxes.

Overall Changes

General

  • Title of the PR is clear and informative
  • There are a small number of commits that each have an informative message
  • If it applies, references the bug/issue that the PR fixes
  • All files have the Microsoft copyright header
  • Cmdlets refer to management libraries through nuget references - no dlls are checked in
  • The PR does not introduce breaking changes (unless a major version change occurs in the assembly and module)

Tests

  • PR includes test coverage for the included changes
  • Tests must use xunit, and should either use Moq to mock management client calls, or use the scenario test framework
  • PowerShell scripts used in tests must not use hard-coded values for location
  • 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 existing resources
  • Tests should not use App.config files for settings
  • Tests should use the built-in PowerShell functions for generating random names when unique names are necessary - this will store names in the test recording
  • Tests should use Start-Sleep to pause rather than Thread.Sleep

Cmdlet Signature

  • Cmdlet name uses an approved PowerShell verb - use the enums for VerbsCommon, VerbsCommunication, VerbsLifecycle, VerbsOther whenever possible
  • Cmdlet noun name uses the AzureRm prefix for management cmdlets, and the Azure prefix for data plane cmdlets
  • Cmdlet specifies the OutputType attribute if any output is produced; if the cmdlet produces no output, it should implement a PassThrough parameter
  • If the cmdlet makes changes or has side effects, it should implement ShouldProcess and have SupportShouldProcess = true specified in the cmdlet attribute. See a discussion about correct ShouldProcess implementation here
  • Cmdlets should derive from AzureRmCmdlet for management cmdlets, and AzureDataCmdlet for data cmdlets
  • If multiple parameter sets are implemented, the cmdlet should specify a DefaultParameterSetName in its cmdlet attribute

Parameters

  • Cmdlets should have no more than four positional parameters
  • Cmdlet parameter sets should be mutually exclusive - each parameter set must have at least one mandatory parameter not in other parameter sets
  • 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
  • Parameters should be explicitly marked as Mandatory or not, and should contain a HelpMessage
  • No parameter is of type object.
    • Management cmdlets should have the following parameters and aliases:
      • ResourceGroupName with (optional) alias to ResourceGroup type string marked as [ValueFromPipelineByPropertyName]
      • Name with alias to ResourceName type string marked as [ValueFromPipelineByPropertyName]
      • Location (if appropriate) type string
      • Tag, type HashTable

Parameters and the Pipeline

  • Complex parameters should take values from the pipeline when possible, and certainly when they match the output type of another cmdlet
  • Only one parameter should use ValueFromPipeline per parameter set; parameters from different parameter sets may have this attribute, but should not be convertible
  • No parameter is of type object
  • Each management cmdlet should have a parameter set that takes ResourceGroupName and Name from the pipeline by property value
  • For a given resource type, it should be possible to pipe the output of Get and New cmdlets to the input of Set, Update, Remove and other action cmdlets for that resource

Corina added 30 commits August 18, 2016 11:04
…nd Confirm Impact where applicable; modifies tests to not use -Force

Signed-off-by: Corina <[email protected]>
@azurecla
Copy link

Hi @corinajacobson, I'm your friendly neighborhood Azure Pull Request Bot (You can call me AZPRBOT). Thanks for your contribution!


It looks like you're working at Microsoft (v-cojaco). If you're full-time, we DON'T require a contribution license agreement.



If you are a vendor, DO please sign the electronic contribution license agreement. It will take 2 minutes and there's no faxing! https://cla.azure.com.

TTYL, AZPRBOT;

@azuresdkci
Copy link

Can one of the admins verify this patch?

@azurecla
Copy link

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

Thanks, AZPRBOT;

@@ -215,6 +215,7 @@
<None Include="..\..\Common\Commands.ScenarioTests.ResourceManager.Common\AzureRM.Resources.ps1">
<Link>ScenarioTests\AzureRM.Resources.ps1</Link>
</None>
<None Include="app.config" />
Copy link
Member

Choose a reason for hiding this comment

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

remove, this will cause failures, ass it is on .gitignore

@markcowl
Copy link
Member

@azuresdkci add to whitelist

@corinagum
Copy link
Author

All comments have been addressed and I will push to pull request after running tests one more time. Thank you!

@@ -61,15 +61,17 @@ public class NewAzureDnsRecordSet : DnsBaseCmdlet
[Parameter(Mandatory = false, HelpMessage = "Do not fail if the record set already exists.")]
public SwitchParameter Overwrite { get; set; }

[Parameter(Mandatory = false, HelpMessage = "Do not ask for confirmation.")]
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 a breaking change. The advice for this breaking change is to leave the parameeter add the [Obsolete(...)] attribute to the property, and not use it in cmdlet execution. This gives users time to adapt to the change.

@markcowl
Copy link
Member

@corinajacobson Sorry, I had forgotten about the breaking change policy, so missed this last time - weh should leave the Force parameters, not use them, and makr them as obsolete - this gives users a chance to update their scripts.

@jtuliani
Copy link

@markcowl Does the breaking change policy apply to services in Preview?

@markcowl
Copy link
Member

@jtuliani Right now there is no preview for powershell. WHen there is, it will not, but for now, there is only one way for customers to get azure powershell

@markcowl
Copy link
Member

on demand run here:http://azuresdkci.cloudapp.net/view/1-AzurePowerShell/job/powershell-demand/1135/

LGTM once the build passes

@jtuliani
Copy link

@markcowl The Azure DNS service is in Preview. As with other Azure Previews, we clearly state that it is provided without SLA, and without Azure Support, should not be used for production workloads, and is subject to a 50% billing discount.

To me, 'Preview' includes every part of the service, including the PowerShell cmdlets and CLI. I therefore don't think the breaking change policy should apply (indeed, we have made other breaking changes during Preview, although we prefer not to of course).

@corinagum
Copy link
Author

Looks like tests have passed! Please let me know if I can do anything else to help out.

@markcowl
Copy link
Member

markcowl commented Sep 1, 2016

@jtuliani Unfortunately, we don't have any current way of differentiating the preview from the stable modules in azure powershell. Expect some discussion of new policy in this area over the next couple of weeks.

@markcowl markcowl merged commit d300324 into Azure:dev Sep 1, 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.

5 participants