Skip to content

Refactor template deployment cmdlets. #10798

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 13 commits into from
Feb 4, 2020

Conversation

Tiano2017
Copy link
Contributor

Description

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

…actor

# Conflicts:
#	src/Resources/ResourceManager/SdkClient/ResourceManagerSdkClient.cs
…actor

# Conflicts:
#	src/Blueprint/Blueprint.Test/Blueprint.Test.csproj
#	src/Resources/ResourceManager/ResourceManager.csproj
#	src/Resources/ResourceManager/SdkClient/ResourceManagerSdkClient.cs
#	src/Resources/Resources.Test/SessionRecords/Microsoft.Azure.Commands.Resources.Test.ScenarioTests.PolicyTests/TestPolicyDefinitionCRUDAtManagementGroup.json
#	src/Resources/Resources.Test/SessionRecords/Microsoft.Azure.Commands.Resources.Test.ScenarioTests.PolicyTests/TestPolicyDefinitionMode.json
@isra-fel
Copy link
Member

For PR big like this, a cmdlet design review is required.

As for the online-version, you can add them manually.

@Tiano2017
Copy link
Contributor Author

For PR big like this, a cmdlet design review is required.

As for the online-version, you can add them manually.

Created an issue here: https://github.com/Azure/azure-powershell-cmdlet-review-pr/issues/462

HelpMessage = "The name of deployment.")]
[ValidateNotNullOrEmpty]
public string Name { get; set; }

[Alias("DeploymentId", "ResourceId")]
[Parameter(ParameterSetName = GetAzureDeploymentCmdlet.DeploymentIdParameterSet, Mandatory = false,
[Parameter(ParameterSetName = GetAzureSubscriptionDeploymentCmdlet.DeploymentIdParameterSet, Mandatory = true,
Copy link
Member

Choose a reason for hiding this comment

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

Changing an optional parameter to mandatory is a breaking change, and it cannot be checked in until next breaking change release which is ~May.
I agree that it should be mandatory, but my suggestion is to add a breaking change attribute and make the change later.

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 also the cause to CI failure

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 shouldn't be breaking. "Id" is the only parameter in this parameter set. If you don't specify the "id" parameter, you'll land with the default parameter set which is "GetByDeploymentName".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can change it back to "mandatory" to false if that's the right thing..

Copy link
Member

Choose a reason for hiding this comment

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

Right.. then it's a false positive. Please read Debugging StaticAnalysis Errors to suppress the warning.


Gets deployment operations with name "Deploy01" at the management group "myMG".

### Example 2: Get a deployment and get its deployment operations
Copy link
Member

Choose a reason for hiding this comment

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

Nice examples!

@Tiano2017
Copy link
Contributor Author

@isra-fel I've made the changes. can you help take another look?

…actor

# Conflicts:
#	src/Resources/Resources/ChangeLog.md
@isra-fel
Copy link
Member

isra-fel commented Feb 3, 2020

@isra-fel I've made the changes. can you help take another look?

Sorry for the late response. I believe you are right about it not being a breaking change. If you could revert the last commit and suppress the warning I would be able to merge. Thanks

@Tiano2017
Copy link
Contributor Author

Tiano2017 commented Feb 3, 2020

@isra-fel so the only issue is the CI run gave an error if I make that change. Is that an bug in the CI run?

@isra-fel
Copy link
Member

isra-fel commented Feb 3, 2020

@isra-fel so the only issue is the CI run gave an error if I make that change. Is that an bug in the CI run?

Our CI runs static analysis on the code. One of the checks is for breaking changes. The error was that it detected one (potential) breaking change.

According to your comment it did not break anything after all, so we can suppress the error by following these instructions: https://github.com/Azure/azure-powershell/blob/master/documentation/Debugging-StaticAnalysis-Errors.md#breaking-changes

@Tiano2017
Copy link
Contributor Author

@isra-fel so the only issue is the CI run gave an error if I make that change. Is that an bug in the CI run?

Our CI runs static analysis on the code. One of the checks is for breaking changes. The error was that it detected one (potential) breaking change.

According to your comment it did not break anything after all, so we can suppress the error by following these instructions: https://github.com/Azure/azure-powershell/blob/master/documentation/Debugging-StaticAnalysis-Errors.md#breaking-changes

updated. can you help take a look and merge?

@isra-fel
Copy link
Member

isra-fel commented Feb 4, 2020

/azp run azure-powershell - powershell-core

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 1 pipeline(s).

@isra-fel isra-fel merged commit f904d89 into Azure:master Feb 4, 2020
dingmeng-xue pushed a commit to dingmeng-xue/azure-powershell that referenced this pull request Mar 29, 2020
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.

3 participants