Skip to content

Conversation

@saifaldin14
Copy link
Contributor

@saifaldin14 saifaldin14 commented Nov 12, 2025

Note: This PR will be merged as a squash commit


This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

All az migrate commands, no change to the features this is just a reorganization of the code to be more maintainable and seperate.

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install wheel==0.30.0 required)
  • My extension version conforms to the Extension version schema

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

Copilot AI review requested due to automatic review settings November 12, 2025 17:42
@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Nov 12, 2025

❌Azure CLI Extensions Breaking Change Test
❌migrate
rule cmd_name rule_message suggest_message
1002 - CmdRemove migrate local get-discovered-server cmd migrate local get-discovered-server removed please confirm cmd migrate local get-discovered-server removed
1006 - ParaAdd migrate local replication init cmd migrate local replication init added parameter resource_group please remove parameter resource_group for cmd migrate local replication init
1007 - ParaRemove migrate local replication init cmd migrate local replication init removed parameter resource_group_name please add back parameter resource_group_name for cmd migrate local replication init
1007 - ParaRemove migrate local replication new cmd migrate local replication new removed parameter resource_group_name please add back parameter resource_group_name for cmd migrate local replication new
⚠️ 1001 - CmdAdd migrate get-discovered-server cmd migrate get-discovered-server added
⚠️ 1001 - CmdAdd migrate local replication get-job cmd migrate local replication get-job added
⚠️ 1006 - ParaAdd migrate local replication new cmd migrate local replication new added parameter resource_group
⚠️ 1001 - CmdAdd migrate local replication remove cmd migrate local replication remove added

@yonzhan
Copy link
Collaborator

yonzhan commented Nov 12, 2025

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

@github-actions
Copy link

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

Copilot finished reviewing on behalf of saifaldin14 November 12, 2025 17:45
@github-actions
Copy link

github-actions bot commented Nov 12, 2025

@github-actions github-actions bot added the release-version-block Updates do not qualify release version rules. NOTE: please do not edit it manually. label Nov 12, 2025
@github-actions github-actions bot removed the release-version-block Updates do not qualify release version rules. NOTE: please do not edit it manually. label Nov 12, 2025
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 reorganizes the Azure Migrate CLI extension codebase by splitting a large monolithic custom.py file into smaller, more maintainable modules organized in a hierarchical folder structure. The refactoring also adds two new commands (remove and get-job) and updates the extension version to 2.0.1b1 (preview).

Key changes:

  • Splits helper functions from a single file into organized modules under helpers/ directory
  • Updates all import paths throughout the codebase to reflect new structure
  • Adds remove-local-server-replication and get-local-replication-job commands
  • Marks extension as preview in metadata
  • Cleans up unused exception variables in test code

Reviewed Changes

Copilot reviewed 24 out of 25 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
setup.py Updates version to 2.0.1b1
azext_metadata.json Marks extension as preview
custom.py Updates imports to new helper module paths; adds new command functions
commands.py Adds new command registrations; fixes command group hierarchy
_params.py Updates argument context paths; adds parameters for new commands
_help.py Adds help documentation for new commands
HISTORY.rst Documents version changes
helpers/_utils.py New consolidated utilities module
helpers/_server.py Server discovery helper functions
helpers/replication/*/ Organized replication workflow modules
test_migrate_commands.py Updates test mocks to new import paths; removes unused variables
Comments suppressed due to low confidence (1)

src/migrate/azext_migrate/helpers/replication/new/_process_inputs.py:1

  • The function validate_server_parameters in _validate.py returns a tuple (rg_uri, machine_id) but in the old version in _process_inputs.py it only returned rg_uri. The function signature has changed during the refactoring. Ensure all call sites have been updated to handle both return values. The call in custom.py (line 281) correctly unpacks both values, which is good.

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