Skip to content
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

Adding RunOn support and other issue fixes. #4349

Merged
merged 1 commit into from
Aug 7, 2017
Merged

Adding RunOn support and other issue fixes. #4349

merged 1 commit into from
Aug 7, 2017

Conversation

vrdmr
Copy link
Member

@vrdmr vrdmr commented Jul 21, 2017

Description

Adding runOn support for Scheduled Job and Webhook cmdlets; Also adding alias for Modules in New/Set Modules. The changes were required for couple of issues raised earlier.


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.

@msftclas
Copy link

@vrdmr,
Thanks for your contribution as a Microsoft full-time employee or intern. You do not need to sign a CLA.
Thanks,
Microsoft Pull Request Bot

@azuresdkci
Copy link

Can one of the admins verify this patch?

@cormacpayne
Copy link
Member

@azuresdkci add to whitelist

Copy link
Member

@cormacpayne cormacpayne left a comment

Choose a reason for hiding this comment

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

@vrdmr Hey Varad, a couple questions:

  1. Do you plan to add test coverage for the cmdlets that are now using RunOn?

  2. Does this PR resolve issues New-AzureRmAutomationWebHook: add support for RunOn #3082 and Register-AzureRmAutomationScheduledRunbook: add support for RunOn #3197 ?

  3. Can you update the change log with a snippet about the changes you are making in this PR?

@markcowl
Copy link
Member

markcowl commented Aug 3, 2017

@vrdmr There has been no activity on this PR in 10 days, we will have to close it this week if you do not address review feedback

@vrdmr
Copy link
Member Author

vrdmr commented Aug 4, 2017

@cormacpayne @markcowl

@cormacpayne cormacpayne changed the base branch from preview to release-4.3.0 August 4, 2017 16:01
Copy link
Member

@cormacpayne cormacpayne left a comment

Choose a reason for hiding this comment

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

@vrdmr it doesn't look like any of the tests that were modified are testing when a value is passed through for the runOn parameter. Any reason for that?

@@ -39,6 +39,7 @@ public class NewAzureAutomationModule : AzureAutomationBaseCmdlet
/// </summary>
[Parameter(Position = 3, Mandatory = true, ValueFromPipelineByPropertyName = true,
HelpMessage = "The url to a module zip package.")]
[Alias("ContentLinkUri")]
Copy link
Member

Choose a reason for hiding this comment

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

@vrdmr I think it would be better if we changed the name of this parameter to ContentLinkUri and added an alias to ContentLink. That way, when users tab through the parameters, ContentLinkUri will show up and will be consistent with what is shown when tabbing through the parameters of Set-AzureRmAutomationModule.

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree. I'll confirm with @safeermohammed and make the change asap.

Copy link
Contributor

@safeermohammed safeermohammed Aug 4, 2017

Choose a reason for hiding this comment

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

@cormacpayne Does changing he parameter name will be breaking change, i.e., does user already using the cmdlet need to do any thing? If this is not the case, fine to do as suggested.

Copy link
Member

Choose a reason for hiding this comment

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

@vrdmr @safeermohammed if we swap the parameter name and its alias, it won't be a breaking change. Existing scripts will be able to continue to use ContentLink; the only difference is when people tab through the possible parameters (as well as look at the docs for the cmdlet), they will see ContentLinkUri, which I think is a better indication of what this parameter is. The use of ContentLink is not lost in this swap.

Copy link
Contributor

Choose a reason for hiding this comment

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

@cormacpayne Thank you for confirmation, we will swap it

@vrdmr
Copy link
Member Author

vrdmr commented Aug 5, 2017

@cormacpayne - No particular reason for not passing any specific values for runOn. It is currently not a high priority scenario and we are in process of adding more functionality in the backend for it.

[ValidateNotNullOrEmpty]
public Uri ContentLink { get; set; }
public Uri ContentLinkUri { 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.

@vrdmr you are still referencing ContentLink below instead of ContentLinkUri, which is causing compilation errors

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

Adding runOn support for Scheduled Job and Webhook cmdlets; Also adding alias for Modules in New/Set Modules. The changes were required for couple of issues raised earlier.
@markcowl
Copy link
Member

markcowl commented Aug 7, 2017

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

@vrdmr Filed issue #4422 for adding additional runOn tests

@cormacpayne cormacpayne merged commit 884a396 into Azure:release-4.3.0 Aug 7, 2017
@vrdmr
Copy link
Member Author

vrdmr commented Aug 7, 2017

Thanks @cormacpayne! :)

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