Skip to content

[ChangeSafety] Fix base calls in GetDynamicParameters#29222

Open
notyashhh wants to merge 2 commits intomainfrom
yash/dynamic-parameter-fix
Open

[ChangeSafety] Fix base calls in GetDynamicParameters#29222
notyashhh wants to merge 2 commits intomainfrom
yash/dynamic-parameter-fix

Conversation

@notyashhh
Copy link
Member

@notyashhh notyashhh commented Mar 2, 2026

Description

Mandatory Checklist

  • SHOULD update ChangeLog.md file(s) appropriately
    • Update src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.
      • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header in the past tense.
    • Should not change ChangeLog.md if no new release is required, such as fixing test case only.
  • SHOULD regenerate markdown help files if there is cmdlet API change. Instruction
  • SHOULD have proper test coverage for changes in pull request.
  • SHOULD NOT adjust version of module manually in pull request

Copilot AI review requested due to automatic review settings March 2, 2026 06:37
@azure-client-tools-bot-prd
Copy link

Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status.

@notyashhh notyashhh changed the title []Fix base calls in GetDynamicParameters [ChangeSafety] Fix base calls in GetDynamicParameters Mar 2, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates several cmdlets’ GetDynamicParameters() implementations to preserve and return dynamic parameters provided by base cmdlet classes, instead of returning null or always starting from a new empty dictionary. This helps ensure inherited dynamic parameters (from AzureRMCmdlet/AzurePSCmdlet/module base cmdlets) continue to flow through when a cmdlet doesn’t add its own dynamic parameters.

Changes:

  • Return base.GetDynamicParameters() instead of null when no custom dynamic parameters are needed (Storage, IoTHub, CosmosDB).
  • Seed RuntimeDefinedParameterDictionary instances from base.GetDynamicParameters() before adding cmdlet-specific runtime parameters (Network, Resources, DataMigration, Accounts config).
  • Minor whitespace-only change in TestDeploymentCmdletBase.

Reviewed changes

Copilot reviewed 16 out of 17 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/Storage/Storage/File/Cmdlet/SetAzureStorageFileContent.cs Returns base dynamic parameters on non-Windows instead of null.
src/Storage/Storage/File/Cmdlet/GetAzureStorageFileContent.cs Returns base dynamic parameters on non-Windows instead of null.
src/Resources/ResourceManager/Implementation/CmdletBase/TestDeploymentCmdletBase.cs Whitespace-only change in method spacing.
src/Resources/ResourceManager/Implementation/CmdletBase/DeploymentStacksCreateCmdletBase.cs Seeds dynamic parameter dictionary from base.GetDynamicParameters().
src/Resources/ResourceManager/Implementation/CmdletBase/DeploymentCmdletBase.cs Seeds dynamic parameter dictionary from base.GetDynamicParameters().
src/Network/Network/PrivateLinkService/PrivateLinkResource/GetAzurePrivateLinkResourceCommand.cs Seeds runtime parameter dictionary from base before adding provider-specific parameter.
src/Network/Network/PrivateLinkService/PrivateEndpointConnection/PrivateEndpointConnectionBaseCmdlet.cs Seeds runtime parameter dictionary from base before adding provider-specific parameter.
src/IotHub/IotHub/IotHub/Routing/AddAzureRmIotHubRoutingEndpoint.cs Returns base dynamic parameters when endpoint type doesn’t require custom dynamic params.
src/IotHub/IotHub/IotHub/DataPlane/Module/SetAzIotHubModule.cs Returns base dynamic parameters when auth method doesn’t require custom dynamic params.
src/IotHub/IotHub/IotHub/DataPlane/Module/AddAzIotHubModule.cs Returns base dynamic parameters when auth method doesn’t require custom dynamic params.
src/IotHub/IotHub/IotHub/DataPlane/Device/SetAzIotHubDevice.cs Returns base dynamic parameters when auth method doesn’t require custom dynamic params.
src/IotHub/IotHub/IotHub/DataPlane/Device/AddAzIotHubDevice.cs Returns base dynamic parameters when auth method doesn’t require custom dynamic params.
src/DataMigration/DataMigration/Cmdlets/NewDataMigrationTask.cs Merges base dynamic parameters with task-type-specific runtime params and returns combined dictionary.
src/DataMigration/DataMigration/Cmdlets/NewConnectionInfoCmdlet.cs Merges base dynamic parameters with server-type-specific runtime params and returns combined dictionary.
src/DataMigration/DataMigration/Cmdlets/InvokeDataMigrationCommand.cs Merges base dynamic parameters with command-type-specific runtime params and returns combined dictionary.
src/CosmosDB/CosmosDB/CosmosDBAccount/NewAzCosmosDBAccount.cs Returns base dynamic parameters when PIT restore dynamic params aren’t used.
src/Accounts/Accounts/Config/ConfigCommandBase.cs Preserves base-class dynamic parameters before adding config-key runtime params.

return base.GetDynamicParameters();
}

Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

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

Line contains trailing whitespace (blank line with spaces). Please remove the extra spaces to avoid unnecessary diffs and formatting noise.

Suggested change

Copilot uses AI. Check for mistakes.
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.

Consider updating the ChangeLog.md file for these modules cause otherwise the change safety work still won't be reflected on them.

This could of cause be defered to the same release of the wave 1 work of change safety. So I'll approve the PR first and let you decide @notyashhh

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.

3 participants