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

Added support for retry policy update for failed items #11359

Merged
merged 2 commits into from
Mar 20, 2020

Conversation

sambitratha
Copy link
Contributor

Added a parameter to specify whether or not to retry policy update for failed items.

Checklist

  • I have read the Submitting Changes section of CONTRIBUTING.md
  • The title of the PR is clear and informative
  • The appropriate ChangeLog.md file(s) has been updated:
    • For any service, the ChangeLog.md file can be found at src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md
    • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header -- no new version header should be added
  • The PR does not introduce breaking changes
  • If applicable, the changes made in the PR have proper test coverage
  • For public API changes to cmdlets:
    • a cmdlet design review was approved for the changes in this repository (Microsoft internal only)
    • the markdown help files have been regenerated using the commands listed here

@adxsdkps
Copy link
Collaborator

Can one of the admins verify this patch?

@isra-fel isra-fel self-assigned this Mar 18, 2020
Copy link
Member

@isra-fel isra-fel left a comment

Choose a reason for hiding this comment

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

Hi @sambitratha , please see my inline comments. Thanks!

Comment on lines 40 to 43
[Parameter(Position = 1, Mandatory = true, HelpMessage = ParamHelpMsgs.Policy.ProtectionPolicy,
ValueFromPipeline = true)]
ValueFromPipeline = true, ParameterSetName = ModifyPolicyParamSet)]
[Parameter(Position = 1, Mandatory = true, HelpMessage = ParamHelpMsgs.Policy.ProtectionPolicy,
ValueFromPipeline = true, ParameterSetName = FixInconsistentPolicyParamSet)]
Copy link
Member

Choose a reason for hiding this comment

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

If the parameter appears in all the parameter sets, you don't have to specify it twice. In fact, the attribute can remain unchanged.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In that case can i remove both parameter sets and instead just write Parameter(mandatory=true) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And if it's allowed to do so, making changes in existing parametersets, will it be considered as a breaking change?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, by omitting the ParameterSetName = *** you are telling powershell that every parameter sets owns it.
It's not changing existing param set, so is not a breaking change.

/// <summary>
/// Retry Policy Update for Failed Items
/// </summary>
[Parameter(Mandatory = false, HelpMessage = ParamHelpMsgs.Policy.FixForInConsistentItems,
Copy link
Member

Choose a reason for hiding this comment

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

I think this switch parameter is mandatory in this parameter set, right?

Copy link
Member

Choose a reason for hiding this comment

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

And ValidateNotNullOrEmpty won't be necessary

Copy link
Member

Choose a reason for hiding this comment

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

Besides, since you are changing the cmdlet surface, please regenerate help document.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, will do the changes

Copy link
Member

@isra-fel isra-fel left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@isra-fel isra-fel merged commit 9fb02d3 into Azure:master Mar 20, 2020
dingmeng-xue pushed a commit to dingmeng-xue/azure-powershell that referenced this pull request Mar 29, 2020
Added support for retry policy update for failed items
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.

4 participants