Skip to content

Conversation

ankitbaluni123
Copy link
Contributor

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

Ankit Baluni (from Dev Box) added 4 commits September 8, 2025 15:53
…e parameter

- Added new parameter -Expedite to expedite the operation of a replicating server.
- Updated documentation to include usage examples for the -Expedite parameter.
- Modified existing examples to reflect new project and resource group names.
- Enhanced output formatting in examples to provide clearer information.
- Added tests for the new -Expedite functionality.
- Updated ChangeLog to document the addition of the -Expedite feature.
@Copilot Copilot AI review requested due to automatic review settings September 8, 2025 11:19
Copy link

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

Copy link
Contributor

Thank you for your contribution @ankitbaluni123! We will review the pull request and get back to you soon.

Copy link
Contributor

@Copilot 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 adds support for a new -Expedite parameter to the Get-AzMigrateServerMigrationStatus cmdlet in the Azure PowerShell Migrate module. The enhancement provides migration teams with resource utilization analysis and prioritization recommendations for Azure migration operations.

Key changes include:

  • Added new -Expedite parameter with GetByPrioritiseServer parameter set
  • Enhanced documentation with new Example 4 showing expedite functionality
  • Added comprehensive resource sharing and utilization analysis logic

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/Migrate/Migrate/help/Get-AzMigrateServerMigrationStatus.md Updated help documentation with new parameter set and expedite example
src/Migrate/Migrate/ChangeLog.md Added changelog entry for the expedite parameter enhancement
src/Migrate/Migrate.Autorest/test/Get-AzMigrateServerMigrationStatus.Tests.ps1 Added test stub for new GetByPrioritiseServer parameter set
src/Migrate/Migrate.Autorest/custom/Get-AzMigrateServerMigrationStatus.ps1 Implemented expedite functionality with resource analysis and recommendations
src/Migrate/Migrate.Autorest/examples/Get-AzMigrateServerMigrationStatus.md Updated examples documentation with expedite use case
src/Migrate/Migrate.Autorest/docs/Get-AzMigrateServerMigrationStatus.md Updated cmdlet documentation with new parameter and examples

Comment on lines +196 to 203
elseif ($ReplicationMigrationItem.MigrationState -match "InitialSeedingFailed") {
return "InitialReplication Failed"
}

if ($ReplicationMigrationItem.MigrationState -eq "MigrationSucceeded") {
return "Migration Completed"
if ([string]::IsNullOrEmpty($State)) {
return $ReplicationMigrationItem.MigrationState
}

Copy link
Preview

Copilot AI Sep 8, 2025

Choose a reason for hiding this comment

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

The logic flow in the GetFormattedMigrationState function has become unclear with nested conditions. The function should use consistent if-elseif-else structure or early returns to improve readability and maintainability.

Copilot uses AI. Check for mistakes.

Comment on lines +255 to +259
if ($null -ne $Value) {
return "$Value %"
} else {
return "-"
}
Copy link
Preview

Copilot AI Sep 8, 2025

Choose a reason for hiding this comment

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

The Add-Percent function should validate that $Value is a numeric type and within reasonable percentage bounds (0-100) before formatting to prevent unexpected output.

Copilot uses AI. Check for mistakes.

Comment on lines +792 to +794
$recommendations += "`nResource `"$resource`" is $status. Recommendations:"
$recommendations += "Stop other processes running on the appliance that are consuming RAM."
$recommendations += "Stop initial replication (IR) or pause delta replication (DR) for other low-priority VMs migrating under this appliance to free up RAM."
Copy link
Preview

Copilot AI Sep 8, 2025

Choose a reason for hiding this comment

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

The recommendation strings are hardcoded and duplicated across different resource types. Consider extracting these into a centralized recommendation configuration or lookup table to improve maintainability and consistency.

Copilot uses AI. Check for mistakes.

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.

1 participant